tests: stabilize TSO consistency after leader change - #11220
Conversation
Signed-off-by: Ryan Leung <rleungx@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe TSO consistency test tracks the maximum timestamp from the first concurrent round, synchronizes the leader transition, conditionally reconnects the legacy client, and passes the first maximum timestamp as the second round's lower bound. ChangesTSO consistency test
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains in the reviewed change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11220 +/- ##
==========================================
+ Coverage 79.68% 79.70% +0.02%
==========================================
Files 544 544
Lines 78827 78827
==========================================
+ Hits 62813 62829 +16
+ Misses 11649 11632 -17
- Partials 4365 4366 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Signed-off-by: Ryan Leung <rleungx@gmail.com>
|
/retest pull-unit-test-next-gen-2 |
|
@rleungx: The The following commands are available to trigger optional jobs: Use DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/test pull-unit-test-next-gen-2 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: coderabbitai[bot], lhy1024 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
| var wg sync.WaitGroup | ||
| var ( | ||
| wg sync.WaitGroup | ||
| maxTS = lowerBound |
Resolve the consistency test conflict and use an atomic maximum TSO. Signed-off-by: Ryan Leung <rleungx@gmail.com>
|
/retest |
1 similar comment
|
/retest |
What problem does this PR solve?
TestLegacyTSOConsistencySuite/TestRequestTSOConcurrentlykeeps a directgRPC client connected to the original PD leader. After resigning the leader,
the test can send requests to the old endpoint or start before the elected
leader's embedded TSO allocator is ready.
The two concurrent phases also reset their comparison state, so a timestamp
rollback across the leadership transition would not be detected.
Issue Number: close #11219
What is changed and how does it work?
Keep the existing member-election resign trigger. After the new election,
wait for the elected legacy PD leader's embedded TSO allocator to initialize,
and reconnect the direct gRPC client only if another PD becomes leader.
Carry the maximum timestamp from the first concurrent phase into the second,
so every TSO returned after the transition must exceed the pre-transition
high-water mark.
Check List
Tests
Release note
Summary by CodeRabbit