Skip to content

Commit

Permalink
kv: don't respect global_reads on node liveness range
Browse files Browse the repository at this point in the history
Allowing this is a major risk, as it would break node liveness updates, which
perform a 1PC transaction with a commit trigger and can not tolerate being
pushed into the future. We could try to block this at zone config update time,
but due to the complexities of zone config inheritance, we would either need to
be overly restrictive or risk missing cases which could wedge a cluster. This
commit opts to disable the issue more directly.
  • Loading branch information
nvanbenschoten committed Apr 27, 2021
1 parent 776076b commit 0abe89a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/kv/kvserver/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,14 @@ func (r *Replica) descRLocked() *roachpb.RangeDescriptor {
// lock exists in helpers_test.go. Move here if needed.
func (r *Replica) closedTimestampPolicyRLocked() roachpb.RangeClosedTimestampPolicy {
if r.mu.zone.GlobalReads != nil && *r.mu.zone.GlobalReads {
return roachpb.LEAD_FOR_GLOBAL_READS
if !r.mu.state.Desc.ContainsKey(roachpb.RKey(keys.NodeLivenessPrefix)) {
return roachpb.LEAD_FOR_GLOBAL_READS
}
// The node liveness range ignores zone configs and always uses a
// LAG_BY_CLUSTER_SETTING closed timestamp policy. If it was to begin
// closing timestamps in the future, it would break liveness updates,
// which perform a 1PC transaction with a commit trigger and can not
// tolerate being pushed into the future.
}
return roachpb.LAG_BY_CLUSTER_SETTING
}
Expand Down

0 comments on commit 0abe89a

Please sign in to comment.