-
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
replica_rac2: add admitted state protocol #130074
Conversation
cf1e9f6
to
05e161c
Compare
Epic: none Release note: none
05e161c
to
af15b82
Compare
Epic: none Release note: none
a5535d9
to
58cfecb
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 2 of 2 files at r1, 1 of 1 files at r2, 10 of 10 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @pav-kv)
pkg/kv/kvserver/raft_transport.go
line 753 at r3 (raw file):
// TODO(pav-kv): send these protos once they are populated correctly. if true { return
Any reason not to do this now, so it can be tested? I suppose TestFlowControlRaftTransportV2
did not test whether the outgoing message actually included the piggybacked state. Worth leaving a TODO in that test.
pkg/kv/kvserver/raft_transport.go
line 770 at r3 (raw file):
batch.Requests = batch.Requests[:0] batch.StoreIDs = nil batch.Now = hlc.ClockTimestamp{}
this needs to clear the AdmittedStates
slice too.
pkg/kv/kvserver/raft_transport.go
line 810 at r3 (raw file):
var pendingDispatches []kvflowcontrolpb.AdmittedRaftLogEntries var admittedStates []kvflowcontrolpb.PiggybackedAdmittedState
nit: do we need this declared here, or can it be declared at usage time below.
pkg/kv/kvserver/raft_transport.go
line 831 at r3 (raw file):
kvadmission.FlowTokenDispatchMaxBytes.Get(&t.st.SV), ) maybeAnnotateWithAdmittedRaftLogEntries(req, pendingDispatches)
if we want to reuse this test knob for v2, we should do the annotation here. We have the batch
.
pkg/kv/kvserver/kvflowcontrol/node_rac2/admitted_piggybacker_test.go
line 44 at r3 (raw file):
d.ScanArgs(t, "store-id", &storeID) d.ScanArgs(t, "range-id", &rangeID) d.ScanArgs(t, "term", &term)
can you add the replicaID fields too.
Epic: none Release note: none
Epic: none Release note: none
58cfecb
to
60ecf7b
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)
pkg/kv/kvserver/raft_transport.go
line 753 at r3 (raw file):
Previously, sumeerbhola wrote…
Any reason not to do this now, so it can be tested? I suppose
TestFlowControlRaftTransportV2
did not test whether the outgoing message actually included the piggybacked state. Worth leaving a TODO in that test.
Added a TODO. Choosing not to send these messages just yet to be sure that none of this is on the wire in master/prod right now. Just in case we want to tweak these protos while developing (similarly to how we changed the proto definition in this PR in a backwards-incompatible way because we're sure these protos aren't populated yet). I want to enable the send when the replica integration is done and the leader can handle these updates, and both parts are covered by tests.
pkg/kv/kvserver/raft_transport.go
line 770 at r3 (raw file):
Previously, sumeerbhola wrote…
this needs to clear the
AdmittedStates
slice too.
Done.
pkg/kv/kvserver/raft_transport.go
line 810 at r3 (raw file):
Previously, sumeerbhola wrote…
nit: do we need this declared here, or can it be declared at usage time below.
Could be done, but after moving the annotation to the knob branch below (per other comment), the slice has to be defined in this line.
pkg/kv/kvserver/raft_transport.go
line 831 at r3 (raw file):
Previously, sumeerbhola wrote…
if we want to reuse this test knob for v2, we should do the annotation here. We have the
batch
.
Done.
pkg/kv/kvserver/kvflowcontrol/node_rac2/admitted_piggybacker_test.go
line 44 at r3 (raw file):
Previously, sumeerbhola wrote…
can you add the replicaID fields too.
Done.
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 9 of 10 files at r6, 2 of 2 files at r7, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @pav-kv)
TFTR! bors r=sumeerbhola |
This PR introduces
AdmittedState
andPiggybackedAdmittedState
protos, and converts replica- and leader-side code (such asAdmittedPiggybacker
and raft transport) to use them.The protos are not populated at the moment, and the leader-side code is a bunch of TODOs. More conversion code will follow, to replace the
AdmittedResponseForRange
flows.Part of #129508