Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4(EOL)
-
None
Description
This is a re-filing of MDEV-22351.
The original fix of MDEV-22351 was not working and has been reverted.
The problem is demonstrated by a test case here:
https://github.com/MariaDB/server/commits/knielsen_mdev22351
With every transaction commit, InnoDB stores the corresponding binlog position in one of 128 slots in rseg headers. During recovery (or mariabackup --prepare), the most recent entry must be chosen as the one to recover.
This is currently done by comparing (filename,offset) with lexicographical ordering. This usually works, because binlog files are named BASE.000001, BASE.000002, ...
But if the server is restarted with a new basename that compares lower than the old, or if RESET MASTER is run, then an old entry can compare higher on the filename than a newer entry. This can lead to the old entry errorneously being recovered as the current binlog position.
The above git branch contains a proof-of-concept fix that adds an incrementing version number to entries, but it requires extending the format of the entries in the rseg headers. This was deemed undesirable.
An alternative fix is as suggested by Marko in MDEV-22351. If the server would inform storage engines when the filename of the binlog changes (from RESET MASTER, or a config change and server restart), then InnoDB can clear all the old entries and write a new entry with the correct current position. Such clear+write should probably be done as a single mini-transaction to make it crash-safe.
Attachments
Issue Links
- relates to
-
MDEV-22351 InnoDB may report incorrect binlog position information after RESET MASTER
- Closed