@@ -20,13 +20,6 @@ CREATE TABLE t1 (
20
20
21
21
INSERT INTO t1 VALUES (1,2,3),(2,3,5),(3,4,6),(4,5,8),(5,6,2),(6,7,2);
22
22
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
-
30
23
CREATE TABLE parent (
31
24
c1 INT PRIMARY KEY
32
25
) ENGINE NDB;
@@ -47,13 +40,13 @@ INSERT INTO child VALUES (1,1),(2,2);
47
40
# Take a backup
48
41
--source include/ndb_backup.inc
49
42
50
- DROP TABLE t1,t2, child,parent;
43
+ DROP TABLE t1,child,parent;
51
44
52
45
# Store initial counts of both detected and synchronized objects
53
46
--let $initial_detected_count = query_get_value(SHOW STATUS LIKE 'Ndb_metadata_detected_count', Value, 1)
54
47
--let $initial_synced_count = query_get_value(SHOW STATUS LIKE 'Ndb_metadata_synced_count', Value, 1)
55
48
56
- # Restore metadata and data but do not rebuild indexes
49
+ --echo Restore with --disable- indexes
57
50
--exec $NDB_RESTORE -b $the_backup_id -n 1 -m -r --disable-indexes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
58
51
--exec $NDB_RESTORE -b $the_backup_id -n 2 -r $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
59
52
@@ -62,15 +55,14 @@ DROP TABLE t1,t2,child,parent;
62
55
SET @old_ndb_metadata_check = @@global.ndb_metadata_check;
63
56
SET @old_ndb_metadata_check_interval = @@global.ndb_metadata_check_interval;
64
57
SET GLOBAL ndb_metadata_check = true;
65
- SET GLOBAL ndb_metadata_check_interval = 0 ;
58
+ SET GLOBAL ndb_metadata_check_interval = 5 ;
66
59
--enable_query_log
67
60
68
- # Wait until the following 4 object changes are detected:
61
+ # Wait until the following 3 object changes are detected:
69
62
# Table 'test.t1'
70
- # Table 'test.t2'
71
63
# Table 'test.child'
72
64
# Table 'test.parent'
73
- --let $expected_changes = 4
65
+ --let $expected_changes = 3
74
66
--let $max_wait = 30
75
67
--source wait_metadata_changes_detected.inc
76
68
@@ -80,29 +72,25 @@ SET GLOBAL ndb_metadata_check = @old_ndb_metadata_check;
80
72
SET GLOBAL ndb_metadata_check_interval = @old_ndb_metadata_check_interval;
81
73
--enable_query_log
82
74
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
90
82
SHOW TABLES;
91
- SHOW CREATE TABLE t2;
92
- --sorted_result
93
- SELECT * FROM t2;
94
83
95
- # Refresh counts
84
+ # Refresh count
96
85
--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)
98
86
99
- # Rebuild indexes in NDB
87
+ --echo Rebuild indexes in NDB
100
88
--exec $NDB_RESTORE -b $the_backup_id -n 1 --rebuild-indexes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
101
89
102
90
--disable_query_log
103
91
# Set low interval so changes are detected quickly
104
92
SET GLOBAL ndb_metadata_check = true;
105
- SET GLOBAL ndb_metadata_check_interval = 0 ;
93
+ SET GLOBAL ndb_metadata_check_interval = 5 ;
106
94
--enable_query_log
107
95
108
96
# Wait until the following 3 object changes are detected:
@@ -119,7 +107,7 @@ SET GLOBAL ndb_metadata_check = @old_ndb_metadata_check;
119
107
SET GLOBAL ndb_metadata_check_interval = @old_ndb_metadata_check_interval;
120
108
--enable_query_log
121
109
122
- # Wait until the objects are synced
110
+ --echo Wait until the objects are synced
123
111
--let $max_wait = 30
124
112
--source wait_metadata_synced.inc
125
113
@@ -135,7 +123,7 @@ SHOW CREATE TABLE child;
135
123
--sorted_result
136
124
SELECT * FROM child;
137
125
138
- DROP TABLE t1,t2, child,parent;
126
+ DROP TABLE t1,child,parent;
139
127
140
128
--source suite/ndb/include/backup_restore_cleanup.inc
141
129
--remove_file $NDB_TOOLS_OUTPUT
0 commit comments