client: updating keyspace group must check the previous version#9862
client: updating keyspace group must check the previous version#9862ti-chi-bot[bot] merged 13 commits intotikv:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
2f5525f to
1460ce5
Compare
Signed-off-by: 童剑 <1045931706@qq.com>
1460ce5 to
3f7b9ee
Compare
Signed-off-by: 童剑 <1045931706@qq.com>
Signed-off-by: 童剑 <1045931706@qq.com>
Signed-off-by: 童剑 <1045931706@qq.com>
Signed-off-by: 童剑 <1045931706@qq.com>
d34bbed to
a05cff6
Compare
| // urls are the primary/secondary serving URL | ||
| urls []string | ||
|
|
||
| // version is used to avoid updating stale info |
There was a problem hiding this comment.
How about adding a comment to clarify where the version is sourced from and briefly explain its usage?
| primaryURL: "", | ||
| secondaryURLs: make([]string, 0), | ||
| urls: make([]string, 0), | ||
| version: 0, |
There was a problem hiding this comment.
When the TSO client starts up, does it use version=0 for the initial request?
Furthermore, if this initial request is routed to a TSO service with a lower version, is that behavior expected?
There was a problem hiding this comment.
No, this version just works for requesting the keyspace group. Most updates don't relate to this client's keyspace ID, so it doesn't need to be updated.
There was a problem hiding this comment.
The higher version of the server side doesn't mean that the client's keyspace group has changed.
Signed-off-by: 童剑 <1045931706@qq.com>
| // version is used to avoid updating stale info | ||
| // this version is provided by etcd watcher on the server side | ||
| // and increases monotonically. | ||
| // If the new version is less than the current version, it means that the requested tso service hasn't applied the |
There was a problem hiding this comment.
How about clarifying the source of both the new version and the current version?
pkg/tso/keyspace_group_manager.go
Outdated
| // Being merged will cause the group to be removed from this map eventually if the merge is successful. | ||
| requestedGroups map[uint32]struct{} | ||
|
|
||
| modVersion uint64 |
There was a problem hiding this comment.
Please add comments for modVersion uint64.
d6e0452 to
4234bb8
Compare
|
@ystaticy: 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. |
|
/ping @rleungx PTAL again |
Signed-off-by: 童剑 <1045931706@qq.com>
e091432 to
9ee3aac
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9862 +/- ##
==========================================
- Coverage 78.70% 78.45% -0.25%
==========================================
Files 492 503 +11
Lines 66268 67176 +908
==========================================
+ Hits 52153 52706 +553
- Misses 10408 10640 +232
- Partials 3707 3830 +123
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Signed-off-by: 童剑 <1045931706@qq.com>
f4ade90 to
06d1a1d
Compare
Signed-off-by: 童剑 <1045931706@qq.com>
|
|
||
| keyspaceID := c.GetKeyspaceID() | ||
| var keyspaceGroup *tsopb.KeyspaceGroup | ||
| var version uint64 |
There was a problem hiding this comment.
How about unifying the naming, using modRevision and curModRevision?
Signed-off-by: 童剑 <1045931706@qq.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: okJiang, rleungx, ystaticy 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 |
895b48c to
a709f84
Compare
|
/retest |
|
/test pull-unit-test-next-gen |
1 similar comment
|
/test pull-unit-test-next-gen |
What problem does this PR solve?
Issue Number: Close #6770
[Merged]kv proto: #1361
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
Release note