[MDEV-27829] SELECT SLEEP(1) Hangs indefinitely with Time 0 Created: 2022-02-14  Updated: 2022-02-16  Resolved: 2022-02-16

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5, 10.8
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Roel Van de Paar
Resolution: Not a Bug Votes: 0
Labels: hang, regression


 Description   

The following:

INSERT INTO t VALUES (1);
CREATE TABLE parent (a INT KEY,b INT);
CREATE TABLE t (a INT KEY,FOREIGN KEY(a) REFERENCES parent (a) ON DELETE CASCADE) COLLATE=BIG5_nopad_bin;
SET GLOBAL innodb_status_output=1;
SELECT SLEEP (1);

When replayed using the C connector produces the following:

10.8.1 0c5d1342ae6b5ab3256848be7a83e5c3b1f21566 (Debug)

MariaDB [(none)]> show processlist;
+----+------+-----------+------+---------+------+------------+------------------+----------+
| Id | User | Host      | db   | Command | Time | State      | Info             | Progress |
+----+------+-----------+------+---------+------+------------+------------------+----------+
|  7 | root | localhost | test | Query   |    0 | User sleep | SELECT SLEEP (1) |    0.000 |
|  8 | root | localhost | NULL | Query   |    0 | starting   | show processlist |    0.000 |
+----+------+-----------+------+---------+------+------------+------------------+----------+
2 rows in set (0.000 sec)

i.e. the sleep hangs, seemingly perpetually, and always with 0 time (using single threaded replay). Killing the query (KILL 7;) reports "OK" but the state remains unchanged.



 Comments   
Comment by Roel Van de Paar [ 2022-02-16 ]

After more troubleshooting/pondering on this with a fresh head I worked out a bug in the framework. When SQL is shuffled (usually not used, unless issues are hard to reduce as shuffling can simplify sporadic issue reduction) the pquery binary will continue to execute SQL rather than limiting itself to the same length as the input file (as is the case with sequential replay). This situation is almost never seen, but having discovered this, it clarifies some odd memory hogging situations/dead simplification screens. Fixing it won't be too complex. Closing this ticket.

Comment by Roel Van de Paar [ 2022-02-16 ]

Fixed in https://github.com/mariadb-corporation/mariadb-qa/commit/9bc502e7edf2a12022e806e21839463b94f51e8c

Generated at Thu Feb 08 09:55:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.