diff options
author | Monty <monty@mariadb.org> | 2020-06-18 11:57:19 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-06-19 12:03:13 +0300 |
commit | 60f08dd55563f23b80e118a863113116bf7443e2 (patch) | |
tree | 9e276f289af0ce6b979a3fe67981cf639be16b14 /sql/sql_insert.h | |
parent | 6a0c05b7610dfa8ac414911171a3ee11fe0068b8 (diff) | |
download | mariadb-git-60f08dd55563f23b80e118a863113116bf7443e2.tar.gz |
MDEV-22925 ALTER TABLE s3_table ENGINE=Aria can cause failure on slave
When converting a table (test.s3_table) from S3 to another engine, the
following will be logged to the binary log:
DROP TABLE IF EXISTS test.t1;
CREATE OR REPLACE TABLE test.t1 (...) ENGINE=new_engine
INSERT rows to test.t1 in binary-row-log-format
The bug is that the above statements are logged one by one to the binary
log. This means that a fast slave, configured to use the same S3 storage
as the master, would be able to execute the DROP and CREATE from the
binary log before the master has finished the ALTER TABLE.
In this case the slave would ignore the DROP (as it's on a S3 table) but
it will stop on CREATE of the local tale, as the table is still exists in
S3. The REPLACE part will be ignored by the slave as it can't touch the
S3 table.
The fix is to ensure that all the above statements is written to binary
log AFTER the table has been deleted from S3.
Diffstat (limited to 'sql/sql_insert.h')
-rw-r--r-- | sql/sql_insert.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_insert.h b/sql/sql_insert.h index 3f741640c1c..14041976973 100644 --- a/sql/sql_insert.h +++ b/sql/sql_insert.h @@ -43,7 +43,7 @@ int check_duplic_insert_without_overlaps(THD *thd, TABLE *table, int write_record(THD *thd, TABLE *table, COPY_INFO *info, select_result *returning= NULL); void kill_delayed_threads(void); -bool binlog_create_table(THD *thd, TABLE *table); +bool binlog_create_table(THD *thd, TABLE *table, bool replace); bool binlog_drop_table(THD *thd, TABLE *table); #ifdef EMBEDDED_LIBRARY |