MDEV-41055 innodb_encryption_threads=0 hangs indefinitely when rotation IOPS is zero - #5653
Open
Thirunarayanan wants to merge 1 commit into
Open
MDEV-41055 innodb_encryption_threads=0 hangs indefinitely when rotation IOPS is zero#5653Thirunarayanan wants to merge 1 commit into
Thirunarayanan wants to merge 1 commit into
Conversation
|
|
There was a problem hiding this comment.
🟡 Changes recommended
The result file does not match the test, and the test does not deterministically exercise the blocked condition-variable path.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Wakes encryption threads blocked on zero IOPS so thread-count reduction can complete.
Changes:
- Broadcasts the IOPS condition when changing thread count.
- Adds regression coverage for zero rotation IOPS.
- Updates expected test output.
File summaries
| File | Description |
|---|---|
storage/innobase/fil/fil0crypt.cc |
Wakes IOPS-blocked encryption threads. |
mysql-test/suite/encryption/t/innodb-encr-threads.test |
Adds the regression scenario. |
mysql-test/suite/encryption/r/innodb-encr-threads.result |
Adds expected regression output. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+16
to
+20
| SELECT COUNT(*) AS started_encrypting | ||
| FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION | ||
| WHERE ENCRYPTION_SCHEME = 1 AND MIN_KEY_VERSION = 0; | ||
| started_encrypting | ||
| 0 |
Comment on lines
+35
to
+38
| let $wait_condition= | ||
| SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION | ||
| WHERE ENCRYPTION_SCHEME = 1 AND MIN_KEY_VERSION = 0; | ||
| --source include/wait_condition.inc |
…on IOPS is zero Problem: ======= When innodb_encryption_rotation_iops=0, an encryption thread could be waiting on fil_crypt_iops_cond in fil_crypt_alloc_iops(). fil_crypt_set_thread_cnt() lowers srv_n_fil_crypt_threads and broadcasts only fil_crypt_thread_cond, so that the waiting thread never re-evaluates should_shutdown() and never exits. Solution: ========= fil_crypt_set_thread_cnt(): Broadcast fil_crypt_iops_cond as well, so a thread waiting for IOPS wakes up and sees should_shutdown(), exits.
Thirunarayanan
force-pushed
the
MDEV-41055
branch
from
September 10, 2026 06:01
65fe10f to
1f71ae0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
When innodb_encryption_rotation_iops=0, an encryption thread
could be waiting on fil_crypt_iops_cond in fil_crypt_alloc_iops(). fil_crypt_set_thread_cnt() lowers srv_n_fil_crypt_threads and broadcasts only fil_crypt_thread_cond, so that the waiting thread never re-evaluates should_shutdown() and never exits.
Solution:
fil_crypt_set_thread_cnt(): Broadcast fil_crypt_iops_cond as well, so a thread waiting for IOPS wakes up and sees should_shutdown(), exits.