Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
13.2
-
None
-
Can result in data loss
-
Q3/2026 Server Development
Description
To prevent copying torn files during backup, they need to be flushed. This is needed for non-ACID engine files (CSV, MyISAM etc.) and non-transactional Aria files. The method of calling tc_purge() and tdc_purge(true), which is what happens in the MDEV-14992 tree, is insufficient. This only closes tables that are not "in use": although the backup lock prevents them for being in use by any writers, they can also be held open in use for reading by a read-only query. And while being open for reading is completely compatible with flushing (but not closing the table or purging it from the cache), in this implementation it does not happen.
This can be solved by instead calling the flush_tables() function, which in addition to purging selectively flushes in-use tables.
An additional complication here is that the locking rules for non-user (system) tables differ from those for user tables: they can still be written to in BACKUP_PHASE_NO_DDL. This in particular affects stats tables, which are non-transactional Aria tables.
This can be solved by copying system tables in BACKUP_PHASE_NO_COMMIT, where they can no longer be written, and ensuring they are also flushed at the beginning of this phase.
Attachments
Issue Links
- relates to
-
MDEV-39988 Copy non-ACID engine files in BACKUP SERVER
-
- Stalled
-