gc,server: add GC state cache test coverage#10617
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Hi @wfxr. Thanks for your PR. I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Welcome @wfxr! |
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
8a3cfb7 to
45b7d41
Compare
|
@MyonKeminta: 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. |
| res := <-resultCh | ||
| re.NoError(res.err) | ||
| re.Nil(res.resp.GetHeader().GetError()) | ||
| re.Equal(uint64(10), res.resp.GetGcState().GetTxnSafePoint()) |
There was a problem hiding this comment.
This is mainly meant to pin the current cache-hit behavior rather than define the ideal long-term contract.
In this scenario, the request has already copied the cached GC state before the leadership churn. The current handler only rechecks whether this PD is leader again before replying, so if the same PD regains leadership before the final response check, it can return that earlier cached value.
I updated the test comment to make this explicit and to avoid implying that this stale snapshot is a permanent/ideal API contract. If we decide to tighten GetGCState semantics in the future, the implementation, docs, and this test should be updated together.
|
/ok-to-test |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-fts-202602 #10617 +/- ##
======================================================
+ Coverage 77.20% 78.86% +1.65%
======================================================
Files 524 524
Lines 84076 70599 -13477
======================================================
- Hits 64908 55675 -9233
+ Misses 15190 10943 -4247
- Partials 3978 3981 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
b909965 to
30f8961
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MyonKeminta, okJiang, rleungx 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 |
What problem does this PR solve?
Issue Number: Ref #10607
What is changed and how does it work?
This PR supplements the GC state cache change with focused test coverage.
Checklist of covered scenarios:
GetGCStateon the same uncached keyspaceGetGCStateon the same cached keyspaceCheck List
Tests
Code changes
Side effects
Related changes
pingcap/docs/pingcap/docs-cn:pingcap/tiup:Release note