Skip to content

Commit

Permalink
kvserver: fix envvar in closed timestamp regression error hint
Browse files Browse the repository at this point in the history
When a closed timestamp is found to regress, an assertion error is
returned containing this hint:

```
This assertion will fire again on restart; to ignore run with env var COCKROACH_RAFT_CLOSEDTS_ASSERTIONS_ENABLED=true
```

However, this is incorrect: the env var must be set to `false`, not
`true`, to disable the assertion. This patch fixes that, and adds a
missing newline as well.

Release note: None
  • Loading branch information
erikgrinaker committed Nov 21, 2021
1 parent 28bb1ea commit ffe4fd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/replica_application_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ func (b *replicaAppBatch) assertNoCmdClosedTimestampRegression(
return errors.AssertionFailedf(
"raft closed timestamp regression in cmd: %x (term: %d, index: %d); batch state: %s, command: %s, lease: %s, req: %s, applying at LAI: %d.\n"+
"Closed timestamp was set by req: %s under lease: %s; applied at LAI: %d. Batch idx: %d.\n"+
"This assertion will fire again on restart; to ignore run with env var COCKROACH_RAFT_CLOSEDTS_ASSERTIONS_ENABLED=true"+
"This assertion will fire again on restart; to ignore run with env var COCKROACH_RAFT_CLOSEDTS_ASSERTIONS_ENABLED=false\n"+
"Raft log tail:\n%s",
cmd.idKey, cmd.ent.Term, cmd.ent.Index, existingClosed, newClosed, b.state.Lease, req, cmd.leaseIndex,
prevReq, b.closedTimestampSetter.lease, b.closedTimestampSetter.leaseIdx, b.entries,
Expand Down

0 comments on commit ffe4fd1

Please sign in to comment.