Skip to content

Commit

Permalink
txserializer: change log message based on dry run (#14651)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Coleman <tyler@planetscale.com>
  • Loading branch information
tycol7 authored Jan 24, 2024
1 parent 6097a0a commit dc4435e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions go/vt/vttablet/tabletserver/txserializer/tx_serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,18 @@ func (txs *TxSerializer) unlockLocked(key string, returnSlot bool) {
delete(txs.queues, key)

if q.max > 1 {
var formattedKey = key
var logMsg string

if txs.env.Config().SanitizeLogMessages {
logMsg = fmt.Sprintf("%v simultaneous transactions (%v in total) for the same row range (%v) would have been queued.", q.max, q.count, txs.sanitizeKey(key))
} else {
logMsg = fmt.Sprintf("%v simultaneous transactions (%v in total) for the same row range (%v) would have been queued.", q.max, q.count, key)
formattedKey = txs.sanitizeKey(key)
}

if txs.dryRun {
logMsg = fmt.Sprintf("%v simultaneous transactions (%v in total) for the same row range (%v) would have been queued.", q.max, q.count, formattedKey)
txs.logDryRun.Infof(logMsg)
} else {
logMsg = fmt.Sprintf("%v simultaneous transactions (%v in total) for the same row range (%v) have been queued.", q.max, q.count, formattedKey)
txs.log.Infof(logMsg)
}
}
Expand Down

0 comments on commit dc4435e

Please sign in to comment.