mirror of
https://github.com/MariaDB/server.git
synced 2025-10-24 00:27:49 +02:00
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 |
||
|---|---|---|
| .. | ||
| binlog_common.inc | ||
| binlog_edge_common.inc | ||
| binlog_ok_common.inc | ||
| cleanup_helper.inc | ||
| connection_cleanup.inc | ||
| connection_load.inc | ||
| connection_setup.inc | ||
| default_mysqld_autosize.cnf | ||
| digest_cleanup.inc | ||
| digest_execution.inc | ||
| digest_setup.inc | ||
| disable_instruments.inc | ||
| enable_instruments.inc | ||
| event_aggregate_cleanup.inc | ||
| event_aggregate_load.inc | ||
| event_aggregate_setup.inc | ||
| have_aligned_memory.inc | ||
| have_timer_cycle.inc | ||
| hostcache_dump.inc | ||
| hostcache_set_state.inc | ||
| memory_aggregate_cleanup.inc | ||
| memory_aggregate_load.inc | ||
| memory_aggregate_setup.inc | ||
| pfs_no_running_event_scheduler.inc | ||
| pfs_running_event_scheduler.inc | ||
| pfs_upgrade.inc | ||
| prepared_stmts_deallocation.inc | ||
| prepared_stmts_execution.inc | ||
| prepared_stmts_setup.inc | ||
| privilege.inc | ||
| processlist_load.inc | ||
| processlist_set.inc | ||
| program_cleanup.inc | ||
| program_execution.inc | ||
| program_nested_cleanup.inc | ||
| program_nested_execution.inc | ||
| program_nested_setup.inc | ||
| program_setup.inc | ||
| reset_transaction_gtid.inc | ||
| rpl_statements_truncate.inc | ||
| schema.inc | ||
| setup_helper.inc | ||
| show_aggregate.inc | ||
| show_plugin_verifier.inc | ||
| show_transaction_gtid.inc | ||
| socket_check1.inc | ||
| socket_event.inc | ||
| socket_event_dbg.inc | ||
| socket_ipv6.inc | ||
| socket_summary_check.inc | ||
| socket_summary_check_dbg.inc | ||
| stage_cleanup.inc | ||
| stage_setup.inc | ||
| start_server_common.inc | ||
| table_aggregate_cleanup.inc | ||
| table_aggregate_load.inc | ||
| table_aggregate_setup.inc | ||
| table_io_basic_dml.inc | ||
| table_io_cleanup_helper.inc | ||
| table_io_result_helper.inc | ||
| table_io_setup_helper.inc | ||
| transaction_cleanup.inc | ||
| transaction_nested_events_verifier.inc | ||
| transaction_setup.inc | ||
| upgrade_check.inc | ||
| wait_for_pfs_thread_count.inc | ||
| wait_till_sleep.inc | ||