forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2034519
committed
Fix race condition at backend exit when deleting element in syncrep queue
When a backend exits, it gets deleted from the syncrep queue if present.The queue was checked without SyncRepLock taken in exclusive mode, so itwould have been possible for a backend to remove itself after a WALsender already did the job. Fix this issue based on a suggestion fromFujii Masao, by first checking the queue without the lock. Then, if thebackend is present in the queue, take the lock and perform an additionallookup check before doing the element deletion.Author: Dongming LiuReviewed-by: Kyotaro Horiguchi, Fujii Masao, Michael PaquierDiscussion:https://postgr.es/m/a0806273-8bbb-43b3-bbe1-c45a58f6ae21.lingce.ldm@alibaba-inc.comBackpatch-through: 9.41 parent3967737 commit2034519
1 file changed
+9
-1
lines changedLines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
361 | 361 |
| |
362 | 362 |
| |
363 | 363 |
| |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
364 | 368 |
| |
365 | 369 |
| |
366 | 370 |
| |
367 |
| - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
368 | 376 |
| |
369 | 377 |
| |
370 | 378 |
| |
|
0 commit comments
Comments
(0)