-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
rac2: indicate admitted updates from LogTracker #130200
Conversation
7403734
to
6819469
Compare
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.
Reviewed 1 of 1 files at r1, 3 of 3 files at r2, 2 of 2 files at r3.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @pav-kv)
pkg/kv/kvserver/kvflowcontrol/rac2/log_tracker.go
line 195 at r1 (raw file):
waiting := l.waiting[pri] // There is nothing to admit, or it's a stale admission. if len(waiting) == 0 || at.Index < waiting[0].Index {
Was the fact that it was only comparing the indices the bug?
Can you add a test to catch this.
pkg/kv/kvserver/kvflowcontrol/rac2/log_tracker.go
line 184 at r2 (raw file):
l.stable = stable.Index // The admitted index at a priority has advanced if its queue was empty or // leading the stable index by more than one.
An example would help the reader here.
Say stable index was 5 before this call.
Then if the marks[0].Index is 6 then we can't advance past 5 even is stable index advances to a higher value, say 7.
But if marks[0].Index is 7 or higher we can advance to marks[0].Index-1 which is > the stable index.
pkg/kv/kvserver/kvflowcontrol/rac2/log_tracker.go
line 220 at r2 (raw file):
} // At least one waiting entry can be admitted. The corresponding admitted // index is bumped iff the first entry in the queue was the "bottleneck".
Something like the following would help
// The minimum we could advance to prior to this call was waiting[0].Index-1. If that was < l.stable, we were being held back by this entry. So the condition can be stated as waitig[0].Index-1 < l.stable, or waiting[0].Index <= l.stable.
Epic: none Release note: none
Epic: none Release note: none
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)
pkg/kv/kvserver/kvflowcontrol/rac2/log_tracker.go
line 195 at r1 (raw file):
Previously, sumeerbhola wrote…
Was the fact that it was only comparing the indices the bug?
Can you add a test to catch this.
Done.
pkg/kv/kvserver/kvflowcontrol/rac2/log_tracker.go
line 184 at r2 (raw file):
Previously, sumeerbhola wrote…
An example would help the reader here.
Say stable index was 5 before this call.
Then if the marks[0].Index is 6 then we can't advance past 5 even is stable index advances to a higher value, say 7.
But if marks[0].Index is 7 or higher we can advance to marks[0].Index-1 which is > the stable index.
Done.
pkg/kv/kvserver/kvflowcontrol/rac2/log_tracker.go
line 220 at r2 (raw file):
Previously, sumeerbhola wrote…
Something like the following would help
// The minimum we could advance to prior to this call was waiting[0].Index-1. If that was < l.stable, we were being held back by this entry. So the condition can be stated as waitig[0].Index-1 < l.stable, or waiting[0].Index <= l.stable.
Done.
36fc50f
to
6a680ac
Compare
Epic: none Release note: none
Epic: none Release note: none
6a680ac
to
e405d7b
Compare
TFTR! bors r=sumeerbhola |
This PR makes
LogTracker
return a bit indicating when theAdmitted
vector has changed. The admitted vector is considered "changed" when its leader term goes up (and the admitted indices either stay intact or regress), or the term stays intact but the admitted index at any priority goes up.Part of #129508