MINOR: TransactionManager logs the epoch bump less frequently. (#18895)

Reviwers: Justine Olshan <jolshan@confluen.io>
This commit is contained in:
Calvin Liu 2025-02-14 08:37:23 -08:00 committed by Justine
parent e37af20760
commit eddae2ee19
1 changed files with 6 additions and 1 deletions

View File

@ -561,7 +561,12 @@ public class TransactionManager {
* Set the producer id and epoch atomically.
*/
private void setProducerIdAndEpoch(ProducerIdAndEpoch producerIdAndEpoch) {
// With TV2, the epoch bump is common and frequent. Only log if it is at debug level or the producer ID is changed.
if (!isTransactional() || !isTransactionV2Enabled || producerIdAndEpoch.producerId != this.producerIdAndEpoch.producerId) {
log.info("ProducerId set to {} with epoch {}", producerIdAndEpoch.producerId, producerIdAndEpoch.epoch);
} else {
log.debug("ProducerId set to {} with epoch {}", producerIdAndEpoch.producerId, producerIdAndEpoch.epoch);
}
this.producerIdAndEpoch = producerIdAndEpoch;
}