[MDEV-24094] Race condition and hang in INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION Created: 2020-11-02 Updated: 2020-11-02 Resolved: 2020-11-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Information Schema, Storage Engine - InnoDB |
| Affects Version/s: | 10.5.7 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | regression | ||
| Description |
|
The reduction of fil_system.mutex contention introduced a race condition that can lead to a hang of the server when the view INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION is accessed. If space->is_stopping() starts to hold right after the check, then we would attempt to acquire fil_system.mutex while we are already holding it. The fix is simple (and also clarifies what this is about):
To avoid the race condition, we must atomically check the is_stopping() flag while incrementing the reference count. |
| Comments |
| Comment by Marko Mäkelä [ 2020-11-02 ] |
|
This is not a bug after all. I encountered this while rebasing This bug only existed in my local repository and was never pushed anywhere. I am sorry for the noise. |