| 1 |
Check some behaviours around restoring autoinc |
| 2 |
tables where autoinc values are used in the log |
| 3 |
use test; |
| 4 |
create table signed (a int auto_increment primary key, b int) engine=ndb; |
| 5 |
create table test.t1 (a int auto_increment primary key, b int) engine=ndb; |
| 6 |
create table test.t2 (a int auto_increment primary key, b int) engine=ndb; |
| 7 |
insert into signed (b) values (1), (2), (3); |
| 8 |
insert into signed (a,b) values (-20, -20); |
| 9 |
insert into test.t1 (b) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); |
| 10 |
insert into test.t2 (b) values (1), (2); |
| 11 |
Cause backup stall |
| 12 |
Starting backup |
| 13 |
Backup started |
| 14 |
insert into signed (b) values (4), (5), (6), (7); |
| 15 |
insert into signed (a,b) values (-30, -30); |
| 16 |
insert into test.t1 (b) values (11), (12), (13), (14), (15), (16), (17), (18), (19), (20); |
| 17 |
insert into test.t2 (b) values (3), (4); |
| 18 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='signed'; |
| 19 |
AUTO_INCREMENT |
| 20 |
8 |
| 21 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='t1'; |
| 22 |
AUTO_INCREMENT |
| 23 |
21 |
| 24 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='t2'; |
| 25 |
AUTO_INCREMENT |
| 26 |
5 |
| 27 |
Waiting for backup to complete |
| 28 |
Backup completed |
| 29 |
drop table signed; |
| 30 |
drop table test.t1; |
| 31 |
drop table test.t2; |
| 32 |
create table signed (a int auto_increment primary key, b int) engine=ndb; |
| 33 |
Recreate tables in opposite order so they swap table ids |
| 34 |
create table test.t2 (a int auto_increment primary key, b int) engine=ndb; |
| 35 |
create table test.t1 (a int auto_increment primary key, b int) engine=ndb; |
| 36 |
Restore data in order 1,2 |
| 37 |
Node 1 |
| 38 |
Node 2 |
| 39 |
Check restored auto-inc metadata : |
| 40 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='signed'; |
| 41 |
AUTO_INCREMENT |
| 42 |
8 |
| 43 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='t1'; |
| 44 |
AUTO_INCREMENT |
| 45 |
21 |
| 46 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='t2'; |
| 47 |
AUTO_INCREMENT |
| 48 |
5 |
| 49 |
drop table signed; |
| 50 |
drop table test.t1; |
| 51 |
drop table test.t2; |
| 52 |
create table signed (a int auto_increment primary key, b int) engine=ndb; |
| 53 |
Recreate tables in opposite order so they swap table ids |
| 54 |
create table test.t2 (a int auto_increment primary key, b int) engine=ndb; |
| 55 |
create table test.t1 (a int auto_increment primary key, b int) engine=ndb; |
| 56 |
Restore data in order 2,1 |
| 57 |
Node 2 |
| 58 |
Node 1 |
| 59 |
Check restored auto-inc metadata : |
| 60 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='signed'; |
| 61 |
AUTO_INCREMENT |
| 62 |
8 |
| 63 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='t1'; |
| 64 |
AUTO_INCREMENT |
| 65 |
21 |
| 66 |
select auto_increment from information_schema.tables where table_schema='test' and table_name='t2'; |
| 67 |
AUTO_INCREMENT |
| 68 |
5 |
| 69 |
drop table signed; |
| 70 |
drop table test.t1; |
| 71 |
drop table test.t2; |