Skip to content

Commit

Permalink
rangefeed: use pointer receiver in MVCCLogicalOp assertion
Browse files Browse the repository at this point in the history
`String()` is only implemented for a pointer receiver, so the formatting
breaks otherwise.

Epic: none
Release note: None
  • Loading branch information
erikgrinaker committed Jan 30, 2024
1 parent 6fcbdfc commit 401d70b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/kv/kvserver/rangefeed/resolved_timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,11 @@ func (rts *resolvedTimestamp) assertOpAboveRTS(
ctx context.Context, op enginepb.MVCCLogicalOp, opTS hlc.Timestamp, fatal bool,
) {
if opTS.LessEq(rts.resolvedTS) {
// NB: MVCCLogicalOp.String() is only implemented for pointer receiver.
// We shadow the variable to avoid it escaping to the heap.
op := op
err := errors.AssertionFailedf(
"resolved timestamp %s equal to or above timestamp of operation %v", rts.resolvedTS, op)
"resolved timestamp %s equal to or above timestamp of operation %v", rts.resolvedTS, &op)
if fatal {
log.Fatalf(ctx, "%v", err)
} else {
Expand Down

0 comments on commit 401d70b

Please sign in to comment.