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

Table order is incorrect on snapshots

XMLWordPrintable

    • False
    • None
    • False
    • Moderate

      Bug report

      When running a snapshot, the table include list order is not preserved when there is a partial match on the table names. Example from our usage:

      for the following table include list:

      tickly.conversation, tickly.conversation_member, tickly.message, tickly.conversation_read 

      The actual snapshot order will be, which is incorrect:

       

       

      tickly.conversation, tickly.conversation_member, tickly.conversation_read, tickly.message

      This is due to the wrong function used on the Pattern at this line

      Taken from the Pattern class, we should use "asMatchPredicate()" instead.

      public Predicate<String> asPredicate() {
          return (s) -> {
              return this.matcher(s).find(); // will perform a partial match
          };
      }
      
      public Predicate<String> asMatchPredicate() {
          return (s) -> {
              return this.matcher(s).matches(); // will perform a full match
          };
      }

       

      What Debezium connector do you use and what version?

      I fixed this on 1.7.0.Final, it impacts all connectors, but we've been running the fix for mysql. Unfortunately, due to time constraints I did not contribute the fix at the time. Even though I did not test it, from the code-base this should still be an issue in the latest version.

       

      I'll provide a PR to fix this.

              Unassigned Unassigned
              isacandrei Andrei Isac (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: