Details
-
New Feature
-
Status: In Review (View Workflow)
-
Critical
-
Resolution: Unresolved
-
Q4/2025 Server Maintenance
Description
--binlog_row_metadata=full stores columns names and other metadata into the binary log.
However this is not used by replication threads, which can cause data loss on multi-master if one adds or drop fields with ALTER TABLE when binlog_format=row or binlog_format=statement is used.
ALTER TABLE will work if columns are added last to the table. However if one deletes columns or add a column in the middle of the table will cause all future DML to update wrong fields.
The fix is that if --binlog_row_metadata=full is used, we should not use field positions but instead use field names for insert and update when applying row events.
mariadb-binlog should also be update to show fieldnames instead of field positions if field names are available.
I will add a simple test case that one can use to verify the issue.
We should probably also add an option --slave_type_conversions=IGNORE_MISSING_COLUMNS to allow one to drop columns with ALTER TABLE
Attachments
Issue Links
- relates to
-
MDEV-20477 Merge binlog extended metadata support from the upstream
-
- Closed
-
-
MDEV-36892 Data Loss Replicating Persistent Fields if Slave Has Different Function
-
- Stalled
-