-
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
storage: Add comments about leases and liveness #36984
Conversation
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 4 of 4 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @bdarnell)
pkg/storage/node_liveness.go, line 132 at r1 (raw file):
it is
pkg/storage/node_liveness.go, line 145 at r1 (raw file):
// not working. Transactions were used only to piggyback on the // transaction commit trigger). The leaseholder of the liveness range // gossips its contents whenever they change; no other node reads from
You could mention that we don't blindly gossip everything but attempt to gossip only that which has changed.
pkg/storage/node_liveness.go, line 146 at r1 (raw file):
// transaction commit trigger). The leaseholder of the liveness range // gossips its contents whenever they change; no other node reads from // this range directly.
cockroach/pkg/storage/node_liveness.go
Lines 266 to 269 in a134caa
var oldLiveness storagepb.Liveness | |
if err := nl.db.GetProto(ctx, keys.NodeLivenessKey(nodeID), &oldLiveness); err != nil { | |
return false, errors.Wrap(err, "unable to get liveness") | |
} |
pkg/storage/node_liveness.go, line 544 at r1 (raw file):
// This method is rarely called directly; heartbeats are normally sent // by the StartHeartbeat loop. // TODO(bdarnell): Should we just remove this synchronous heartbeat completely?
Sounds like it, though you'll probably run into trouble actually doing so.
pkg/storage/node_liveness.go, line 620 at r1 (raw file):
// expired while in flight, so maybe we don't have to care about // that and only need to distinguish between same and different // epochs in our return value.
Anything in git blame for this check?
pkg/storage/replica_range_lease.go, line 25 at r1 (raw file):
, and any
I had to study this code for cockroachdb#35986, so I took the opportunity to update the documentation while it's fresh in my mind. Release note: None
b0fcc52
to
8a239fa
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 @bdarnell and @tbg)
pkg/storage/node_liveness.go, line 132 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
it is
Done.
pkg/storage/node_liveness.go, line 145 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
You could mention that we don't blindly gossip everything but attempt to gossip only that which has changed.
Done.
pkg/storage/node_liveness.go, line 146 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
cockroach/pkg/storage/node_liveness.go
Lines 266 to 269 in a134caa
var oldLiveness storagepb.Liveness if err := nl.db.GetProto(ctx, keys.NodeLivenessKey(nodeID), &oldLiveness); err != nil { return false, errors.Wrap(err, "unable to get liveness") }
Oops. Changed to "other nodes rarely read from this range directly", and added a todo to consider making the stronger form true.
pkg/storage/node_liveness.go, line 620 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
Anything in git blame for this check?
It's been there since the beginning (#10305) without much discussion.
pkg/storage/replica_range_lease.go, line 25 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
, and any
I mean "but any". Reworded to "The current arrangement is not perfect, and some opportunities for improvement appear, but any changes must be made very carefully".
bors r=tbg |
Timed out |
bors r=tbg |
Build failed (retrying...) |
36984: storage: Add comments about leases and liveness r=tbg a=bdarnell I had to study this code for #35986, so I took the opportunity to update the documentation while it's fresh in my mind. Release note: None 37100: roachtest: Hopefully deflake election-after-restart r=tbg a=bdarnell Logs suggest that we're seeing failures when nodes aren't caught up on all the split processing before the restart, so give this a chance to finish. Updates #35047 Release note: None Co-authored-by: Ben Darnell <[email protected]>
Build succeeded |
I had to study this code for #35986, so I took the opportunity to
update the documentation while it's fresh in my mind.
Release note: None