forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit073ffef
committed
Fix inadequate buffer locking in FSM and VM page re-initialization.
When reading an existing FSM or VM page that was found to be corrupt by thebuffer manager, the code applied PageInit() to reinitialize the page, butdid so without any locking. There is thus a hazard that two backends mightconcurrently do PageInit, which in itself would still be OK, but the slowerone might then zero over subsequent data changes applied by the faster one.Even that is unlikely to be fatal; but it's not desirable, so add lockingto prevent it.This does not add any locking overhead in the normal code path where thepage is OK. It's not immediately obvious that that's safe, but I believeit is, for reasons explained in the added comments.Problem noted by R P Asim. It's been like this for a long time, soback-patch to all supported branches.Discussion:https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com1 parent9348020 commit073ffef
File tree
2 files changed
+40
-2
lines changed- src/backend
- access/heap
- storage/freespace
2 files changed
+40
-2
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
610 | 610 |
| |
611 | 611 |
| |
612 | 612 |
| |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
613 | 627 |
| |
614 | 628 |
| |
615 | 629 |
| |
616 | 630 |
| |
617 |
| - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
618 | 637 |
| |
619 | 638 |
| |
620 | 639 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
593 | 593 |
| |
594 | 594 |
| |
595 | 595 |
| |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
596 | 610 |
| |
597 | 611 |
| |
598 | 612 |
| |
599 |
| - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
600 | 619 |
| |
601 | 620 |
| |
602 | 621 |
| |
|
0 commit comments
Comments
(0)