forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit130beba
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 parent3948115 commit130beba
File tree
2 files changed
+40
-2
lines changed- src/backend
- access/heap
- storage/freespace
2 files changed
+40
-2
lines changedLines changed: 20 additions & 1 deletion
Original 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 |
| |
|
Lines changed: 20 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
580 | 580 |
| |
581 | 581 |
| |
582 | 582 |
| |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
583 | 597 |
| |
584 | 598 |
| |
585 | 599 |
| |
586 |
| - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
587 | 606 |
| |
588 | 607 |
| |
589 | 608 |
| |
|
0 commit comments
Comments
(0)