1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
Thirunarayanan Balathandayuthapani 18c6ad5de9 MDEV-41548 InnoDB: Cannot replay rename … because the target file exists
Problem:
=======
recv_rename_files() replayed the renames in tablespace id order,
because renamed_spaces was a std::map keyed by space id that kept
only the latest file name per tablespace. A multi-table RENAME
such as RENAME TABLE t2 TO t3, t1 TO t2 frees a file name for a
tablespace that may have a lower id, and replaying in id order
then fails with "Cannot replay rename of tablespace … because the
target file exists".

Solution:
========
renamed_spaces: Change to a std::vector of (id, from, to),
retaining every FILE_RENAME record in log order. The records are
appended only while recv_sys.file_checkpoint is set, hence exactly
once and in ascending LSN.

recv_rename_files(): Replay the records in that order, applying
one only when the tablespace currently uses the file name that the
record renames from. The order in which the server executed the
renames is always replayable, because each rename required its
target to be unoccupied.
2026-10-23 00:18:36 +05:30
..
2026-08-19 08:13:54 +02:00
2026-08-19 08:13:54 +02:00
2026-07-23 11:12:27 +02:00
2024-11-29 12:37:46 +02:00
2024-06-24 13:09:47 +03:00