Skip to content

Commit

Permalink
Make innodb.innodb-table-online more stable
Browse files Browse the repository at this point in the history
Occasionally, the test would fail with a result difference for
ddl_log_file_alter_table (0 instead of 1) due to some
nondeterminism in the test. Let us remove that nondeterminism.
  • Loading branch information
dr-m committed Nov 25, 2021
1 parent 3cfbfa5 commit 71e10ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mysql-test/suite/innodb/r/innodb-table-online.result
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ SET lock_wait_timeout = 10;
ALTER TABLE t1 ROW_FORMAT=COMPACT
PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR rebuilt2';
INSERT INTO t1 SELECT 80 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 160 + c1, c2, c3 FROM t1;
UPDATE t1 SET c2 = c2 + 1;
SET DEBUG_SYNC = 'now WAIT_FOR rebuilt2';
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
name count
ddl_background_drop_indexes 0
Expand Down
5 changes: 2 additions & 3 deletions mysql-test/suite/innodb/t/innodb-table-online.test
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,12 @@ ALTER TABLE t1 ROW_FORMAT=COMPACT
PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;

# Generate some log (delete-mark, delete-unmark, insert etc.)
# while the index creation is blocked. Some of this may run
# in parallel with the clustered index scan.
# while the index creation is blocked.
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR rebuilt2';
INSERT INTO t1 SELECT 80 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 160 + c1, c2, c3 FROM t1;
UPDATE t1 SET c2 = c2 + 1;
SET DEBUG_SYNC = 'now WAIT_FOR rebuilt2';
# At this point, the clustered index scan must have completed,
# but the modification log keeps accumulating due to the DEBUG_SYNC.
eval $innodb_metrics_select;
Expand Down

0 comments on commit 71e10ba

Please sign in to comment.