Issues
- mysqldump --single-transaction --lock-for-backup missing mutex to avoid concurrency with DDLsPS-5631Resolved issue: PS-5631Yura Sorokin
- Lock Tables for Backup not working as expected (Index is being created after it)PS-5630Resolved issue: PS-5630
- tokudb.rpl.rpl_not_null_tokudb tests InnoDB, not TokuDBPS-4353Resolved issue: PS-4353George Lorch
- tokudb.type_temporal_fractional unstablePS-4352Resolved issue: PS-4352
- TokuDB behavior w.r.t auto_increment_increment and auto_increment_offset is incorrectPS-4337Resolved issue: PS-4337
- projectroot.src.tests.ydb/queries_with_deletes.tdb is unstablePS-4331Resolved issue: PS-4331
- rpl_row_mixing_engines w/ TokuDB failsPS-4324Resolved issue: PS-4324
- projectroot.src.tests.ydb/recover_child_rollback.abortrecover is unstablePS-4321Resolved issue: PS-4321
- Can not rename table in database with non alphanum characters in its name.PS-4319Resolved issue: PS-4319George Lorch
- tokudb.rpl.rpl_row_basic_3tokudb tests InnoDB, not TokuDBPS-4316Resolved issue: PS-4316George Lorch
- projectroot.ft.tests.ft/cachetable_evictor_class is unstablePS-4303Resolved issue: PS-4303
- projectroot.src.tests.ydb/recover_flt1.abortrecover is unstablePS-4301Resolved issue: PS-4301
- projectroot.portability.tests.portability/test_gettimeofday is unstablePS-4300Resolved issue: PS-4300
- PerconaFT fails to build on debian wheezy 64 bit debugPS-4290Resolved issue: PS-4290Vladislav Lesin
- projectroot.src.tests.ydb/test_query.tdb is unstablePS-4289Resolved issue: PS-4289
- PerconaFT encodes already encoded database name for directory namePS-4287Resolved issue: PS-4287George Lorch
- projectroot.portability.tests.portability/test_filesystem_sizes is unstablePS-4285Resolved issue: PS-4285
- tokudb.bugs.5733_tokudb is unstablePS-4274Resolved issue: PS-4274
- tokudb.bugs.5733_tokudb is unstablePS-4273Resolved issue: PS-4273
- PerconaFT asserts for various reasons deserializing nodes with no useful error output.PS-4268Resolved issue: PS-4268George Lorch
- rocksdb.write_sync unstablePS-4128Resolved issue: PS-4128
- MyRocks does not support ALTER TABLE ... EXCHANGE PARTITIONPS-4125Resolved issue: PS-4125
- rocksdb_sys_vars.rocksdb_update_cf_options_basic is unstablePS-4121Resolved issue: PS-4121George Lorch
- rocksdb.persistent_cache failingPS-4120Resolved issue: PS-4120
- rocksdb.select failingPS-4096Resolved issue: PS-4096George Lorch
- MyRocks does not support UNIQUE INDEX on tables with no PRIMARY KEYPS-4092Resolved issue: PS-4092George Lorch
- rocksdb.drop_table2 unstablePS-4078Resolved issue: PS-4078
- ALTER TABLE ... REBUILD PARTITION ... leaks memoryPS-4064Resolved issue: PS-4064
- rocksdb.sys_vars.rocksdb_rate_limiter_bytes_per_sec_basic is unstablePS-4060Resolved issue: PS-4060
- rocksdb.select fails consistentlyPS-4059Resolved issue: PS-4059
- rocksdb.rocksdb_icp unstablePS-4058Resolved issue: PS-4058
- rocksdb.sys_vars.rocksdb_flush_memtable_on_analyze_basic unstablePS-4011Resolved issue: PS-4011George Lorch
- rocksdb.validate_datadic is unstablePS-3980Resolved issue: PS-3980George Lorch
- can not view the thread holding the MDL lockPS-254Resolved issue: PS-254
- Typo in mysqld_safe.sh - trottling should be throttlingPS-240Resolved issue: PS-240Laurynas Biveinis
mysqldump --single-transaction --lock-for-backup missing mutex to avoid concurrency with DDLs
Description
Environment
AFFECTED CS IDs
Attachments
Smart Checklist
Details
Assignee
Yura SorokinYura SorokinReporter
Vinicius GrippaVinicius GrippaLabels
Time tracking
1w 30m loggedAffects versions
Priority
Medium
Details
Details
Assignee
Reporter
Labels
Time tracking
Affects versions
Priority
Smart Checklist
Smart Checklist
Smart Checklist
Activity
Julia VuralMarch 4, 2025 at 9:03 PM
It appears that this issue is no longer being worked on, so we are closing it for housekeeping purposes. If you believe the issue still exists, please open a new ticket after confirming it's present in the latest release.
Yura SorokinJuly 5, 2019 at 4:21 PM
Another fix could be in changing the behavior of the SELECT from a table created after START TRANSACTION WITH CONSISTENT SNAPSHOT was executed (second scenario).
Instead of returning ER_TABLE_DEF_CHANGED, we can return an empty row set, although I am not sure whether this is in accordance with the SQL standard.
Yura SorokinJuly 5, 2019 at 11:53 AMEdited
For the first case with adding index while mysqldump is running (or in general case with any modification of the existing table structure via ALTER TABLE) there is not much we can do here.
START TRANSACTION WITH CONSISTENT SNAPSHOT was not designed to work with concurrent DDLs properly. The most InnoDB can do is to detect such cases and report ER_TABLE_DEF_CHANGED.
However, for the second case with new tables being added while mysqldump is executed there is one improvement we can implement.
It will not 100% eliminate ER_TABLE_DEF_CHANGED but may significantly decrease its probability.
Currently, inside 'dump_all_tables_in_db()' there is a loop through all the tables in the database
'getTableName()' is basically a call to 'mysql_fetch_row()' which fetches the next row from 'SHOW TABLES' whereas 'dump_table()' is a potentially long-running operation which reads all the data in a table and forms 'INSERT INTO' statements.
In other words, while long lasting 'dump_table()' is executed the chances that a new table is created by a concurrent connection are much higher. The worst part is that this new table may appear in the one of the subsequent calls to 'getTableName()'.
An improvement here can be in pre-fetching the whole list of tables before starting to execute 'dump_table()' for each of them.
Yura SorokinJuly 5, 2019 at 11:08 AM
From the mysqldump.c source code
Yura SorokinJuly 5, 2019 at 11:04 AM
Here is an MTR test case which simulates the scenario with CREATE TABLE t2 executed after mysqldump's START TRANSACTION WITH CONSISTENT SNAPSHOT.
With --lock-for-backup option, a mutex should be placed similar to the one LOCK TABLES FOR BACKUP to avoid the error below. It seems that the current implementation does not allow dumps to be correctly extracted when DDLs are running.
Test case:
One session run:
On the other:
Error: