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

Data Loss when snapshot.locking.mode is none

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • 2.7.0.Beta1
    • None
    • mysql-connector
    • None
    • False
    • False
    • undefined

      Mysql Snapshot may be loss data when snapshot.locking.mode = none:

      1. FLUSH TABLES WITH READ LOCK acquires the global lock and essentially flushes then freezes the binlog(it will not be performed if snapshot.locking.mode = none)
      2. START TRANSACTION WITH CONSISTENT SNAPSHOT
      3. Read database names
      4. Read table names
      5. SHOW MASTER STATUS (insert a lot of data before that,data will be lost due to binlog position is move after START TRANSACTION when snapshot.locking.mode = none )
      6. Get the table DDL
      7. UNLOCK TABLES
      8. Copy the data
      9. COMMIT

      If the lock is none, it will not prevent the database write, so the data consistency between step 2 and Step 5 cannot be guaranteed.

      The root cause : repeatable read cannot guarantee the consistency of binglog position and data!

            Unassigned Unassigned
            zhaomoran 墨然 赵 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: