Skip to content

MDEV-40661: mysql_upgrade.test not stable on a busy server - #5510

Open
gkodinov wants to merge 1 commit into
12.3from
mdev-40661
Open

MDEV-40661: mysql_upgrade.test not stable on a busy server#5510
gkodinov wants to merge 1 commit into
12.3from
mdev-40661

Conversation

@gkodinov

@gkodinov gkodinov commented Aug 7, 2026

Copy link
Copy Markdown
Member

The cleanup of the old connection goes on in the background. It can take longer on a busy server and this trigger the active sessions warning in DROP user.
Stabilized the test by counting the number of session prior to upgrade and waiting for the count after.

@gkodinov gkodinov self-assigned this Aug 7, 2026
@gkodinov

gkodinov commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Note a similar PR: #5344

@gkodinov
gkodinov requested a review from svoj August 7, 2026 10:09
@gkodinov gkodinov assigned svoj and unassigned gkodinov Aug 7, 2026
@gkodinov
gkodinov requested a lite review from Copilot August 7, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Stabilizes mysql-test/main/mysql_upgrade.test for busy servers by ensuring mysql_upgrade’s background connection cleanup has completed (as measured by returning to the pre-upgrade session count) before running DROP USER, avoiding intermittent “active sessions” warnings.

Changes:

  • Capture the current Threads_connected count before selected mysql_upgrade invocations.
  • Wait after mysql_upgrade until Threads_connected returns to (or below) the pre-upgrade baseline before dropping affected users.
  • Apply this pattern across several upgrade scenarios within the same test.
Suppressed comments (5)

mysql-test/main/mysql_upgrade.test:209

  • This --source line has trailing whitespace after the include filename. While mysqltest currently tolerates it, it adds noise and can be error-prone in tooling; please remove the trailing space.
--source include/wait_until_count_sessions.inc 

mysql-test/main/mysql_upgrade.test:140

  • This --source line has trailing whitespace after the include filename. While mysqltest currently tolerates it, it adds noise and can be error-prone in tooling; please remove the trailing space.
--source include/wait_until_count_sessions.inc 

mysql-test/main/mysql_upgrade.test:425

  • This --source line has trailing whitespace after the include filename. While mysqltest currently tolerates it, it adds noise and can be error-prone in tooling; please remove the trailing space.
--source include/wait_until_count_sessions.inc 

mysql-test/main/mysql_upgrade.test:458

  • This --source line has trailing whitespace after the include filename. While mysqltest currently tolerates it, it adds noise and can be error-prone in tooling; please remove the trailing space.
--source include/wait_until_count_sessions.inc 

mysql-test/main/mysql_upgrade.test:605

  • This --source line has trailing whitespace after the include filename. While mysqltest currently tolerates it, it adds noise and can be error-prone in tooling; please remove the trailing space.
--source include/wait_until_count_sessions.inc 

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mysql-test/main/mysql_upgrade.test Outdated

@svoj svoj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vuvova seem to prefer to disable_warnings: 61d784c.

As discussed previously, count_sessions.inc is fragile, this guard can be easily bypassed by setting sleeps in the server. And we've seen such test failures in buildbot many times.

@gkodinov gkodinov added the MariaDB Foundation Pull requests created by MariaDB Foundation label Aug 10, 2026
@gkodinov
gkodinov force-pushed the mdev-40661 branch 2 times, most recently from f4702be to d154695 Compare August 10, 2026 09:35
The cleanup of the old connection goes on in the background.
It can take longer on a busy server and this triggers the active sessions
warning in DROP user.
Stablizied the test by disabling the warnings.
@gkodinov

Copy link
Copy Markdown
Member Author

@vuvova seem to prefer to disable_warnings: 61d784c.

As discussed previously, count_sessions.inc is fragile, this guard can be easily bypassed by setting sleeps in the server. And we've seen such test failures in buildbot many times.

Disable_warning it is. I really think this is not the best option, but if it's popular, sure. The main point is to stabilize the test.

@gkodinov
gkodinov requested a review from svoj August 10, 2026 09:38
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