forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2dc2e4e
committed
Avoid improbable PANIC during heap_update, redux.
Commit34f581c intended to ensure that RelationGetBufferForTuplewould acquire a visibility-map page pin in case the otherBuffer'sall-visible bit had become set since we last had lock on that page.But I missed a case: when we're extending the relation, VM concernswere dealt with only in the relatively-less-likely case that wefail to conditionally lock the otherBuffer. I think I'd believedthat we couldn't need to worry about it if the conditional locksucceeds, which is true for the target buffer; but the otherBufferwas unlocked for awhile so its bit might be set anyway. So we needto do the GetVisibilityMapPins dance, and then also recheck thepage's free space, in both cases.Per report from Jaime Casanova. Back-patch to v12 as the previouspatch was (although there's still no evidence that the bug isreachable pre-v14).Discussion:https://postgr.es/m/E1lWLjP-00006Y-Ml@gemulon.postgresql.org1 parent0e497ea commit2dc2e4e
1 file changed
+23
-18
lines changedLines changed: 23 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
678 | 678 |
| |
679 | 679 |
| |
680 | 680 |
| |
| 681 | + | |
681 | 682 |
| |
682 |
| - | |
683 |
| - | |
684 |
| - | |
685 |
| - | |
686 |
| - | |
687 |
| - | |
688 |
| - | |
689 |
| - | |
690 |
| - | |
691 |
| - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
692 | 693 |
| |
693 |
| - | |
694 |
| - | |
695 |
| - | |
696 |
| - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
697 | 704 |
| |
698 |
| - | |
699 |
| - | |
| 705 | + | |
700 | 706 |
| |
701 | 707 |
| |
702 |
| - | |
703 |
| - | |
| 708 | + | |
704 | 709 |
| |
705 | 710 |
| |
706 | 711 |
| |
|
0 commit comments
Comments
(0)