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

Oracle redo log switch not detected when using multiple archiver process threads

    XMLWordPrintable

Details

    Description

      hasLogSwitchOccurred() does not detect all sequence change if we have more than one pulling thread. This is causing some missing SCN dml being returned from the logming, query, and caused data lost.

      the getCurrentRedoLogSequences() only return the first sequence# from the query.

       private List<BigInteger> getCurrentRedoLogSequences() throws SQLException {
       return jdbcConnection.queryAndMap(SqlUtils.currentRedoLogSequenceQuery(), rs -> {
       List<BigInteger> sequences = new ArrayList<>();
       if (rs.next()) {   <---- ONLY one being returned.
       sequences.add(new BigInteger(rs.getString(1))); 
       }
       return sequences;
       });
      }

        For our case, we have 2 threads and 2 sequences number. please see the screen shot attached.

      After we changed the code (if -> while), we get the correct list of sequence, and you can see the log is showing 

      Current log sequence(s) is now [23662, 22350], was [22349, 23659]

      and our missing data issue is fixed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shiawu John Wu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: