Skip to content

Commit

Permalink
[improvement](transaction) print txn edit log cost time apache#24501
Browse files Browse the repository at this point in the history
  • Loading branch information
yujun777 authored Sep 18, 2023
1 parent f04bc05 commit c746a89
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1504,10 +1504,18 @@ public void logExportUpdateState(long jobId, ExportJobState newState) {

// for TransactionState
public void logInsertTransactionState(TransactionState transactionState) {
long start = System.currentTimeMillis();
long logId = logEdit(OperationType.OP_UPSERT_TRANSACTION_STATE, transactionState);
long logEditEnd = System.currentTimeMillis();
long end = logEditEnd;
if (transactionState.getTransactionStatus() == TransactionStatus.VISIBLE) {
UpsertRecord record = new UpsertRecord(logId, transactionState);
Env.getCurrentEnv().getBinlogManager().addUpsertRecord(record);
end = System.currentTimeMillis();
}
if (end - start > Config.lock_reporting_threshold_ms) {
LOG.warn("edit log insert transaction take a lot time, write bdb {} ms, write binlog {} ms",
logEditEnd - start, end - logEditEnd);
}
}

Expand Down

0 comments on commit c746a89

Please sign in to comment.