Skip to content
/ server Public

MDEV-33070 Thread pool starvation at oversubscribe#4804

Merged
gkodinov merged 1 commit intoMariaDB:10.11from
varundeepsaini:MDEV-33070-thread-pool-starvation
Mar 18, 2026
Merged

MDEV-33070 Thread pool starvation at oversubscribe#4804
gkodinov merged 1 commit intoMariaDB:10.11from
varundeepsaini:MDEV-33070-thread-pool-starvation

Conversation

@varundeepsaini
Copy link
Contributor

@varundeepsaini varundeepsaini commented Mar 14, 2026

Summary

  • allow a thread group to reach the oversubscribe threshold before treating it as oversubscribed
  • add an MTR regression test for MDEV-33070 covering queued work at the threshold

Testing

  • Added a regression test

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Mar 16, 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.

Copy link
Member

@vaintroub vaintroub left a comment

Choose a reason for hiding this comment

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

Commented on test case. The one-liner code fix is ok, but test needs some improvement (and explanation)

@varundeepsaini varundeepsaini force-pushed the MDEV-33070-thread-pool-starvation branch 4 times, most recently from 3b1f419 to dfd6a1d Compare March 18, 2026 06:07
Copy link
Member

@vaintroub vaintroub 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! Looks quite good to me, nice explanation for the test case.
The only thing that I'd remove is a synchronous SELECT SLEEP(1), as commented. Perhaps you can slightly increase wait_timeout up from 2 seconds, when checking that INSERT went through(as commented, CI sometimes have weird timing issues), though I do not have a very strong opinion.

@varundeepsaini varundeepsaini force-pushed the MDEV-33070-thread-pool-starvation branch from dfd6a1d to 7af1a72 Compare March 18, 2026 10:24
Copy link
Member

@vaintroub vaintroub left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments! Looks good to me now.

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. Thanks for working on this.

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.

Please rebase to 10.11: this is a bug fix and it needs to be in the lowest affected version.

@gkodinov gkodinov changed the base branch from main to 10.11 March 18, 2026 11:42
@gkodinov
Copy link
Member

I will rebase. and merge.

@gkodinov gkodinov force-pushed the MDEV-33070-thread-pool-starvation branch from 7af1a72 to aea0a9f Compare March 18, 2026 11: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.

rebased.

Allow one more worker at the oversubscribe threshold so a group
only becomes oversubscribed after it exceeds the configured
limit.

Add a regression test that reproduces the starvation case in the
generic thread pool and verifies queued work still drains.

Signed-off-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com>
@gkodinov gkodinov force-pushed the MDEV-33070-thread-pool-starvation branch from aea0a9f to 3735d28 Compare March 18, 2026 11:58
@varundeepsaini
Copy link
Contributor Author

@gkodinov Thanks a lot !! ❤️

@gkodinov gkodinov merged commit ad5ef77 into MariaDB:10.11 Mar 18, 2026
15 of 17 checks passed
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.

3 participants