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

LogMiner can incorrectly resolve that SCN is available

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.5.0.Final
    • 1.5.0.Beta1
    • oracle-connector
    • None
    • False
    • False
    • Undefined
    • Hide

      Start connector with short archive log retention. While it's running, pause it for longer than the rentention duration.

      Show
      Start connector with short archive log retention. While it's running, pause it for longer than the rentention duration.

    Description

      LogMinerHelper.java:setRedoLogFilesForMining() currently has the following code

      if (onlineLogFilesForMining.size() + archivedLogFilesForMining.size() == 0) {
          throw new IllegalStateException("None of log files contains offset SCN: " + lastProcessedScn + ", re-snapshot is required.");
      } 

      But this will not suffice to detect the case where no redo log covers the lastProcessedScn. To do that, something like

      final boolean hasOverlappingLogFile =
              onlineLogFilesForMining.stream().anyMatch(l -> l.getFirstScn().compareTo(lastProcessedScn) <= 0)
              || archivedLogFilesForMining.stream().anyMatch(l -> l.getFirstScn().compareTo(lastProcessedScn) <= 0);
      if (!hasOverlappingLogFile) {
          throw new IllegalStateException("None of log files contains offset SCN: " + lastProcessedScn + ", re-snapshot is required.");
      }

      would be needed.

      This error case is hard to hit, because the the startup check for sufficent redo logs in LogMinerStreamingChangeEventSource.java:execute usually suffices.

      Attachments

        Activity

          People

            ccranfor@redhat.com Chris Cranford
            christiankamm Christian Kamm (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: