[MDEV-30557] Adding invisible SERIAL column primary key on slave break row base replication Created: 2023-02-03  Updated: 2023-02-26  Resolved: 2023-02-24

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.6.10
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: VAROQUI Stephane Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-24001 Implement hidden PK for RBR of no-uni... Open

 Description   

Hello

The table with composed primary key compose on 3 varchar(256) we alter it on a replica to add invisible serial and move the primary to unique and this break the replicas on row based event

Last_SQL_Error Column 0 of table 'varchar(765 octets)' to type 'bigint(20) unsigned 

I would suggest that if a column is invisible it should be ignored from the replica in mapping a row event array to column name of the table when the event have less column count than the destination columns

I think it may not be a bug but a documentation issue as what about auto_increment if it is affected on the replica than it's not on the leader and would produce data divergence



 Comments   
Comment by Sergei Golubchik [ 2023-02-24 ]

This behaves as expected. Documentation says that

Replication can also take place when the primary and replica have a different number of columns if the following criteria are met:

  • columns must be in the same order on the primary and replica
  • common columns must be defined with the same data type
  • extra columns must be defined after the common columns

And you have added a column first, not last.

Replication cannot ignore invisible columns, because in that case tables with invisible columns cannot be replicated at all.

Comment by VAROQUI Stephane [ 2023-02-26 ]

Thanks pointing out the documentation in the hope it will help others as well

Generated at Thu Feb 08 10:17:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.