-
Notifications
You must be signed in to change notification settings - Fork 467
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
KCL 1.X - Guardrails to avoid checkpoint corruption during resharding #779
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,14 @@ public interface ILeaseSerializer<T extends Lease> { | |
*/ | ||
public Map<String, ExpectedAttributeValue> getDynamoLeaseOwnerExpectation(T lease); | ||
|
||
/** | ||
* @param lease | ||
* @return the attribute value map asserting that the checkpoint state is as expected. | ||
*/ | ||
default Map<String, ExpectedAttributeValue> getDynamoLeaseCheckpointExpectation(T lease) { | ||
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. Maybe good to rename this to something like 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 just want to keep this generic, so that we can add any future state expectations. Also this would set expectation based on checkpoint in the lease. |
||
throw new UnsupportedOperationException("DynamoLeaseCheckpointExpectation is not implemented"); | ||
} | ||
|
||
/** | ||
* @return the attribute value map asserting that a lease does not exist. | ||
*/ | ||
|
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 believe this is also used for leaseRenewal/leaseStealing codepath, where we're heartbeating the lease counter/owner. We don't necessarily expect
SHARD_END
in this case.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 don't see this being used anywhere other than checkpoint code path. And we don't expect SHARD_END here. We expect it not to present when we write a non SHARD_END checkpoint.