[MDEV-22370] safe_mutex: Trying to lock uninitialized mutex at /data/src/10.4-bug/sql/rpl_parallel.cc, line 470 upon shutdown during FTWRL Created: 2020-04-26 Updated: 2021-05-14 Resolved: 2020-06-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Locking |
| Affects Version/s: | 10.4, 10.5 |
| Fix Version/s: | 10.5.4, 10.4.14 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sachin Setiya (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sprint-week-18 | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
The stack trace above is from an original failure in concurrent tests. The test case below will produce a failure with line numbers in rpl_parallel.cc shifted by 1, due to the suggested debug injection.
Reproducible on 10.4, 10.5. |
| Comments |
| Comment by Andrei Elkin [ 2020-04-27 ] | |||||||||||||||||||||||||||||||
|
sachin.setiya.007 I think we can crack this one quickly. Could you check it once having breaks from ALTER? | |||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2020-04-27 ] | |||||||||||||||||||||||||||||||
|
In concurrent tests, I am also getting what appears to be a closely related problem. It's harder for me to simulate, maybe the race condition is somewhat thinner, or I just don't see the right spot, but I hope you'll take care of it along with the reported one.
All threads stack trace is attached: error22_all_threads | |||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2020-04-28 ] | |||||||||||||||||||||||||||||||
|
In versions before 10.4 pool_mark_busy is called only once , But in 10.4 forward shutdown slave also calls pool_mark_busy
This commit seems responsible for this 5cd21ac20225 (https://jira.mariadb.org/browse/MDEV-20821) | |||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2020-04-28 ] | |||||||||||||||||||||||||||||||
|
So the rpl_parallel_thread_pool::destroy destroys the mutex LOCK_rpl_thread_pool, while FTWRL is waiting | |||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2020-04-28 ] | |||||||||||||||||||||||||||||||
|
This also fails
| |||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2020-04-28 ] | |||||||||||||||||||||||||||||||
|
So this patch will not work because it fails with earlier case
| |||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2020-04-28 ] | |||||||||||||||||||||||||||||||
|
Patch branch bb-10.4-sachin | |||||||||||||||||||||||||||||||
| Comment by Andrei Elkin [ 2020-06-15 ] | |||||||||||||||||||||||||||||||
|
Couple of cosmetic comments are left on GH, otherwise the patch looks nice. |