fix prewrite & commit log info to debug(#776)

This commit is contained in:
b.tian 2024-01-17 11:33:50 +08:00
parent 533dbc23a1
commit aedfd66b88
1 changed files with 31 additions and 22 deletions

View File

@ -227,8 +227,9 @@ public class TwoPhaseCommitter implements AutoCloseable {
this.doCommitPrimaryKeyWithRetry(backOffer, key, commitTs);
}
}
LOG.info("commit primary key {} successfully", KeyUtils.formatBytes(key));
if (commitResult.isSuccess() && LOG.isDebugEnabled()) {
LOG.debug("commit primary key {} successfully", KeyUtils.formatBytes(key));
}
}
/**
@ -397,11 +398,13 @@ public class TwoPhaseCommitter implements AutoCloseable {
BatchKeys batchKeys,
Map<ByteString, Kvrpcpb.Mutation> mutations)
throws TiBatchWriteException {
if (LOG.isDebugEnabled()) {
LOG.debug(
"start prewrite secondary key, row={}, size={}KB, regionId={}",
batchKeys.getKeys().size(),
batchKeys.getSizeInKB(),
batchKeys.getRegion().getId());
}
List<ByteString> keyList = batchKeys.getKeys();
int batchSize = keyList.size();
@ -445,12 +448,14 @@ public class TwoPhaseCommitter implements AutoCloseable {
throw new TiBatchWriteException(errorMsg, e);
}
}
if (LOG.isDebugEnabled()) {
LOG.debug(
"prewrite secondary key successfully, row={}, size={}KB, regionId={}",
batchKeys.getKeys().size(),
batchKeys.getSizeInKB(),
batchKeys.getRegion().getId());
}
}
private void appendBatchBySize(
List<BatchKeys> batchKeyList,
@ -592,11 +597,13 @@ public class TwoPhaseCommitter implements AutoCloseable {
private void doCommitSecondaryKeySingleBatchWithRetry(
BackOffer backOffer, BatchKeys batchKeys, long commitTs) throws TiBatchWriteException {
LOG.info(
if (LOG.isDebugEnabled()) {
LOG.debug(
"start commit secondary key, row={}, size={}KB, regionId={}",
batchKeys.getKeys().size(),
batchKeys.getSizeInKB(),
batchKeys.getRegion().getId());
}
List<ByteString> keysCommit = batchKeys.getKeys();
ByteString[] keys = new ByteString[keysCommit.size()];
keysCommit.toArray(keys);
@ -612,12 +619,14 @@ public class TwoPhaseCommitter implements AutoCloseable {
LOG.warn(error);
throw new TiBatchWriteException("commit secondary key error", commitResult.getException());
}
LOG.info(
if (commitResult.isSuccess() && LOG.isDebugEnabled()) {
LOG.debug(
"commit {} rows successfully, size={}KB, regionId={}",
batchKeys.getKeys().size(),
batchKeys.getSizeInKB(),
batchKeys.getRegion().getId());
}
}
private GroupKeyResult groupKeysByRegion(ByteString[] keys, int size, BackOffer backOffer)
throws TiBatchWriteException {