Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct initial debezium state for MySQL to skip snapshot #28238

Closed
akashkulk opened this issue Jul 12, 2023 · 1 comment
Closed

Construct initial debezium state for MySQL to skip snapshot #28238

akashkulk opened this issue Jul 12, 2023 · 1 comment
Assignees
Labels
team/db-dw-sources Backlog for Database and Data Warehouse Sources team

Comments

@akashkulk
Copy link
Contributor

No description provided.

@akashkulk akashkulk added the team/db-dw-sources Backlog for Database and Data Warehouse Sources team label Jul 12, 2023
@prateekmukhedkar
Copy link
Contributor

prateekmukhedkar commented Jul 19, 2023

MySQL Debezium state : note it has 2 parts mysql_db_history and mysql_cdc_offset. The file name in offset rotates.

{\"mysql_db_history\":\"{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672558,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559186,\\\"databaseName\\\":\\\"\\\",\\\"ddl\\\":\\\"SET character_set_server=utf8mb4, collation_server=utf8mb4_0900_ai_ci\\\",\\\"tableChanges\\\":[]}\\n{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559206,\\\"databaseName\\\":\\\"models_schema\\\",\\\"ddl\\\":\\\"DROP TABLE IF EXISTS `models_schema`.`models`\\\",\\\"tableChanges\\\":[]}\\n{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559207,\\\"databaseName\\\":\\\"models_schema\\\",\\\"ddl\\\":\\\"DROP TABLE IF EXISTS `models_schema`.`models_random`\\\",\\\"tableChanges\\\":[]}\\n{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559220,\\\"databaseName\\\":\\\"models_schema\\\",\\\"ddl\\\":\\\"DROP DATABASE IF EXISTS `models_schema`\\\",\\\"tableChanges\\\":[]}\\n{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559232,\\\"databaseName\\\":\\\"models_schema\\\",\\\"ddl\\\":\\\"CREATE DATABASE `models_schema` CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci\\\",\\\"tableChanges\\\":[]}\\n{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559234,\\\"databaseName\\\":\\\"models_schema\\\",\\\"ddl\\\":\\\"USE `models_schema`\\\",\\\"tableChanges\\\":[]}\\n{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559364,\\\"databaseName\\\":\\\"models_schema\\\",\\\"ddl\\\":\\\"CREATE TABLE `models` (\\\\n  `id` int NOT NULL,\\\\n  `make_id` int DEFAULT NULL,\\\\n  `model` varchar(200) DEFAULT NULL,\\\\n  PRIMARY KEY (`id`)\\\\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci\\\",\\\"tableChanges\\\":[{\\\"type\\\":\\\"CREATE\\\",\\\"id\\\":\\\"\\\\\\\"models_schema\\\\\\\".\\\\\\\"models\\\\\\\"\\\",\\\"table\\\":{\\\"defaultCharsetName\\\":\\\"utf8mb4\\\",\\\"primaryKeyColumnNames\\\":[\\\"id\\\"],\\\"columns\\\":[{\\\"name\\\":\\\"id\\\",\\\"jdbcType\\\":4,\\\"typeName\\\":\\\"INT\\\",\\\"typeExpression\\\":\\\"INT\\\",\\\"charsetName\\\":null,\\\"position\\\":1,\\\"optional\\\":false,\\\"autoIncremented\\\":false,\\\"generated\\\":false,\\\"comment\\\":null,\\\"hasDefaultValue\\\":false,\\\"enumValues\\\":[]},{\\\"name\\\":\\\"make_id\\\",\\\"jdbcType\\\":4,\\\"typeName\\\":\\\"INT\\\",\\\"typeExpression\\\":\\\"INT\\\",\\\"charsetName\\\":null,\\\"position\\\":2,\\\"optional\\\":true,\\\"autoIncremented\\\":false,\\\"generated\\\":false,\\\"comment\\\":null,\\\"hasDefaultValue\\\":true,\\\"enumValues\\\":[]},{\\\"name\\\":\\\"model\\\",\\\"jdbcType\\\":12,\\\"typeName\\\":\\\"VARCHAR\\\",\\\"typeExpression\\\":\\\"VARCHAR\\\",\\\"charsetName\\\":\\\"utf8mb4\\\",\\\"length\\\":200,\\\"position\\\":3,\\\"optional\\\":true,\\\"autoIncremented\\\":false,\\\"generated\\\":false,\\\"comment\\\":null,\\\"hasDefaultValue\\\":true,\\\"enumValues\\\":[]}],\\\"attributes\\\":[]},\\\"comment\\\":null}]}\\n{\\\"source\\\":{\\\"server\\\":\\\"models_schema\\\"},\\\"position\\\":{\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149,\\\"snapshot\\\":true},\\\"ts_ms\\\":1689672559373,\\\"databaseName\\\":\\\"models_schema\\\",\\\"ddl\\\":\\\"CREATE TABLE `models_random` (\\\\n  `id_random` int NOT NULL,\\\\n  `make_id_random` int DEFAULT NULL,\\\\n  `model_random` varchar(200) DEFAULT NULL,\\\\n  PRIMARY KEY (`id_random`)\\\\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci\\\",\\\"tableChanges\\\":[{\\\"type\\\":\\\"CREATE\\\",\\\"id\\\":\\\"\\\\\\\"models_schema\\\\\\\".\\\\\\\"models_random\\\\\\\"\\\",\\\"table\\\":{\\\"defaultCharsetName\\\":\\\"utf8mb4\\\",\\\"primaryKeyColumnNames\\\":[\\\"id_random\\\"],\\\"columns\\\":[{\\\"name\\\":\\\"id_random\\\",\\\"jdbcType\\\":4,\\\"typeName\\\":\\\"INT\\\",\\\"typeExpression\\\":\\\"INT\\\",\\\"charsetName\\\":null,\\\"position\\\":1,\\\"optional\\\":false,\\\"autoIncremented\\\":false,\\\"generated\\\":false,\\\"comment\\\":null,\\\"hasDefaultValue\\\":false,\\\"enumValues\\\":[]},{\\\"name\\\":\\\"make_id_random\\\",\\\"jdbcType\\\":4,\\\"typeName\\\":\\\"INT\\\",\\\"typeExpression\\\":\\\"INT\\\",\\\"charsetName\\\":null,\\\"position\\\":2,\\\"optional\\\":true,\\\"autoIncremented\\\":false,\\\"generated\\\":false,\\\"comment\\\":null,\\\"hasDefaultValue\\\":true,\\\"enumValues\\\":[]},{\\\"name\\\":\\\"model_random\\\",\\\"jdbcType\\\":12,\\\"typeName\\\":\\\"VARCHAR\\\",\\\"typeExpression\\\":\\\"VARCHAR\\\",\\\"charsetName\\\":\\\"utf8mb4\\\",\\\"length\\\":200,\\\"position\\\":3,\\\"optional\\\":true,\\\"autoIncremented\\\":false,\\\"generated\\\":false,\\\"comment\\\":null,\\\"hasDefaultValue\\\":true,\\\"enumValues\\\":[]}],\\\"attributes\\\":[]},\\\"comment\\\":null}]}\\n\",
    \"mysql_cdc_offset\":{\"[\\\"models_schema\\\",{\\\"server\\\":\\\"models_schema\\\"}]\":\"{\\\"transaction_id\\\":null,\\\"ts_sec\\\":1689672559,\\\"file\\\":\\\"binlog.000002\\\",\\\"pos\\\":11149}\"}}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team/db-dw-sources Backlog for Database and Data Warehouse Sources team
Projects
None yet
Development

No branches or pull requests

3 participants