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

raft: ensure leader is in ProgressStateReplicate #10279

Merged
merged 1 commit into from
Nov 24, 2018

Conversation

tbg
Copy link
Contributor

@tbg tbg commented Nov 20, 2018

The leader perpetually kept itself in ProgressStateProbe even though of
course it has perfect knowledge of its log. This wasn't usually an issue
because it also doesn't care about its own Progress, but it's better to
keep this data correctly maintained, especially since this is part of
raft.Status and thus becomes visible to applications using the Raft
library.

(Concretely, in CockroachDB we use the Progress to inform log
truncations).

@tbg tbg requested a review from bdarnell November 20, 2018 09:36
@codecov-io
Copy link

codecov-io commented Nov 20, 2018

Codecov Report

Merging #10279 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10279      +/-   ##
==========================================
- Coverage   71.72%   71.72%   -0.01%     
==========================================
  Files         391      391              
  Lines       36375    36376       +1     
==========================================
  Hits        26090    26090              
+ Misses       8474     8473       -1     
- Partials     1811     1813       +2
Impacted Files Coverage Δ
raft/raft.go 92.14% <100%> (+0.01%) ⬆️
proxy/grpcproxy/register.go 69.44% <0%> (-13.89%) ⬇️
pkg/fileutil/purge.go 65.9% <0%> (-6.82%) ⬇️
clientv3/namespace/watch.go 87.87% <0%> (-6.07%) ⬇️
pkg/testutil/recorder.go 77.77% <0%> (-3.71%) ⬇️
pkg/adt/interval_tree.go 84.98% <0%> (-3.61%) ⬇️
etcdctl/ctlv2/command/get_command.go 71.42% <0%> (-3.58%) ⬇️
clientv3/leasing/kv.go 89.03% <0%> (-1.33%) ⬇️
raft/node.go 90.45% <0%> (-0.77%) ⬇️
etcdserver/raft.go 80.09% <0%> (-0.72%) ⬇️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02a9810...5c209d6. Read the comment docs.

@tbg
Copy link
Contributor Author

tbg commented Nov 20, 2018

Thanks for the review, @bdarnell.
@gyuho, looks like the tests are flaky. Or is that somehow fallout of this change? The raft tests pass reliably locally.

@hexfusion
Copy link
Contributor

Hi @tbg can we fix this CI failure please https://travis-ci.com/etcd-io/etcd/jobs/159792633

raft/raft.go Outdated Show resolved Hide resolved
@xiang90
Copy link
Contributor

xiang90 commented Nov 21, 2018

lgtm.

@tbg tbg changed the title Ensure leader is in ProgressStateReplicate raft: ensure leader is in ProgressStateReplicate Nov 23, 2018
The leader perpetually kept itself in ProgressStateProbe even though of
course it has perfect knowledge of its log. This wasn't usually an issue
because it also doesn't care about its own Progress, but it's better to
keep this data correctly maintained, especially since this is part of
raft.Status and thus becomes visible to applications using the Raft
library.

(Concretely, in CockroachDB we use the Progress to inform log
truncations).
@xiang90 xiang90 merged commit f28945b into etcd-io:master Nov 24, 2018
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this pull request Apr 6, 2022
Addresses a long-standing TODO.

We picked up etcd-io/etcd#10279 a while ago.
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Apr 7, 2022
79522: kv: remove raft leader progress override in newTruncateDecision r=nvanbenschoten a=nvanbenschoten

Addresses a long-standing TODO.

We picked up etcd-io/etcd#10279 a while ago.

Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants