Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Not a Bug
-
Affects Version/s: 5.5.39-galera
-
Fix Version/s: 5.5.41-galera
-
Component/s: Galera
-
Labels:
-
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:
MariaDB [accounts]> create table test ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `text` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB; Query OK, 0 rows affected (0.00 sec) MariaDB [accounts]> show create table test\G *************************** 1. row *************************** Table: test Create Table: CREATE TABLE `test` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `text` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) MariaDB [accounts]> insert into test (text) VALUES ("one"),("two"); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 MariaDB [accounts]> show table status like 'test'\G *************************** 1. row *************************** Name: test Engine: InnoDB Version: 10 Row_format: Compact Rows: 2 Avg_row_length: 8192 Data_length: 16384 Max_data_length: 0 Index_length: 0 Data_free: 0 Auto_increment: 3 <------ Create_time: 2014-08-30 00:55:42 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: 1 row in set (0.00 sec) MariaDB [accounts]> select * from test; +----+------+ | id | text | +----+------+ | 1 | one | | 2 | two | +----+------+ 2 rows in set (0.00 sec)
Galera slave:
MariaDB [accounts]> show table status like 'test'\G
*************************** 1. row ***************************
Name: test
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 2
Avg_row_length: 8192
Data_length: 16384
Max_data_length: 0
Index_length: 0
Data_free: 0
Auto_increment: 9 <-----
Create_time: 2014-08-30 00:55:11
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)
MariaDB [accounts]> select * from test;
+----+------+
| id | text |
+----+------+
| 3 | one |
| 6 | two |
+----+------+
2 rows in set (0.01 sec)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
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 Choubey to give a proper reply.