Bug #87352 "ndb_restore --print-sql-log" includes unnecessary SQL

Submitted: 9 Aug 2017 8:17 Modified: 9 Aug 2017 9:28
Reporter: Yoshiaki Yamasaki Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: MySQL Cluster, ndb_restore

[9 Aug 2017 8:17] Yoshiaki Yamasaki
Description:
Output of "ndb_restore --print-sql-log" includes following unnecessary SQL.

 [unnecessary SQL]
  UPDATE sys.SYSTAB_0 SET NEXTID=4531 WHERE SYSKEY_0=10;
  UPDATE sys.SYSTAB_0 SET NEXTID=4532 WHERE SYSKEY_0=10;

Ex) $ ndb_restore -c localhost:1186 -n 2 -b 4 --print-sql-log ./data1/BACKUP/BACKUP-4
Nodeid = 2
Backup Id = 4
backup path = ./data1/BACKUP/BACKUP-4
2017-08-09 16:48:39 [restore_metadata] Read meta data file header
Opening file './data1/BACKUP/BACKUP-4/BACKUP-4.2.ctl'
File size 32236 bytes
Backup version in files: ndb-6.3.11 ndb version: mysql-5.7.19 ndb-7.5.7
2017-08-09 16:48:39 [restore_metadata] Load content
Stop GCP of Backup: 32012
2017-08-09 16:48:39 [restore_metadata] Get number of Tables
2017-08-09 16:48:39 [restore_metadata] Validate Footer
2017-08-09 16:48:39 [restore_metadata] Restore objects (tablespaces, ..)
2017-08-09 16:48:39 [restore_metadata] Restoring tables
2017-08-09 16:48:39 [restore_metadata] Save foreign key info
2017-08-09 16:48:39 [restore_data] Start restoring table data
2017-08-09 16:48:39 [restore_log] Read log file header
Opening file './data1/BACKUP/BACKUP-4/BACKUP-4.2.log'
File size 1696 bytes
2017-08-09 16:48:39 [restore_log] Restore log entries
UPDATE sys.SYSTAB_0 SET NEXTID=4531 WHERE SYSKEY_0=10;
UPDATE sys.SYSTAB_0 SET NEXTID=4532 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4531,'TEST','JPN','TEST',0);
UPDATE sys.SYSTAB_0 SET NEXTID=4533 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4532,'TEST','JPN','TEST',0);
UPDATE sys.SYSTAB_0 SET NEXTID=4534 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4533,'TEST','JPN','TEST',0);
UPDATE sys.SYSTAB_0 SET NEXTID=4535 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4534,'TEST','JPN','TEST',0);
UPDATE sys.SYSTAB_0 SET NEXTID=4536 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4535,'TEST','JPN','TEST',0);
UPDATE sys.SYSTAB_0 SET NEXTID=4537 WHERE SYSKEY_0=10;
UPDATE sys.SYSTAB_0 SET NEXTID=4538 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4537,'TEST','JPN','TEST',0);
UPDATE sys.SYSTAB_0 SET NEXTID=4539 WHERE SYSKEY_0=10;
UPDATE sys.SYSTAB_0 SET NEXTID=4540 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4539,'TEST','JPN','TEST',0);
UPDATE sys.SYSTAB_0 SET NEXTID=4541 WHERE SYSKEY_0=10;
UPDATE sys.SYSTAB_0 SET NEXTID=4542 WHERE SYSKEY_0=10;
INSERT INTO world.city VALUES(4541,'TEST','JPN','TEST',0);
Printed 0 tuples and 20 log entries to stdout.

NDBT_ProgramExit: 0 - OK

How to repeat:
1.Execute following sql with infinite loop.
insert into world.city(Name,CountryCode,District,Population) values('TEST','JPN','TEST',0);

2.Get online backup via "ndb_mgm -e "START BACKUP"

3.Execute ndb_restore with --print-sql-log option.
Ex) ndb_restore -c localhost:1186 -n 2 -b 4 --print-sql-log ./data1/BACKUP/BACKUP-4

Suggested fix:
Delete unnecessary SQL from output. It is convenient for restore log data to InnoDB.
[9 Aug 2017 8:33] Yoshiaki Yamasaki
I submitted another related bug#87353.
[9 Aug 2017 9:28] MySQL Verification Team
Hello Yoshiaki,

Thank you for the report.

Thanks,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.043 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.