Skip to content

Commit

Permalink
Change log message based on dry run
Browse files Browse the repository at this point in the history
Change the log message to reflect the dry run status; if not a dry run,
the message now says the transactions have been queued (as opposed to
the hypothetical "would have been queued" in the dry run).

Signed-off-by: Tyler Coleman <[email protected]>
  • Loading branch information
tycol7 committed Nov 30, 2023
1 parent b397718 commit bb56e55
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 bb56e55

Please sign in to comment.