[MDEV-6665] Wrong ID's generated with Galera using insert containing multiple rows. Created: 2014-08-30 Updated: 2014-11-19 Resolved: 2014-11-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera |
| Affects Version/s: | 5.5.39-galera |
| Fix Version/s: | 5.5.41-galera |
| Type: | Bug | Priority: | Minor |
| Reporter: | Eric Webster | Assignee: | Nirbhay Choubey (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | galera | ||
| Environment: |
Debian 7, fully patched, MariaDB 5.5.39 Galera build (from your repo) |
||
| Description |
|
If you do an insert with multiple values, auto increment ID generation is not replicated properly. It seems to go by the local galera auto_id offset values instead of those given by the master. Master not running Galera but 5.5.39:
Galera slave:
|
| Comments |
| Comment by Elena Stepanova [ 2014-08-30 ] | |||||||||||||||||||||||||||
|
Back in days, Galera was meant to be run only with row binlog_format, in which case replication of auto-increment wouldn't matter. Maybe it's not so anymore, assigning to nirbhay_c to give a proper reply. | |||||||||||||||||||||||||||
| Comment by Eric Webster [ 2014-08-30 ] | |||||||||||||||||||||||||||
|
I forgot to mention that this is using row based replication. A normal insert works correctly of course, it's only when you do multiple at once in the ("values"),("values") format. | |||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2014-11-19 ] | |||||||||||||||||||||||||||
|
Its is an expected behavior added to avoid "collisions" in a cluster. | |||||||||||||||||||||||||||
| Comment by Eric Webster [ 2014-11-19 ] | |||||||||||||||||||||||||||
|
That article discusses controlling the auto increment values when writes are being sent into the cluster directly. It at least doesn't suggest that they will be controlled when a slave is replicating data in directly. I'd really expect the binlog row data to win and it to accept the data as-is and not manipulate it at all since the source is from replication. | |||||||||||||||||||||||||||
| Comment by Nirbhay Choubey (Inactive) [ 2014-11-19 ] | |||||||||||||||||||||||||||
|
In order to achieve that you can either (a) set master's binlog_format to ROW or (b) start Here is what I tried: Topology: Case 1:
On master:
On node1/slave & node2:
Case 2: master configuration:
slave/node1 & node2 configuration:
On master:
On node1 (slave) & node2:
What you described is case#2 where master's binlog_format is statement. In this what happens is | |||||||||||||||||||||||||||
| Comment by Eric Webster [ 2014-11-19 ] | |||||||||||||||||||||||||||
|
That makes sense to me. I swear it was using RBR, as I noted above in an earlier comment, but the test system I was using is no longer around due to how long ago it was. I tried to duplicate it again, on a system using RBR and could not, so I can only guess that the previous master was using statement based replication. Without anyway to confirm it, it's the only possible explanation. |