Skip to content
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

server/leader: use the last modify revision to watch leader #1317

Merged
merged 3 commits into from
Nov 9, 2018

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Nov 8, 2018

What problem does this PR solve?

the watcher maybe loses some event without specified revision. In our election, there is a gap between got leader key and watch the leader key, if some event happens in this gap, like delete the leader key and write a new leader key, the watcher will lose those events, and cause the PD still think the leader is the old one.

What is changed and how it works?

get the last modify revision and use it to watch.

Check List

Tests

  • Unit test
  • Integration test

@nolouch nolouch force-pushed the watch-revision branch 2 times, most recently from 1ba3c99 to 56e7a00 Compare November 8, 2018 14:05
server/util.go Outdated
@@ -83,6 +83,17 @@ func CheckPDVersion(opt *scheduleOption) {
// A helper function to get value with key from etcd.
// TODO: return the value revision for outer use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the TODO?

@nolouch
Copy link
Contributor Author

nolouch commented Nov 9, 2018

/run-all-tests

@disksing disksing merged commit 1c25147 into tikv:master Nov 9, 2018
@nolouch nolouch deleted the watch-revision branch November 9, 2018 11:32
rleungx pushed a commit to rleungx/pd that referenced this pull request Nov 12, 2018
* server/leader: use the last modify revision to watch leader
@nolouch nolouch added the needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch. label Nov 12, 2018
nolouch added a commit to nolouch/pd that referenced this pull request Nov 12, 2018
* server/leader: use the last modify revision to watch leader
nolouch added a commit that referenced this pull request Nov 12, 2018
* server: use same initialcluster config to restart joined member (#1279)

* server/leader: use the last modify revision to watch leader (#1317)
@nolouch nolouch added needs-cherry-pick-release-2.0 The PR needs to cherry pick to release-2.0 branch. and removed needs-cherry-pick-release-2.0 The PR needs to cherry pick to release-2.0 branch. labels Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants