-
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
Conversation
…he DDB sequence number is not SHARD_END. 2. Verify the shard end checkpointing by directly looking up the ddb lease entry
request.setExpected(serializer.getDynamoLeaseCounterExpectation(lease)); | ||
Map<String, ExpectedAttributeValue> expectations = serializer.getDynamoLeaseCounterExpectation(lease); | ||
expectations.putAll(serializer.getDynamoLeaseCheckpointExpectation(lease)); | ||
request.setExpected(expectations); |
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.
* @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 comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe good to rename this to something like getDynamoLeaseShardEndCheckpointExpectation
?
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 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.
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.
LGTM
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.