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

First online log query does not limit results to those that are available.

    XMLWordPrintable

Details

    Description

      The connector performs a sanity check at the start of the streaming phase where it fetches the minimum SCN available in both the V$LOG and V$ARCHIVED_LOG tables. The portion of the query that relates to V$ARCHIVED_LOG should be predicated to return the minimum value where STATUS='A' as deleted, unavailable, or expired logs will yield a missing logfile exception and require a re-snapshot.

      The query in SqlUtils should read

      static String oldestFirstChangeQuery(Duration archiveLogRetention) {
              if (!archiveLogRetention.isNegative() && !archiveLogRetention.isZero()) {
                  return String.format("SELECT MIN(FIRST_CHANGE#) FROM (SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s " +
                          "UNION SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s " +
                          "WHERE FIRST_TIME >= SYSDATE - (%d/24) AND STATUS='A')", LOG_VIEW, ARCHIVED_LOG_VIEW, archiveLogRetention.toHours());
              }
              return String.format("SELECT MIN(FIRST_CHANGE#) FROM (SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s " +
                      "UNION SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s WHERE STATUS='A')", LOG_VIEW, ARCHIVED_LOG_VIEW);
          }
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: