Skip to content

Commit

Permalink
kv: implement redact.SafeValue for PushTxnType
Browse files Browse the repository at this point in the history
This commit implements redact.SafeValue for PushTxnType with the goal of
displaying the PushTxnType on PushTxnRequest with the redact.

Fixes: #114475
Release note: None.
  • Loading branch information
lyang24 committed Dec 5, 2023
1 parent 57f5963 commit 12f06f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/kv/kvpb/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2152,3 +2152,6 @@ type RangeFeedEventProducer interface {
// range needs to be restarted.
Recv() (*RangeFeedEvent, error)
}

// SafeValue implements the redact.SafeValue interface.
func (PushTxnType) SafeValue() {}
4 changes: 2 additions & 2 deletions pkg/kv/kvpb/string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ func TestRequestSafeFormat(t *testing.T) {
PusherTxn: pusherTxn,
PusheeTxn: pusheeTxn.TxnMeta,
},
redactable: "PushTxn(PUSH_TIMESTAMP,00fbff58->00fbff59)",
redacted: "PushTxn(‹×›,00fbff58->00fbff59)",
redactable: "PushTxn(PUSH_TIMESTAMP,00fbff58->00fbff59)",
redacted: "PushTxn(PUSH_TIMESTAMP,00fbff58->00fbff59)",
},
}
for _, c := range testCases {
Expand Down
1 change: 1 addition & 0 deletions pkg/testutils/lint/passes/redactcheck/redactcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func runAnalyzer(pass *analysis.Pass) (interface{}, error) {
"LeaseAppliedIndex": {},
"RaftIndex": {},
"RaftTerm": {},
"PushTxnType": {},
},
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/ctpb": {
"SeqNum": {},
Expand Down

0 comments on commit 12f06f8

Please sign in to comment.