-
Notifications
You must be signed in to change notification settings - Fork 503
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: Adds id and pk to ChangeFeedMetadata for delete operations #4922
Draft
jcocchi
wants to merge
7
commits into
master
Choose a base branch
from
users/jcocchi/updateChangeFeedItem
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
814d5b2
Update ChangeFeedItem to include id and pk metadata
jcocchi c8b47fc
update emulator tests for avad delete operations
jcocchi c9900c6
add output of UpdateContracts script
jcocchi b66a6a7
undo encryption contracts changes
jcocchi e38c25c
update changefeed metadata serialization
jcocchi 673e86c
update ttl delete test
jcocchi 1da602c
update change feed metadata contract
jcocchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Update ChangeFeedItem to include id and pk metadata
- Loading branch information
commit 814d5b2bc7471a512e585aa5d568311a1e1c5f9e
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
namespace Microsoft.Azure.Cosmos | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using Microsoft.Azure.Cosmos.Resource.FullFidelity; | ||
using Microsoft.Azure.Cosmos.Resource.FullFidelity.Converters; | ||
|
@@ -21,7 +22,7 @@ namespace Microsoft.Azure.Cosmos | |
#else | ||
internal | ||
#endif | ||
class ChangeFeedMetadata | ||
class ChangeFeedMetadata | ||
{ | ||
/// <summary> | ||
/// The change's conflict resolution timestamp. | ||
|
@@ -50,9 +51,21 @@ class ChangeFeedMetadata | |
public long PreviousLsn { get; internal set; } | ||
|
||
/// <summary> | ||
/// Used to distinquish explicit deletes (e.g. via DeleteItem) from deletes caused by TTL expiration (a collection may define time-to-live policy for documents). | ||
/// Used to distinguish explicit deletes (e.g. via DeleteItem) from deletes caused by TTL expiration (a collection may define time-to-live policy for documents). | ||
/// </summary> | ||
[JsonProperty(PropertyName = ChangeFeedMetadataFields.TimeToLiveExpired, NullValueHandling = NullValueHandling.Ignore)] | ||
public bool IsTimeToLiveExpired { get; internal set; } | ||
|
||
/// <summary> | ||
/// The id of the previous item version. Used for delete operations only. | ||
/// </summary> | ||
[JsonProperty(PropertyName = ChangeFeedMetadataFields.DeletedItemId, NullValueHandling = NullValueHandling.Ignore)] | ||
public string DeletedItemId { get; internal set; } | ||
|
||
/// <summary> | ||
/// The partition key of the previous item version. Dictionary Key is the partition key property name and Dictionary Value is the partition key property value. Used for delete operations only. | ||
/// </summary> | ||
[JsonProperty(PropertyName = ChangeFeedMetadataFields.DeletedItemPartitionKey, NullValueHandling = NullValueHandling.Ignore)] | ||
public Dictionary<string, string> DeletedItemPartitionKey { get; internal set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would recommend checking with Kiran/Fabien on how the Hierarchical keys are represented with in our codebase so that we are consistent but otherwise I would mark it as Dictionary<string, object> as the value could of any type. |
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 understand that the backend only returns Deleted Item information for now but in the future it will also return update information and so on. Do you think it would be better to name this field as ItemId instead of DeletedItemId? We can update our documentation to reflect this fact.
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.
Id and partition key in the metadata section will always only be for delete. I added the DeletedItem prefix to disambiguate that, otherwise customers may expect it to be populated for every operation.
You may be thinking of
Previous
which will eventually be populated for both deletes and updates.