Bug #11300 epoch on slave is incorrect if -e option is used during metadata restore.
Submitted: 13 Jun 2005 20:49 Modified: 17 Jun 2005 16:52
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.1.0-wl2325-wl1354-new OS:Linux (Linux)
Assigned to: Jonathan Miller CPU Architecture:Any

[13 Jun 2005 20:49] Jonathan Miller
Description:
Tomas,

Finally figured out what was going wrong.

If the use add the -e option to the metadata restore, the epoch is larger then it should be. The -e option can be added to all of the data restores, or just to the first data restore and it comes out correctly.

[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 2 -b 4 -m -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
Successfully restored table BANK/def/ACCOUNT_TYPE
Successfully restored table BANK/def/ACCOUNT_TYPES
Successfully restored table BANK/def/SYSTEM_VALUES
Successfully restored table BANK/def/TRANSACTION
Successfully restored table BANK/def/ACCOUNT
Successfully restored table BANK/def/GL
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 0
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 0
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 0
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 0
Restored 1867 tuples and 34 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 3 -e -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 2
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 2
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 2
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 2
Restored 1924 tuples and 0 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 4 -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 1
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 1
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 1
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 1
Restored 1904 tuples and 0 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 5 -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 3
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 3
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 3
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 3
Restored 1949 tuples and 42 log entries
[ndbdev@ndb10 BACKUP-4]$ cd ..
[ndbdev@ndb10 BACKUP]$ cd ..
[ndbdev@ndb10 run]$ ../bin/mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 5.1.0-a_drop5p2

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SELECT @latest:=MAX(epoch) FROM cluster_replication.apply_status;
+---------------------+
| @latest:=MAX(epoch) |
+---------------------+
|               10515 |
+---------------------+
1 row in set (0.04 sec)

mysql> drop DATABASE BANK;
Query OK, 0 rows affected (1.33 sec)

mysql> reset slave;
Query OK, 0 rows affected (0.00 sec)

mysql> create database BANK;
Query OK, 1 row affected (0.00 sec)

mysql> exit
Bye
[
[ndbdev@ndb10 run]$ cd BACKUP/
[ndbdev@ndb10 BACKUP]$ cd BACKUP-4/
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 2 -b 4 -m -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
Successfully restored table BANK/def/ACCOUNT_TYPE
Successfully restored table BANK/def/ACCOUNT_TYPES
Successfully restored table BANK/def/SYSTEM_VALUES
Successfully restored table BANK/def/TRANSACTION
Successfully restored table BANK/def/ACCOUNT
Successfully restored table BANK/def/GL
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 0
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 0
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 0
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 0
Restored 1867 tuples and 34 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 3 -e -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 2
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 2
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 2
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 2
Restored 1924 tuples and 0 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 4 -e -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 1
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 1
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 1
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 1
Restored 1904 tuples and 0 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 5 -e -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 3
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 3
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 3
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 3
Restored 1949 tuples and 42 log entries
[ndbdev@ndb10 BACKUP-4]$ cd ..
[ndbdev@ndb10 BACKUP]$ cd ..
[ndbdev@ndb10 run]$ ../bin/mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 5.1.0-a_drop5p2

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>  SELECT @latest:=MAX(epoch) FROM cluster_replication.apply_status;
+---------------------+
| @latest:=MAX(epoch) |
+---------------------+
|               10515 |
+---------------------+
1 row in set (0.04 sec)

mysql> drop DATABASE BANK;
Query OK, 4 rows affected (1.18 sec)

mysql> CREATE DATABASE BANK;
Query OK, 1 row affected (0.00 sec)

mysql> reset slave;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 2 -e -b 4 -m -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
Successfully restored table BANK/def/ACCOUNT_TYPE
Successfully restored table BANK/def/ACCOUNT_TYPES
Successfully restored table BANK/def/SYSTEM_VALUES
Successfully restored table BANK/def/TRANSACTION
Successfully restored table BANK/def/ACCOUNT
Successfully restored table BANK/def/GL
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 0
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 0
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 0
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 0
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 0
Restored 1867 tuples and 34 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 3 -e -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 2
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 2
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 2
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 2
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 2
Restored 1924 tuples and 0 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 4 -e -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 1
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 1
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 1
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 1
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 1
Restored 1904 tuples and 0 log entries
[ndbdev@ndb10 BACKUP-4]$  ../../../bin/ndb_restore -c ndb10:14000 -n 5 -e -b 4  -r ./
Ndb version in backup files: Version 5.1.0
Connected to ndb!!
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPE(8) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT_TYPES(7) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/SYSTEM_VALUES(6) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/TRANSACTION(5) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/ACCOUNT(4) fragment 3
_____________________________________________________
Restoring data in table: BANK/def/GL(3) fragment 3
_____________________________________________________
Restoring data in table: cluster_replication/def/apply_status(2) fragment 3
_____________________________________________________
Restoring data in table: sys/def/NDB$EVENTS_0(1) fragment 3
_____________________________________________________
Restoring data in table: sys/def/SYSTAB_0(0) fragment 3
Restored 1949 tuples and 42 log entries
[ndbdev@ndb10 BACKUP-4]$ cd ..
[ndbdev@ndb10 BACKUP]$ cd ..
[ndbdev@ndb10 run]$ ../bin/mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 5.1.0-a_drop5p2

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>  SELECT @latest:=MAX(epoch) FROM cluster_replication.apply_status;
+---------------------+
| @latest:=MAX(epoch) |
+---------------------+
|               10935 |
+---------------------+
1 row in set (0.04 sec)

mysql>

How to repeat:
See above
[13 Jun 2005 21:46] Jonathan Miller
Need to be able to reproduce. Taking it over until I can find a reproducable test case.
[17 Jun 2005 16:52] Jonathan Miller
I have not been able to reproduce this. If I find this issue again and a reproduciable test case, I will reopen the bug report.