Skip to content
/ server Public

MDEV-37797 - main.information_schema_db fails sporadically#4339

Merged
svoj merged 1 commit intoMariaDB:10.11from
svoj:pr-10.11-MDEV-37797
Oct 6, 2025
Merged

MDEV-37797 - main.information_schema_db fails sporadically#4339
svoj merged 1 commit intoMariaDB:10.11from
svoj:pr-10.11-MDEV-37797

Conversation

@svoj
Copy link
Contributor

@svoj svoj commented Oct 4, 2025

MDEV-20549 test output was affected by incompletely closed preceding connections.

Fix for similar issue was attempted by f4eb095, it introduced wait_until_disconnected.inc. For an explanation of why it didn't work see bead24b commit comment.

Another fix was attempted in bead24b. It didn't help either, because connection is removed from information_schema.processlist after COM_QUIT handling.

Make test for MDEV-20549 agnostic to concurrent connections by querying information_schema.processlist only for connections that it uses.

@svoj svoj requested a review from Copilot October 4, 2025 19:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a sporadic test failure in main.information_schema_db caused by incompletely closed connections from preceding tests affecting the MDEV-20549 test output. The fix replaces broken connection cleanup patterns with a more reliable approach.

  • Hardcodes $count_sessions to 1 instead of using the broken count_sessions.inc
  • Removes redundant connection switching before disconnections
  • Uses wait_until_count_sessions.inc to ensure connections are properly closed

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
mysql-test/main/information_schema_db.test Implements the connection cleanup fix with hardcoded session count and simplified disconnect logic
mysql-test/main/information_schema_db.result Updates expected test output to reflect the removed connection switching commands

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@svoj svoj added the MariaDB Foundation Pull requests created by MariaDB Foundation label Oct 4, 2025
@svoj
Copy link
Contributor Author

svoj commented Oct 4, 2025

@vuvova thinking more on this... given that sleep(1) (suggested in MDEV) uncovers dozens of similar test failures, current approach assumes we'd have to surround each end every disconnect with wait_until_count_sessions.inc, which is ridiculous.

We could make this particular (and probably some other) test agnostic to concurrent connections by changing queries to something like select current_user(),user from information_schema.processlist where id=connection_id().

Some tests can't probably be made agnostic to concurrent connections, in this case we add wait_until_count_sessions.inc to such tests rather than to every disconnect statement.

@vuvova
Copy link
Member

vuvova commented Oct 5, 2025

ouch! I fixed it in 090de4e, but forgot to push. Please, free free to push your fix with =connection_id() or mine with !='mysqltest_1' or leave it to me to push. As you prefer.

@svoj
Copy link
Contributor Author

svoj commented Oct 5, 2025

@vuvova with sleep(1) there're also testdb_1 and testdb_2, so !='mysqltest_1' is not going to be enough. I'd go for =connection_id(). Thanks for your feedback!

@svoj svoj force-pushed the pr-10.11-MDEV-37797 branch from fa823f6 to d2fa222 Compare October 6, 2025 14:07
MDEV-20549 test output was affected by incompletely closed preceding
connections.

Fix for similar issue was attempted by f4eb095, it introduced
wait_until_disconnected.inc. For an explanation of why it didn't work
see bead24b commit comment.

Another fix was attempted in bead24b. It didn't help either,
because connection is removed from information_schema.processlist
after COM_QUIT handling.

Make test for MDEV-20549 agnostic to concurrent connections by
querying information_schema.processlist only for connections that
it uses.
@svoj svoj force-pushed the pr-10.11-MDEV-37797 branch from d2fa222 to 3ce1922 Compare October 6, 2025 14:08
@svoj svoj merged commit 0e322b6 into MariaDB:10.11 Oct 6, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

3 participants