-
Notifications
You must be signed in to change notification settings - Fork 501
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
Change Feed Processor: Adds backward compatibility of lease store #1733
Conversation
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.
Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors) Description"
Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.
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.
Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors) Description"
Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.
Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/LeaseManagement/DocumentServiceLeaseCore.cs
Show resolved
Hide resolved
Closing due to in-activity, pease feel free to re-open. |
Description
Current state
Currently V3 Change Feed Processor is compatible with V2 Change Feed Processor by doing a forward migration of the schema to the schema used in V3.
Lease schema for V2 CFP
Lease schema for V3 CFP
The V3 SDK performs the in-place migration by removing the
PartitionId
property and replacing it for the future-proofLeaseToken
(for then leases can be created in a different granularity level from partitions).Problem
The problem is that if the user wants to rollback (return to V2) for whatever reason (maybe rollback the deployment), then the schema is not compatible and they are locked in.
Solution
This PR makes it so the SDK will maintain the
PartitionId
attribute only if it was previously there (coming from V2) so if the user goes back to V2, the V2 CFP can continue processing. The value ofPartitionId
will be the same asLeaseToken
.Type of change
Closing issues
Closes #1722