Bug #113002 innodb.ddl_kill test fails sporadically.
Submitted: 8 Nov 2023 8:32 Modified: 8 Nov 2023 10:34
Reporter: Dmitry Lenev (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.35 OS:Linux
Assigned to: CPU Architecture:Any
Tags: Contribution

[8 Nov 2023 8:32] Dmitry Lenev
innodb.ddl_kill test case fails sporadically when run against debug version of server (this test is skipped on non-debug build).

The problem seems to be caused by combination a) wrong macro used in InnoDB code to set debug sync point used by this test and b) missing cleanup between different parts of test case.

How to repeat:
./mtr --mem --repeat=100 ddl_kill

against debug version of server.

For me even the first iteration fails typically with:

Logging: XXX/mysql-test/mysql-test-run.pl  --mem --repeat=100 ddl_kill
MySQL Version 8.0.35
Checking supported features
 - Binaries are debug compiled
Using 'all' suites
Collecting tests
Checking leftover processes
Removing old var directory
Creating var directory 'XXX/mysql-test/var'
 - symlinking 'var' to '/dev/shm/var_auto_IKMu'
Installing system database
Using parallel: 1

                  TEST NAME                       RESULT  TIME (ms) COMMENT
[  0%] innodb.ddl_kill                           [ fail ]
        Test ended at 2023-11-08 09:14:24

CURRENT_TEST: innodb.ddl_kill
mysqltest: At line 60: Query 'reap' succeeded, should have failed with error '1317'


Suggested fix:
I plan to contribute simple fix for this problem.
[8 Nov 2023 8:47] Dmitry Lenev
Simple fix for sporadic innodb.ddl_kill failures.

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: ps-8671-bug113002-contrib.patch (text/x-patch), 3.38 KiB.

[8 Nov 2023 9:29] MySQL Verification Team
Hello Dmitry,

Thank you for the report and contribution.

[8 Nov 2023 10:34] Dmitry Lenev

Additional note about the approach used to fix this issue in the contribution.

InnoDB team might consider alternative approach and add THD objects for worker threads created by parallel ALTER TABLE implementation so it works better with DEBUG_SYNC facility. After all InnoDB already creates THD objects for some of its background threads. I have considered this approach but decided that I am not feeling confident with InnoDB code enough to follow it.