Sergei Golubchik
bead24b7f3
mariadb-test: wait on disconnect
...
Remove one of the major sources of race condiitons in mariadb-test.
Normally, mariadb_close() sends COM_QUIT to the server and immediately
disconnects. In mariadb-test it means the test can switch to another
connection and sends queries to the server before the server even
started parsing the COM_QUIT packet and these queries can see the
connection as fully active, as it didn't reach dispatch_command yet.
This is a major source of instability in tests and many - but not all,
still less than a half - tests employ workarounds. The correct one
is a pair count_sessions.inc/wait_until_count_sessions.inc.
Also very popular was wait_until_disconnected.inc, which was completely
useless, because it verifies that the connection is closed, and after
disconnect it always is, it didn't verify whether the server processed
COM_QUIT. Sadly the placebo was as widely used as the real thing.
Let's fix this by making mariadb-test `disconnect` command _to wait_ for
the server to confirm. This makes almost all workarounds redundant.
In some cases count_sessions.inc/wait_until_count_sessions.inc is still
needed, though, as only `disconnect` command is changed:
* after external tools, like `exec $MYSQL`
* after failed `connect` command
* replication, after `STOP SLAVE`
* Federated/CONNECT/SPIDER/etc after `DROP TABLE`
and also in some XA tests, because an XA transaction is dissociated from
the THD very late, after the server has closed the client connection.
Collateral cleanups: fix comments, remove some redundant statements:
* DROP IF EXISTS if nothing is known to exist
* DROP table/view before DROP DATABASE
* REVOKE privileges before DROP USER
etc
2025-07-16 09:14:33 +07:00
..
2019-09-01 19:17:35 +03:00
2024-08-03 09:32:42 +02:00
2023-02-03 11:01:24 +03:00
2024-02-27 20:55:54 +02:00
2021-05-10 09:36:40 +05:30
2023-08-15 10:16:11 +02:00
2023-08-15 10:16:11 +02:00
2023-08-15 10:16:11 +02:00
2023-08-15 10:16:11 +02:00
2020-01-15 18:06:24 +01:00
2025-04-28 12:59:38 +03:00
2025-04-19 10:59:58 +04:00
2025-01-29 09:08:19 +04:00
2023-12-07 14:27:42 +03:00
2023-12-07 14:27:42 +03:00
2024-05-27 12:39:03 +02:00
2023-08-05 20:34:09 +02:00
2021-12-15 19:13:57 +01:00
2021-12-15 19:13:57 +01:00
2025-04-29 13:53:16 +10:00
2024-07-11 10:21:07 +04:00
2023-07-27 15:43:21 +02:00
2024-02-17 17:10:25 +01:00
2024-02-17 17:10:25 +01:00
2025-04-28 12:59:38 +03:00
2025-04-29 13:53:16 +10:00
2025-04-29 13:53:16 +10:00
2022-09-23 17:36:20 +07:00
2024-04-17 16:52:37 +02:00
2021-09-13 08:03:25 +04:00
2023-04-18 11:31:05 +04:00
2023-04-18 11:31:05 +04:00
2022-09-26 10:24:59 +07:00
2022-09-23 17:36:20 +07:00
2023-06-02 17:51:40 +02:00
2022-09-23 17:36:20 +07:00
2020-01-28 12:29:23 +04:00
2020-05-29 11:15:28 +04:00
2024-09-18 18:39:26 +07:00
2024-06-28 16:45:50 +07:00
2025-04-29 16:53:02 +02:00
2024-10-03 13:24:43 +03:00
2020-02-13 13:42:01 +02:00
2024-06-28 16:45:50 +07:00
2024-05-24 15:50:05 +04:00
2024-05-24 15:50:05 +04:00
2024-05-24 15:50:05 +04:00
2024-06-28 16:45:50 +07:00
2020-01-28 12:29:23 +04:00
2025-01-17 15:39:55 +04:00
2022-08-10 15:04:24 +02:00
2022-08-10 15:04:24 +02:00
2025-04-29 13:53:16 +10:00
2021-12-02 05:35:35 +04:00
2024-05-27 11:55:32 +04:00
2023-02-23 23:40:45 +04:00
2023-08-04 08:01:06 +02:00
2024-05-24 15:50:05 +04:00
2019-09-23 14:11:48 +05:30
2025-04-29 16:53:02 +02:00
2024-07-10 12:17:09 +04:00
2025-04-19 10:59:58 +04:00
2024-03-20 09:48:03 +02:00
2024-07-11 10:21:07 +04:00
2024-02-04 22:19:15 +01:00
2019-09-01 19:17:35 +03:00
2024-02-03 11:22:20 +01:00
2025-04-29 13:53:16 +10:00
2025-05-05 12:02:47 +07:00
2023-10-30 18:39:56 +01:00
2023-08-17 17:20:44 +02:00
2023-03-15 17:35:22 -07:00
2023-08-17 17:20:44 +02:00
2023-03-15 17:35:22 -07:00
2023-03-15 17:35:22 -07:00
2023-03-15 17:35:22 -07:00
2025-02-11 20:31:25 +01:00
2024-06-28 16:45:50 +07:00
2022-07-13 09:03:32 -06:00
2025-04-29 13:53:16 +10:00
2024-04-17 16:52:37 +02:00
2023-08-05 20:34:09 +02:00
2023-12-19 15:53:18 +01:00
2024-10-03 09:31:39 +03:00
2023-02-03 11:01:24 +03:00
2023-02-03 11:01:24 +03:00
2025-04-19 10:59:58 +04:00
2021-05-19 22:54:12 +02:00
2022-09-23 17:36:20 +07:00
2024-07-11 10:21:07 +04:00
2025-02-11 20:31:25 +01:00
2024-05-12 14:56:45 +02:00
2021-03-05 08:25:52 +11:00
2020-10-24 14:57:57 +03:00
2021-04-26 09:56:46 +03:00
2023-12-22 00:10:23 +01:00
2023-12-22 00:10:23 +01:00
2025-01-27 19:05:26 +01:00
2025-01-30 12:01:11 +01:00
2024-06-28 16:45:50 +07:00
2024-07-22 15:14:50 +02:00
2025-07-16 09:14:33 +07:00
2024-05-27 12:39:02 +02:00
2024-05-27 12:39:02 +02:00
2024-05-27 12:39:02 +02:00
2024-11-13 17:39:47 +11:00
2024-10-19 17:20:27 +11:00
2025-06-16 12:00:45 +10:00
2022-09-23 17:36:20 +07:00
2019-07-19 13:39:20 +03:00
2022-11-29 03:34:35 +02:00
2022-12-27 00:02:02 +03:00
2019-09-01 19:17:35 +03:00
2023-09-11 09:09:02 +03:00
2023-09-11 09:09:02 +03:00
2023-09-11 09:09:02 +03:00
2023-09-11 09:09:02 +03:00
2023-09-11 09:09:02 +03:00
2024-04-25 07:48:57 +03:00
2024-05-05 21:37:08 +02:00
2022-09-23 17:36:20 +07:00
2020-09-03 15:53:38 +03:00
2024-01-12 17:22:08 +01:00
2021-07-06 15:50:58 +10:00
2022-08-02 09:34:15 +02:00
2025-02-01 16:53:39 +01:00
2025-04-18 09:41:23 +02:00
2020-10-27 09:24:15 +01:00
2024-09-26 11:50:20 +02:00
2021-01-28 19:01:32 +01:00
2021-01-28 19:01:32 +01:00
2021-05-19 06:48:36 +02:00
2024-05-24 15:50:05 +04:00
2024-05-24 15:50:05 +04:00
2024-05-24 15:50:05 +04:00
2022-02-16 13:06:23 +07:00
2024-05-12 14:56:45 +02:00
2022-01-19 18:10:12 +03:00
2025-07-16 09:14:33 +07:00
2024-07-11 10:21:07 +04:00
2024-07-08 22:40:16 +02:00
2019-10-11 12:29:12 +03:00
2019-10-11 12:29:12 +03:00
2024-07-11 10:21:07 +04:00
2025-04-29 13:53:16 +10:00
2021-03-11 12:46:18 +02:00
2020-11-11 11:15:11 +02:00
2020-11-11 11:15:11 +02:00
2020-09-01 15:52:36 +03:00
2020-09-01 15:52:36 +03:00
2024-12-12 18:02:00 +02:00
2023-12-05 19:26:30 +03:00
2023-12-05 19:26:30 +03:00
2021-03-16 15:20:26 +02:00
2019-10-04 15:58:47 +02:00
2020-03-23 10:57:21 +01:00
2022-10-04 13:16:17 +02:00
2022-01-28 16:31:53 +02:00
2022-01-28 16:31:53 +02:00
2022-01-19 18:14:07 +03:00
2024-10-30 13:58:20 +04:00
2024-04-17 16:52:37 +02:00
2024-04-17 16:52:37 +02:00
2024-04-17 16:52:37 +02:00
2023-02-02 21:43:30 +03:00
2021-10-26 17:07:46 +02:00
2021-10-26 17:07:46 +02:00
2023-09-11 11:23:26 +02:00
2023-02-07 07:29:04 +00:00
2024-06-07 18:26:08 +02:00
2024-06-07 18:26:08 +02:00
2024-05-27 12:39:04 +02:00
2023-07-07 12:53:18 +03:00
2024-07-04 15:24:49 +03:00
2023-07-07 12:53:18 +03:00
2023-07-07 12:53:18 +03:00
2023-07-07 12:53:18 +03:00
2025-03-15 11:15:54 +01:00
2023-10-19 13:50:00 +03:00
2023-01-23 19:01:48 +02:00
2020-03-10 19:24:24 +01:00
2021-07-06 15:29:00 +10:00
2022-12-27 00:02:02 +03:00
2022-12-27 00:02:02 +03:00
2023-02-03 00:00:35 +03:00
2025-04-29 13:53:16 +10:00
2024-07-11 10:21:07 +04:00
2025-01-13 10:41:40 +02:00
2023-07-02 12:15:11 +02:00
2021-03-18 08:02:48 +01:00
2022-09-26 10:24:59 +07:00
2025-05-28 16:33:49 +10:00
2021-12-15 19:13:57 +01:00
2022-09-23 17:36:20 +07:00
2021-07-02 17:17:19 +10:00
2022-02-23 15:48:08 +02:00
2025-05-28 16:33:49 +10:00
2025-05-28 16:33:49 +10:00
2020-03-10 19:24:24 +01:00
2022-02-23 15:48:08 +02:00
2024-08-19 10:59:57 +03:00
2022-05-30 09:58:40 +02:00
2022-01-27 10:36:39 +11:00
2020-03-24 21:00:02 +02:00
2024-09-11 14:21:22 +03:00
2020-03-11 17:52:49 +01:00
2025-07-16 09:14:33 +07:00
2021-07-02 17:17:19 +10:00
2025-04-29 13:53:16 +10:00
2021-05-19 22:54:13 +02:00
2021-07-15 16:27:31 +07:00
2021-07-15 16:27:31 +07:00
2024-09-18 18:39:26 +07:00
2024-10-03 16:09:56 +03:00
2024-05-27 12:39:03 +02:00
2025-07-16 09:14:33 +07:00
2024-01-23 13:39:22 +05:30
2020-02-13 13:42:01 +02:00
2022-08-09 09:47:16 +02:00
2025-04-28 12:59:39 +03:00
2019-09-01 19:17:35 +03:00
2025-07-16 09:14:33 +07:00
2020-02-13 13:42:01 +02:00
2024-05-21 19:38:51 +02:00
2024-07-11 10:21:07 +04:00
2023-09-14 21:35:40 +02:00
2023-10-14 13:36:11 +03:00
2023-09-14 21:35:40 +02:00
2023-09-15 12:04:44 +10:00
2023-09-14 21:35:40 +02:00
2022-07-26 13:31:27 -06:00
2024-04-17 16:52:37 +02:00
2023-09-14 21:35:40 +02:00
2024-04-17 16:52:37 +02:00
2023-09-12 17:14:43 +03:00
2024-10-08 11:58:46 +02:00
2024-11-29 13:43:17 +02:00
2022-07-26 13:31:27 -06:00
2022-01-27 21:25:07 +02:00
2024-05-27 12:39:04 +02:00
2024-05-27 12:39:02 +02:00
2024-12-05 09:20:36 +01:00
2024-07-25 08:57:27 -06:00
2024-04-17 16:52:37 +02:00
2024-04-05 12:40:49 +02:00
2025-02-09 13:56:19 +04:00
2025-02-09 13:56:19 +04:00
2025-02-09 13:56:19 +04:00
2023-04-06 16:17:50 +04:00
2024-04-17 16:52:37 +02:00
2024-04-05 12:40:49 +02:00
2020-04-27 09:22:36 +02:00
2020-04-27 09:22:36 +02:00
2025-04-29 13:53:16 +10:00
2024-04-05 12:40:49 +02:00
2025-04-28 12:59:39 +03:00
2024-07-11 10:21:07 +04:00
2024-07-11 10:21:07 +04:00
2022-07-26 13:31:27 -06:00
2019-08-22 15:09:59 +04:00
2022-08-05 22:23:40 +04:00
2025-02-11 20:31:25 +01:00
2022-09-26 10:24:59 +07:00
2023-03-15 17:35:22 -07:00
2023-03-15 17:35:22 -07:00
2023-03-15 17:35:22 -07:00
2020-04-10 19:35:53 +04:00
2024-07-10 18:50:08 +03:00
2023-11-16 10:41:11 +01:00
2023-09-14 21:35:40 +02:00
2023-11-28 19:10:42 +01:00
2024-04-05 12:40:49 +02:00
2023-09-14 21:35:40 +02:00
2023-11-17 19:44:11 +01:00
2023-09-14 21:35:40 +02:00
2021-09-14 17:57:27 +03:00
2024-02-27 20:55:54 +02:00
2022-07-29 13:39:12 +02:00
2023-10-08 18:16:20 +03:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2022-09-23 17:36:20 +07:00
2023-02-16 13:34:45 +02:00
2024-09-18 18:39:26 +07:00
2019-08-28 09:19:24 +03:00
2019-08-28 09:19:24 +03:00
2019-08-28 09:19:24 +03:00