-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Defensive Renew Lease #47038
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
base: main
Are you sure you want to change the base?
Defensive Renew Lease #47038
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.
Pull Request Overview
This PR implements a defensive lease renewal mechanism for the change feed processor. The change prevents unnecessary lease renewals when a partition processor has not successfully processed any batches within a verification window (25x the lease renewal interval), allowing other workers to steal the lease.
Key changes:
- Added time-based verification logic to track the last successful batch processing timestamp
- Implemented a
shouldContinue
method that checks if the processor should continue renewing leases based on processing activity - Added comprehensive unit tests to validate the new lease renewal behavior
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
pkversion/PartitionSupervisorImpl.java |
Added defensive lease renewal logic with time-based verification |
epkversion/PartitionSupervisorImpl.java |
Mirrored defensive lease renewal logic for epk version |
pkversion/PartitionProcessorImpl.java |
Added timestamp tracking for last processed batch |
epkversion/PartitionProcessorImpl.java |
Mirrored timestamp tracking for epk version |
pkversion/PartitionProcessor.java |
Added interface method to retrieve last processed time |
epkversion/PartitionProcessor.java |
Mirrored interface method for epk version |
LeaseRenewer.java |
Added interface method to expose lease renewal interval |
pkversion/LeaseRenewerImpl.java |
Implemented getter for lease renewal interval |
epkversion/LeaseRenewerImpl.java |
Mirrored implementation for epk version |
pkversion/PartitionSupervisorImplTests.java |
Added comprehensive unit tests for defensive lease renewal behavior |
epkversion/PartitionSupervisorImplTests.java |
Mirrored test coverage for epk version |
pkversion/PartitionProcessorImplTests.java |
Added test to verify timestamp updates during batch processing |
epkversion/PartitionProcessorImplTests.java |
Mirrored timestamp test for epk version |
Description
See jeet1995#25