Skip to content
/ server Public

MDEV-38195: Fix flaky events_restart test#4753

Open
varundeepsaini wants to merge 1 commit intoMariaDB:11.8from
varundeepsaini:MDEV-38195-fix-flaky-tests
Open

MDEV-38195: Fix flaky events_restart test#4753
varundeepsaini wants to merge 1 commit intoMariaDB:11.8from
varundeepsaini:MDEV-38195-fix-flaky-tests

Conversation

@varundeepsaini
Copy link
Contributor

@varundeepsaini varundeepsaini commented Mar 7, 2026

Summary

  • events.events_restart: Add missing mtr.add_suppression for "error during compilation" and "Query was empty" errors that occur when the event scheduler processes events from a corrupted mysql.event table (body column altered to longtext during the test).

Test plan

  • events.events_restart passes locally
  • CI passes

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Mar 9, 2026
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! This is a preliminary review.

Please re-base on 11.4 since this is the first reported version and this is a bug fix.

connection c1;
--disable_query_log
let $tmp_usage2=`select tmp_space_used from information_schema.processlist where id=$id`;
if ($tmp_usage1 == $tmp_usage2)
Copy link
Member

Choose a reason for hiding this comment

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

This is IMHO just killing the messenger. What this variable tracks is the actual temp space used by the server. Not the space occupied by files in the tmp directory for example.

So, nobody external to the server is just going to add "small differences" to the count between two statements.

This means that, instead of basically turning the test off, you need to find out who's writing.

And the test is designed to prove that the statement from the other thread is not adding temp space usage before commit. So if the statement is not using temp space you need to find who is.

I have a theory: mtr runs tests with the same startup options on the same server instance without restarting the server. This is done to avoid having to restart the server too many times. Note also that the client will get an OK as soon as the transaction is reliably written to disk. So the client will happily continue with the next statement while the previous statement is still cleaning up. So what you might be seeing is after effects of the CREATE TABLE or some such.

Of course, this needs better analysis and confirmation. But, even if not correct, this should give you some idea of what does it mean to fix a "flaky" test failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the root cause is that information_schema.session_status is being queried while tmp_memory_table_size=0, which forces the query's own internal temp table to disk — so it ends up changing tmp_space_used as a side effect of reading it. By the time c1 reads processlist, it sees the inflated value (the diff was exactly 16KB, one page from the temp table allocation).

I fixed it by temporarily setting tmp_memory_table_size high before the session_status read (like lines 72 - 77)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this particular test was added sometime later than 11.4
i've removed the fix for this test, i see there is no ticket created for this i'll create one and raise another pr with this fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created: #4765

Copy link
Member

Choose a reason for hiding this comment

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

11.4 is EOLed. Please re-base on 11.8 and fix the test as you did in the other PR. And: good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gkodinov Thankss, have rebased both the prs

@varundeepsaini varundeepsaini force-pushed the MDEV-38195-fix-flaky-tests branch from 8278edc to da46bba Compare March 9, 2026 16:47
@varundeepsaini varundeepsaini requested a review from gkodinov March 9, 2026 16:50
@varundeepsaini varundeepsaini force-pushed the MDEV-38195-fix-flaky-tests branch from da46bba to dd99b69 Compare March 9, 2026 19:57
@CLAassistant
Copy link

CLAassistant commented Mar 9, 2026

CLA assistant check
All committers have signed the CLA.

@varundeepsaini varundeepsaini changed the title MDEV-38195: Fix flaky events_restart and tmp_space_usage tests MDEV-38195: Fix flaky events_restart test Mar 9, 2026
@varundeepsaini varundeepsaini changed the base branch from main to 11.4 March 9, 2026 19:57
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

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

LGTM. Please rebase on 11.8 (and sorry for asking for 11.4 initially: I should have known better).

Please stand by for the final review.

@varundeepsaini
Copy link
Contributor Author

@gkodinov No worries, Thanks a lot for your quick reviews

Add missing error log suppressions for "error during compilation"
and "Query was empty" that occur when the event scheduler processes
events from a corrupted mysql.event table (body column altered to
longtext during the test).

Signed-off-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com>
@varundeepsaini varundeepsaini force-pushed the MDEV-38195-fix-flaky-tests branch from dd99b69 to ad28d27 Compare March 10, 2026 13:52
@varundeepsaini varundeepsaini changed the base branch from 11.4 to 11.8 March 10, 2026 13:53
@gkodinov gkodinov requested a review from vuvova March 11, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

4 participants