storage: fix overaggressive raft log truncation#8636
storage: fix overaggressive raft log truncation#8636petermattis merged 1 commit intocockroachdb:masterfrom
Conversation
storage/raft_log_queue.go
Outdated
| truncatableIndex := raftStatus.Commit | ||
| behindIndexes := getBehindIndexes(raftStatus) | ||
| if raftLogSize <= targetSize { | ||
| if raftLogSize <= targetSize && len(behindIndexes) > 0 { |
There was a problem hiding this comment.
By the way, why in the heck are we computing a unique array of behind indexes in getBehindIndexes? That's just silly. Could you remove that extra complication?
|
LGTM |
14bf1a5 to
e74baa8
Compare
|
Review status: 0 of 4 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending. storage/raft_log_queue.go, line 135 [r1] (raw file):
|
|
storage/raft_log_queue.go, line 156 [r2] (raw file):
is Comments from Reviewable |
|
storage/raft_log_queue.go, line 156 [r2] (raw file):
|
|
Review status: 0 of 4 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. storage/raft_log_queue.go, line 156 [r2] (raw file):
|
|
storage/raft_log_queue.go, line 156 [r2] (raw file):
|
|
Review status: 0 of 4 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Comments from Reviewable |
e74baa8 to
70f7a56
Compare
Fixes #8629.
This change is