Skip to content

Commit

Permalink
Merge #113726
Browse files Browse the repository at this point in the history
113726: kvpb: add some more information to BatchRequest.SafeFormat r=yuzefovich a=yuzefovich

This commit adds the following information (when non-default):
- lock timeout
- max span request keys
- target bytes
- allow empty.

Epic: None

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Nov 3, 2023
2 parents be845d1 + 38d667b commit 5aa6a0a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/kv/kvpb/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,9 @@ func (ba BatchRequest) SafeFormat(s redact.SafePrinter, _ rune) {
if ba.WaitPolicy != lock.WaitPolicy_Block {
s.Printf(", [wait-policy: %s]", ba.WaitPolicy)
}
if ba.LockTimeout != 0 {
s.Printf(", [lock-timeout: %s]", ba.LockTimeout)
}
if ba.AmbiguousReplayProtection {
s.Printf(", [protect-ambiguous-replay]")
}
Expand All @@ -871,6 +874,12 @@ func (ba BatchRequest) SafeFormat(s redact.SafePrinter, _ rune) {
}
s.Printf("]")
}
if ba.MaxSpanRequestKeys != 0 || ba.TargetBytes != 0 {
s.Printf(", [max_span_request_keys: %d], [target_bytes: %d]", ba.MaxSpanRequestKeys, ba.TargetBytes)
}
if ba.AllowEmpty {
s.Print(", [allow-empty]")
}
}

func (ba BatchRequest) String() string {
Expand Down

0 comments on commit 5aa6a0a

Please sign in to comment.