Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-6094

Reduce verbosity of skipped transactions if transaction has no events relevant to captured tables

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.1.3.Final, 2.2.0.Alpha2
    • 1.9.7.Final, 2.0.1.Final, 2.1.2.Final, 2.2.0.Alpha1
    • oracle-connector
    • None

      During the handleCommit callback, the Oracle LogMiner implementation will write the following log entries to the connector log if the transaction's commit SCN comes before the current commit scn stored in the offsets:

              final Scn commitScn = row.getScn();
              if (offsetContext.getCommitScn().hasCommitAlreadyBeenHandled(row)) {
                  final Scn lastCommittedScn = offsetContext.getCommitScn().getCommitScnForRedoThread(row.getThread());
                  LOGGER.debug("Transaction {} has already been processed. "
                          + "Offset Commit SCN {}, Transaction Commit SCN {}, Last Seen Commit SCN {}.",
                          transactionId, offsetContext.getCommitScn(), commitScn, lastCommittedScn);
                  removeTransactionAndEventsFromCache(transaction);
                  metrics.setActiveTransactions(getTransactionCache().size());
                  return;
              }
      

      It may be helpful for users who may enable debug logging to reduce the verbosity of this warning upon restart and predicate the logging based on whether or not the transaction has any relevant events to the captured tables of the connector. There is little reason to log this message for transactions that occurred in other PDBs or transactions with no relevant changes the connector cares about.

      The proposed change would be:

              final Scn commitScn = row.getScn();
              if (offsetContext.getCommitScn().hasCommitAlreadyBeenHandled(row)) {
                  if (transaction.getNumberOfEvents() > 0) {
                      final Scn lastCommittedScn = offsetContext.getCommitScn().getCommitScnForRedoThread(row.getThread());
                      LOGGER.debug("Transaction {} has already been processed. "
                                           + "Offset Commit SCN {}, Transaction Commit SCN {}, Last Seen Commit SCN {}.",
                                   transactionId, offsetContext.getCommitScn(), commitScn, lastCommittedScn);
                  }
                  removeTransactionAndEventsFromCache(transaction);
                  metrics.setActiveTransactions(getTransactionCache().size());
                  return;
              }
      

              ccranfor@redhat.com Chris Cranford
              ccranfor@redhat.com Chris Cranford
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: