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

Race condition in premature snapshot termination cleanup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 0.9.5.Final
    • mysql-connector
    • None

      When a snapshot is in progress and is terminated prematurely then the snapshot reader can end-up in exception.
      The problem is that io.debezium.connector.mysql.MySqlConnectorTask.completeReaders() closes JDBC connection on shutdown. The connection can still be in use in Snapshot reader

                          if (interrupted.get() || !isRunning()) {
                              // We were interrupted or were stopped while reading the tables,
                              // so roll back the transaction and return immediately ...
                              logger.info("Step {}: rolling back transaction after abort", step++);
                              mysql.connection().rollback();
                              metrics.snapshotAborted();
                              rolledBack = true;
                          }
      

      and at time when rollback is going to be executed the new connection is created instead that ends up in exception.

        1. image.png
          171 kB
          Jiri Pechanec

            Unassigned Unassigned
            jpechane Jiri Pechanec
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: