Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
pdms: support primary/transfer api for scheduling and tso #8157
pdms: support primary/transfer api for scheduling and tso #8157
Changes from 29 commits
7fa19d3
1f13fa2
af995cc
8d36be5
2433f0c
dd72b9c
a39300e
51708b5
c6d2bc3
a4c5c29
4d0598f
6ac311f
510b92a
b235bc1
f659782
32b0b5f
dbc5447
204ffd5
ec8e737
9e3b798
e53844e
cc82e7b
19ce9d8
4c7f8ac
36b5a82
ea8d9e3
ffb7b1b
379b1f6
d9bffb8
d037a6a
e711fd9
d999c7f
7f0a426
d810ed1
43830ec
2d9a3b0
c1da5b5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think here we can optimize the case that if the updated primary is still itself, no need to return to campaign again.
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.
https://github.com/HuSharp/pd/blob/43830ec9ea80d92008be663ec5c26b3d137373a9/pkg/mcs/utils/expected_primary.go#L141-L146
I skipped the member on the outer layer(in
transfer primary
) which is not the same as oldPrimary, do you think I still need to add the restriction inside thewatch
?Maybe the
expected primary flag
should not be modified when the leader is itself, because this flag must keep the lease alive after campaigning new leader, which means that it requires the Primary to quit the currentwatch
.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.
Do we need to check if the kv has the value?
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.
Do we need to skip it in non-ms mode?
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 it's no problem that this code makes false negatives for
non-ms mode
.