-- build used cat docs/INFO_SRC commit: 2aa8fb6eab92ce54f951b346ec63a9c682ef19dd date: 2021-09-06 10:02:34 +0200 build-date: 2021-09-07 05:27:07 +0000 short: 2aa8fb6eab9 branch: mysql-5.7.36-release MySQL source 5.7.36 -- Start up rm -rf master/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/master --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/master --core-file --socket=/tmp/mysql_master.sock --port=3306 --log-error=$PWD/master/log.err --log-bin=master-bin --server_id=1 2>&1 & rm -rf slave/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/slave --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/slave --core-file --socket=/tmp/mysql_slave.sock --port=3307 --log-error=$PWD/slave/log.err --log-bin=slave-bin --server_id=2 --skip_slave_start 2>&1 & -- Setup simple m/s replication - master bin/mysql -uroot -S /tmp/mysql_master.sock --prompt='Master>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.36-log MySQL Community Server (GPL) Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Master>CREATE USER 'repl'@'localhost' IDENTIFIED BY 'slavepass'; Query OK, 0 rows affected (0.00 sec) Master>GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost'; Query OK, 0 rows affected (0.01 sec) Master> Master>CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'slavepass'; Query OK, 0 rows affected (0.00 sec) Master>GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1'; Query OK, 0 rows affected (0.00 sec) Master>FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) Master>show master status; +-------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +-------------------+----------+--------------+------------------+-------------------+ | master-bin.000001 | 1220 | | | | +-------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec) Master>create database test; Query OK, 1 row affected (0.00 sec) Master>use test Database changed Master>CREATE TABLE `bug_report` ( -> `id` bigint(20) NOT NULL, -> `field1` varchar(255) COLLATE utf8_bin NOT NULL, -> `field2` varchar(255) COLLATE utf8_bin NOT NULL, -> `field3` varchar(255) COLLATE utf8_bin NOT NULL, -> `field4` varchar(255) COLLATE utf8_bin NOT NULL, -> `field5` datetime NOT NULL, -> PRIMARY KEY (`id`,`field1`,`field2`,`field3`,`field5`), -> UNIQUE KEY `UK_blacklisted_action_type` (`field1`,`field2`,`field3`,`field5`) -> ) ENGINE=InnoDB AUTO_INCREMENT=29645937 DEFAULT CHARSET=utf8 COLLATE=utf8_bin -> /*!50100 PARTITION BY RANGE (TO_DAYS(field5)) -> (PARTITION p20210701 VALUES LESS THAN (738368) ENGINE = InnoDB, -> PARTITION p20210801 VALUES LESS THAN (738399) ENGINE = InnoDB, -> PARTITION p20210901 VALUES LESS THAN (738429) ENGINE = InnoDB, -> PARTITION p20211001 VALUES LESS THAN (738460) ENGINE = InnoDB, -> PARTITION p20211101 VALUES LESS THAN (738490) ENGINE = InnoDB, -> PARTITION p20211201 VALUES LESS THAN (738521) ENGINE = InnoDB, -> PARTITION p20220101 VALUES LESS THAN (738552) ENGINE = InnoDB, -> PARTITION p20220201 VALUES LESS THAN (738580) ENGINE = InnoDB, -> PARTITION p20220301 VALUES LESS THAN (738611) ENGINE = InnoDB) */; Query OK, 0 rows affected (0.12 sec) Master> - slave bin/mysql -uroot -S /tmp/mysql_slave.sock --prompt='Slave>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.36-log MySQL Community Server (GPL) Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Slave>CHANGE MASTER TO -> MASTER_HOST='localhost', -> MASTER_PORT=3306, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_LOG_FILE='master-bin.000001', -> MASTER_LOG_POS=1220; Query OK, 0 rows affected, 2 warnings (0.02 sec) Slave>start slave; Query OK, 0 rows affected (0.00 sec) Slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: master-bin.000001 Read_Master_Log_Pos: 1220 Relay_Log_File: support-cluster03-relay-bin.000002 Relay_Log_Pos: 321 Relay_Master_Log_File: master-bin.000001 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 1220 Relay_Log_Space: 540 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: fbeb2d37-6d2f-11ec-a12c-000017016152 Master_Info_File: /export/home/tmp/ushastry/mysql-5.7.36/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 1 row in set (0.00 sec) Slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: master-bin.000001 Read_Master_Log_Pos: 2624 Relay_Log_File: support-cluster03-relay-bin.000002 Relay_Log_Pos: 1725 Relay_Master_Log_File: master-bin.000001 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 2624 Relay_Log_Space: 1944 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: fbeb2d37-6d2f-11ec-a12c-000017016152 Master_Info_File: /export/home/tmp/ushastry/mysql-5.7.36/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 1 row in set (0.00 sec) Slave>use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed Slave>drop table bug_report; Query OK, 0 rows affected (0.05 sec) Slave>CREATE TABLE `bug_report` ( -> `id` bigint(20) NOT NULL, -> `field1` varchar(255) COLLATE utf8_bin NOT NULL, -> `field2` varchar(255) COLLATE utf8_bin NOT NULL, -> `field3` varchar(255) COLLATE utf8_bin NOT NULL, -> `field4` varchar(255) COLLATE utf8_bin NOT NULL, -> `field5` datetime NOT NULL -> ) ENGINE=BLACKHOLE DEFAULT CHARSET=utf8 COLLATE=utf8_bin -> /*!50100 PARTITION BY RANGE (TO_DAYS(field5)) -> (PARTITION p20210701 VALUES LESS THAN (738368) ENGINE = BLACKHOLE, -> PARTITION p20210801 VALUES LESS THAN (738399) ENGINE = BLACKHOLE, -> PARTITION p20210901 VALUES LESS THAN (738429) ENGINE = BLACKHOLE, -> PARTITION p20211001 VALUES LESS THAN (738460) ENGINE = BLACKHOLE, -> PARTITION p20211101 VALUES LESS THAN (738490) ENGINE = BLACKHOLE, -> PARTITION p20211201 VALUES LESS THAN (738521) ENGINE = BLACKHOLE, -> PARTITION p20220101 VALUES LESS THAN (738552) ENGINE = BLACKHOLE, -> PARTITION p20220201 VALUES LESS THAN (738580) ENGINE = BLACKHOLE, -> PARTITION p20220301 VALUES LESS THAN (738611) ENGINE = BLACKHOLE) */; Query OK, 0 rows affected, 1 warning (0.00 sec) Slave>show warnings; +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 1287 | The partition engine, used by table 'test.bug_report', is deprecated and will be removed in a future release. Please use native partitioning instead. | +---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) Slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: master-bin.000001 Read_Master_Log_Pos: 82744013 Relay_Log_File: support-cluster03-relay-bin.000002 Relay_Log_Pos: 82743114 Relay_Master_Log_File: master-bin.000001 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 82744013 Relay_Log_Space: 82743333 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: fbeb2d37-6d2f-11ec-a12c-000017016152 Master_Info_File: /export/home/tmp/ushastry/mysql-5.7.36/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 1 row in set (0.00 sec) -- master ./mysql_random_data_load -h127.0.0.1 -P3306 -uroot test bug_report 1000000 --bulk-size=2 --max-threads=10 INFO[2022-01-04T09:04:53+01:00] Starting 3m1s [========================================>---------------------------] 61% # run in another session in the master Master>delete from test.bug_report where field5 < '2022-12-25 11:00:00'; Query OK, 568870 rows affected (16.87 sec) Master> -- slave Slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: master-bin.000001 Read_Master_Log_Pos: 291259494 Relay_Log_File: support-cluster03-relay-bin.000002 Relay_Log_Pos: 181115998 Relay_Master_Log_File: master-bin.000001 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1863 Last_Error: Could not execute Delete_rows event on table test.bug_report; Found a row in wrong partition 0. Correct is 1 id:69429019125869 field1:beatae harum et sed deleniti ipsa! field2:nobis rem recusandae rerum nihil. field3:rerum ut qui. field4:ullam similique quo ad enim velit quam dolorum. field5:2021-08-06 07:07:10, Error_code: 1863; handler error No Error!; the event's master log master-bin.000001, end_log_pos 241773374 Skip_Counter: 0 Exec_Master_Log_Pos: 181116897 Relay_Log_Space: 291258814 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1863 Last_SQL_Error: Could not execute Delete_rows event on table test.bug_report; Found a row in wrong partition 0. Correct is 1 id:69429019125869 field1:beatae harum et sed deleniti ipsa! field2:nobis rem recusandae rerum nihil. field3:rerum ut qui. field4:ullam similique quo ad enim velit quam dolorum. field5:2021-08-06 07:07:10, Error_code: 1863; handler error No Error!; the event's master log master-bin.000001, end_log_pos 241773374 Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: fbeb2d37-6d2f-11ec-a12c-000017016152 Master_Info_File: /export/home/tmp/ushastry/mysql-5.7.36/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: 220104 09:07:35 Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 1 row in set (0.00 sec) Slave>