Here is my create table from the replica (created from master dump, so DDL is the same):
CREATE TABLE `bits` (
`Id` bigint NOT NULL AUTO_INCREMENT,
`Datetime` datetime NOT NULL,
`B01` tinyint(1) NOT NULL,
`B02` tinyint(1) NOT NULL,
`B03` tinyint(1) NOT NULL,
`B04` tinyint(1) NOT NULL,
`B05` tinyint(1) NOT NULL,
`B06` tinyint(1) NOT NULL,
`B07` tinyint(1) NOT NULL,
`B08` tinyint(1) NOT NULL,
`B09` tinyint(1) NOT NULL,
`B10` tinyint(1) NOT NULL,
`B11` tinyint(1) NOT NULL,
`B12` tinyint(1) NOT NULL,
`B13` tinyint(1) NOT NULL,
`B14` tinyint(1) NOT NULL,
`B15` tinyint(1) NOT NULL,
`B16` tinyint(1) NOT NULL,
`B17` tinyint(1) NOT NULL,
`B18` tinyint(1) NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `Id` (`Id`),
KEY `idx_dt` (`Datetime`)
) ENGINE=InnoDB AUTO_INCREMENT=92553 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `words` (
`Id` bigint NOT NULL AUTO_INCREMENT,
`Datetime` datetime NOT NULL,
`W01` int NOT NULL,
`W02` int NOT NULL,
`W03` int NOT NULL,
`W04` int NOT NULL,
`W05` int NOT NULL,
`W06` int NOT NULL,
`W07` int NOT NULL,
`W08` int NOT NULL,
`W09` int NOT NULL,
`W10` int NOT NULL,
`W11` int NOT NULL,
`W12` int NOT NULL,
`W13` int NOT NULL,
`W14` int NOT NULL,
`W15` int NOT NULL,
`W16` int NOT NULL,
`W17` int NOT NULL,
`W18` int NOT NULL,
`W19` int NOT NULL,
`W20` int NOT NULL,
`W21` int NOT NULL,
`W22` int NOT NULL,
`W23` int NOT NULL,
`W24` int NOT NULL,
`W25` int NOT NULL,
`W26` int NOT NULL,
`W27` int NOT NULL,
`W28` int NOT NULL,
`W29` int NOT NULL,
`W30` int NOT NULL,
`W31` int NOT NULL,
`W32` int NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `Id` (`Id`),
KEY `idx_dt` (`Datetime`)
) ENGINE=InnoDB AUTO_INCREMENT=92553 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
There are single primary keys in the tables (bigint Id).
There are no INSERT
operation sources on the replica, except replication from master.
Here is the log tail from my replica:
2023-02-14T09:48:00.884440Z 161 [ERROR] [MY-010584] [Repl] Slave I/O for channel '': error reconnecting to master '[email protected]:3306' - retry-time: 60 retries: 1 message: Can't connect to MySQL server on '10.15.0.12:3306' (110), Error_code: MY-002003
2023-02-21T13:13:38.933590Z 161 [ERROR] [MY-010584] [Repl] Slave I/O for channel '': error reconnecting to master '[email protected]:3306' - retry-time: 60 retries: 1 message: Can't connect to MySQL server on '10.15.0.12:3306' (110), Error_code: MY-002003
2023-02-27T01:05:20.054098Z 7 [ERROR] [MY-010584] [Repl] Slave SQL for channel '': Worker 1 failed executing transaction 'ANONYMOUS' at master log NBMS-DELL-bin.000009, end_log_pos 8885352; Could not execute Write_rows event on table nbmslogger.bits; Duplicate entry '91393' for key 'bits.PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log FIRST, end_log_pos 8885352, Error_code: MY-001062
2023-02-27T11:58:07.334955Z 37 [ERROR] [MY-010584] [Repl] Slave SQL for channel '': Worker 1 failed executing transaction 'ANONYMOUS' at master log NBMS-DELL-bin.000009, end_log_pos 8885352; Could not execute Write_rows event on table nbmslogger.bits; Duplicate entry '91393' for key 'bits.PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log FIRST, end_log_pos 8885352, Error_code: MY-001062
When I open that table in DBeaver I see that there are more records replicated from the master, but replication will probably try to insert them again for some reason.