[MDEV-20707] Missing memory barrier in parallel replication error handler in wait_for_prior_commit() Created: 2019-10-01 Updated: 2020-06-15 Resolved: 2019-11-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.4 |
| Fix Version/s: | 10.4.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sujatha Sivakumar (Inactive) | Assignee: | Sujatha Sivakumar (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | lock-free, parallelslave | ||
| Description |
|
The 'wakeup' and 'wait code' in parallel replication looks as shown below. // Wakeup code in wait_for_commit::wakeup(): // Wait code in wait_for_prior_commit(): So the waiter code runs a "fast path" without locks. It is ok if we race on But it looks like there is a race as follows: 1. wakeup() sets waitee= NULL It is not enough of course to swap the assignments in wakeup(). A With proper barriers, the waiter cannot see the write of waitee=NULL without |
| Comments |
| Comment by Sujatha Sivakumar (Inactive) [ 2019-10-14 ] |
|
Hello Andrei, Please review the contributed changes for Patch: https://github.com/MariaDB/server/commit/4eb6ea77e2051bf50b68567f82862f5726fd4bd7 BuildBot Testing: http://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-10.4-sujatha Thank you. |
| Comment by Andrei Elkin [ 2019-11-13 ] |
|
Thanks for working on it! |
| Comment by Sujatha Sivakumar (Inactive) [ 2019-11-14 ] |
|
Fix is implemented in 10.4.11. |