forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8658703
committed
Prevent deadlock in ginRedoDeletePage()
On standby ginRedoDeletePage() can work concurrently with read-only queries.Those queries can traverse posting tree in two ways.1) Using rightlinks by ginStepRight(), which locks the next page before unlocking its left sibling.2) Using downlinks by ginFindLeafPage(), which locks at most one page at time.Original lock order was: page, parent, left sibling. That lock order candeadlock with ginStepRight(). In order to prevent deadlock this commit changeslock order to: left sibling, page, parent. Note, that position of parent inlocking order seems insignificant, because we only lock one page at time whiletraversing downlinks.Reported-by: Chen HuajunDiagnosed-by: Chen Huajun, Peter Geoghegan, Andrey BorodinDiscussion:https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.comAuthor: Alexander KorotkovBackpatch-through: 9.41 parent2e3bd06 commit8658703
1 file changed
+13
-9
lines changedLines changed: 13 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
513 | 513 |
| |
514 | 514 |
| |
515 | 515 |
| |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
516 | 529 |
| |
517 | 530 |
| |
518 | 531 |
| |
| |||
532 | 545 |
| |
533 | 546 |
| |
534 | 547 |
| |
535 |
| - | |
536 |
| - | |
537 |
| - | |
538 |
| - | |
539 |
| - | |
540 |
| - | |
541 |
| - | |
542 |
| - | |
543 |
| - | |
544 | 548 |
| |
545 | 549 |
| |
546 | 550 |
| |
|
0 commit comments
Comments
(0)