You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*: use errors.AssertionFailedf for panic format strings across the codebase
Previously, panic messages containing runtime values were being redacted
when surfaced in CockroachDB logs, making it impossible to diagnose
issues from crash reports.
Replace all panic(fmt.Sprintf(...)) calls with
panic(errors.AssertionFailedf(...)) so the panic value is a proper
structured error with stack traces. errors.AssertionFailedf treats
arguments as unsafe by default, so user key data is still redacted in
CockroachDB logs.
Additionally, wrap safe diagnostic arguments (counts, sizes, indices,
reference counts, levels, etc.) with errors.Safe() so they appear in
redacted crash reports. Implement SafeFormatter on several types
(CompactionState, OpType, OpKind, interleavePos, bitmapEncoding,
compactionKind, objID) so their string representations are visible in
redacted output. User key data arguments are intentionally left
unwrapped to remain redacted.
Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
panic(errors.AssertionFailedf("malformed suffix: %x (length byte is %d; but suffix is %d bytes)", a, a[len(a)-1], len(a)))
479
+
panic(errors.AssertionFailedf("malformed suffix: %x (length byte is %d; but suffix is %d bytes)", errors.Safe(a), errors.Safe(a[len(a)-1]), errors.Safe(len(a))))
0 commit comments