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

Raise warning when renaming table causes it to be captured or not captured any longer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 0.10.0.Beta2
    • 0.9.4.Final
    • mysql-connector
    • None

    Description

      We use Debezium for CDC on a Percona XTraDB cluster. Most of our schema migration are performed online with no downtime using the percona provided tool pt-online-schema-change.

      It seems that migration performed by this tool are not identified by Debezium.

      This tools work as following:

      1. create a "ghost" table with the same structure as the original one
      2. perform the schema migration on the ghost
      3. create insert, delete, update trigger from the original to the ghost table
      4. copy data from original to ghost
      5. rename original to _old, rename ghost to original
      6. drop _old
      7. drop triggers

      We had a case recently where a migration was applied and then one hour later an update was performed on the table which lead to the provided error (see attached stack). According to the error message it looks like debezium is not aware of the new schema (shift by one column in data type).

      The original table DDL is as follow:

      CREATE TABLE `my_db_name`.`my_table_name` (
        `my_table_name_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
        `tour_id` int(11) unsigned NOT NULL,
        `status` enum('new','pending','approved','rejected','deleted') NOT NULL DEFAULT 'new',
        `fields` varchar(600) NOT NULL,
        `comment` text NOT NULL,
        `reject_reasons` varchar(500) DEFAULT NULL,
        `reject_text` varchar(1000) DEFAULT NULL,
        `creation_timestamp` datetime NOT NULL,
        `requester_user_type` enum('staff','supplier') DEFAULT NULL,
        `update_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
        `update_user_type` enum('staff','supplier','reseller','customer','cron_job') DEFAULT NULL,
        `update_user_id` int(10) unsigned DEFAULT NULL,
        PRIMARY KEY (`my_table_name_id`),
        KEY `tour_id_status` (`tour_id`,`status`)
      ) ENGINE=InnoDB AUTO_INCREMENT=483132 DEFAULT CHARSET=utf8 COMMENT='5.6' ;
      

      Stack trace
      DDL sequence

      Attachments

        Activity

          People

            jpechane Jiri Pechanec
            ebrard Emmanuel Brard
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: