[MDEV-28689] Two improper locking bugs in the method compress_write Created: 2022-05-29 Updated: 2022-07-13 Resolved: 2022-07-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup |
| Affects Version/s: | 10.9.1 |
| Fix Version/s: | 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Ryan | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Issue Links: |
|
||||||||
| Description |
|
Hi, developers, thank you for your checking. Does it seem the lock ctrl_mutex is not released correctly when writing to the destination stream fails and writing to the destination stream fails in the compress_write? This is similar to the lock data_mutex, which is acquired in a nearby place. It is not released when writing to the destination stream fails and writing to the destination stream fails in the compress_write. https://github.com/MariaDB/server/blob/10.9/extra/mariabackup/ds_compress.cc#L234-L261 Thank you for your checking! |
| Comments |
| Comment by Marko Mäkelä [ 2022-05-29 ] |
|
Thank you for reviewing the code. Do you think that my suggested cleanup related to |
| Comment by Ryan [ 2022-05-29 ] |
|
I am not familiar with the code, yet I think the patch could fix the bugs. Thank you very much. |
| Comment by Marko Mäkelä [ 2022-05-30 ] |
|
I am not very familiar with this code either, but I think that simpler code is easier to follow. |
| Comment by Vladislav Vaintroub [ 2022-07-11 ] |
|
Apprently, this broke --compress entirely, and was pushed without any testing. |
| Comment by Marko Mäkelä [ 2022-07-11 ] |
|
wlad, sorry, as noted in |