-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to queue definition recomputation #1242
Add the ability to queue definition recomputation #1242
Conversation
The version check implementation behaves the same way as the current schema version check.
b10f052
to
4c00f7b
Compare
Add encoding message in queueing. AzureStorageQueue supports parsing encoded message. Added memoryQueueConfig, to support parsing encoded messages. Also add more logging.
… times within one batch
fb8b49f
to
96938b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at this really close and it looks good to me. Probably should get someone with more js experience to review it too.
providers/upgrade/defUpgradeQueue.js
Outdated
if (!this._upgrade) throw new Error('Upgrade queue is not set') | ||
const message = this._constructMessage(definition) | ||
await this._upgrade.queue(JSON.stringify(message)) | ||
this.logger.debug('Queued for definition upgrade ', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've heard this referred to as recompute
which I see in the code in other places. I don't see upgrade
in other parts of the code. Is there a reason to name the queue and method upgrade
instead of recompute
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recompute happens only when schema version is update/upgraded. I am open to renaming it if it improves the readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall everything looks good. Left minor comments/questions.
-add logging to handle queuing failure -remove redundant JSON.stringify when queuing message (there is no impact to message decoding) -move queueHandler and defUpgrader to local scope in setup -minor refactoring to improve code reuse and readability -add more tests
c3cdd04
to
0efd310
Compare
Upon deployment, settings to turn on queuing:
|
Performance Degradation During Schema Version Upgrade
During the process of upgrading the definition schema version, performance degradation has been observed. Currently, schema version updates are handled by recomputing the definition on the fly, which causes slower performance. These updates are critical for data correctness and to introduce the LicenseRef marker.
Proposed Solution:
PR Details:
This PR introduces two implementations for the upgrade handler:
Environment Variables:
versionCheck
as the default.memory
as the default.HARVEST_AZBLOB_CONNECTION_STRING
is used for connection information.definitions-upgrade
.