@@ -20,13 +20,6 @@ CREATE TABLE t1 (
2020
2121INSERT INTO t1 VALUES (1,2,3),(2,3,5),(3,4,6),(4,5,8),(5,6,2),(6,7,2);
2222
23- CREATE TABLE t2 (
24- a INT,
25- b VARCHAR(10)
26- ) ENGINE NDB;
27-
28- INSERT INTO t2 VALUES (1,'Number 4'),(2,'Privet'),(3,'Drive');
29-
3023CREATE TABLE parent (
3124 c1 INT PRIMARY KEY
3225) ENGINE NDB;
@@ -47,13 +40,13 @@ INSERT INTO child VALUES (1,1),(2,2);
4740# Take a backup
4841--source include/ndb_backup.inc
4942
50- DROP TABLE t1,t2, child,parent;
43+ DROP TABLE t1,child,parent;
5144
5245# Store initial counts of both detected and synchronized objects
5346--let $initial_detected_count = query_get_value(SHOW STATUS LIKE 'Ndb_metadata_detected_count', Value, 1)
5447--let $initial_synced_count = query_get_value(SHOW STATUS LIKE 'Ndb_metadata_synced_count', Value, 1)
5548
56- # Restore metadata and data but do not rebuild indexes
49+ --echo Restore with --disable- indexes
5750--exec $NDB_RESTORE -b $the_backup_id -n 1 -m -r --disable-indexes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
5851--exec $NDB_RESTORE -b $the_backup_id -n 2 -r $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
5952
@@ -62,15 +55,14 @@ DROP TABLE t1,t2,child,parent;
6255SET @old_ndb_metadata_check = @@global.ndb_metadata_check;
6356SET @old_ndb_metadata_check_interval = @@global.ndb_metadata_check_interval;
6457SET GLOBAL ndb_metadata_check = true;
65- SET GLOBAL ndb_metadata_check_interval = 0 ;
58+ SET GLOBAL ndb_metadata_check_interval = 5 ;
6659--enable_query_log
6760
68- # Wait until the following 4 object changes are detected:
61+ # Wait until the following 3 object changes are detected:
6962# Table 'test.t1'
70- # Table 'test.t2'
7163# Table 'test.child'
7264# Table 'test.parent'
73- --let $expected_changes = 4
65+ --let $expected_changes = 3
7466--let $max_wait = 30
7567--source wait_metadata_changes_detected.inc
7668
@@ -80,29 +72,25 @@ SET GLOBAL ndb_metadata_check = @old_ndb_metadata_check;
8072SET GLOBAL ndb_metadata_check_interval = @old_ndb_metadata_check_interval;
8173--enable_query_log
8274
83- # Wait until table t2 is synced since it contains no indexes.
84- # The remaining tables aren't synced but treated as temporary errors
85- # instead
86- --let $expected_changes = 1
87- --let $max_wait = 30
88- --source wait_metadata_synced.inc
89-
75+ # Check that no tables have been synced. The tables aren't
76+ # synced due to the missing indexes and are treated as
77+ # temporary failures
78+ --let $synced_count = query_get_value(SHOW STATUS LIKE 'Ndb_metadata_synced_count', Value, 1)
79+ --let $assert_cond = "$synced_count" = "$initial_synced_count"
80+ --let $assert_text = Synced count has remained unchanged
81+ --source include/assert.inc
9082SHOW TABLES;
91- SHOW CREATE TABLE t2;
92- --sorted_result
93- SELECT * FROM t2;
9483
95- # Refresh counts
84+ # Refresh count
9685--let $initial_detected_count = query_get_value(SHOW STATUS LIKE 'Ndb_metadata_detected_count', Value, 1)
97- --let $initial_synced_count = query_get_value(SHOW STATUS LIKE 'Ndb_metadata_synced_count', Value, 1)
9886
99- # Rebuild indexes in NDB
87+ --echo Rebuild indexes in NDB
10088--exec $NDB_RESTORE -b $the_backup_id -n 1 --rebuild-indexes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
10189
10290--disable_query_log
10391# Set low interval so changes are detected quickly
10492SET GLOBAL ndb_metadata_check = true;
105- SET GLOBAL ndb_metadata_check_interval = 0 ;
93+ SET GLOBAL ndb_metadata_check_interval = 5 ;
10694--enable_query_log
10795
10896# Wait until the following 3 object changes are detected:
@@ -119,7 +107,7 @@ SET GLOBAL ndb_metadata_check = @old_ndb_metadata_check;
119107SET GLOBAL ndb_metadata_check_interval = @old_ndb_metadata_check_interval;
120108--enable_query_log
121109
122- # Wait until the objects are synced
110+ --echo Wait until the objects are synced
123111--let $max_wait = 30
124112--source wait_metadata_synced.inc
125113
@@ -135,7 +123,7 @@ SHOW CREATE TABLE child;
135123--sorted_result
136124SELECT * FROM child;
137125
138- DROP TABLE t1,t2, child,parent;
126+ DROP TABLE t1,child,parent;
139127
140128--source suite/ndb/include/backup_restore_cleanup.inc
141129--remove_file $NDB_TOOLS_OUTPUT
0 commit comments