- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit2f2baf9
committed
Fix aboriginal mistake in lazy VACUUM's code for truncating away
no-longer-needed pages at the end of a table. We thought we could throw awaypages containing HEAPTUPLE_DEAD tuples; but this is not so, because suchtuples very likely have index entries pointing at them, and we wouldn't haveremoved the index entries. The problem only emerges in a somewhat unlikelyrace condition: the dead tuples have to have been inserted by a transactionthat later aborted, and this has to have happened between VACUUM's initialscan of the page and then rechecking it for empty in count_nondeletable_pages.But that timespan will include an index-cleaning pass, so it's not all thathard to hit. This seems to explain a couple of previously unsolved bugreports.1 parenta93840e commit2f2baf9
1 file changed
+12
-56
lines changedLines changed: 12 additions & 56 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| |||
780 | 780 |
| |
781 | 781 |
| |
782 | 782 |
| |
783 |
| - | |
| 783 | + | |
784 | 784 |
| |
785 | 785 |
| |
786 | 786 |
| |
787 | 787 |
| |
788 | 788 |
| |
789 | 789 |
| |
790 | 790 |
| |
791 |
| - | |
792 | 791 |
| |
793 | 792 |
| |
794 | 793 |
| |
| |||
798 | 797 |
| |
799 | 798 |
| |
800 | 799 |
| |
801 |
| - | |
802 |
| - | |
803 |
| - | |
| 800 | + | |
804 | 801 |
| |
805 | 802 |
| |
806 | 803 |
| |
| |||
815 | 812 |
| |
816 | 813 |
| |
817 | 814 |
| |
818 |
| - | |
| 815 | + | |
819 | 816 |
| |
820 | 817 |
| |
821 | 818 |
| |
822 | 819 |
| |
823 | 820 |
| |
824 |
| - | |
825 | 821 |
| |
826 | 822 |
| |
827 | 823 |
| |
828 | 824 |
| |
829 | 825 |
| |
830 | 826 |
| |
831 | 827 |
| |
832 |
| - | |
833 | 828 |
| |
834 | 829 |
| |
835 | 830 |
| |
836 |
| - | |
837 |
| - | |
838 |
| - | |
839 |
| - | |
840 |
| - | |
841 |
| - | |
842 |
| - | |
843 |
| - | |
844 |
| - | |
845 |
| - | |
846 |
| - | |
847 |
| - | |
848 |
| - | |
849 |
| - | |
850 |
| - | |
851 |
| - | |
852 |
| - | |
853 |
| - | |
854 |
| - | |
855 |
| - | |
856 |
| - | |
857 |
| - | |
858 |
| - | |
859 |
| - | |
860 |
| - | |
861 |
| - | |
862 |
| - | |
863 |
| - | |
864 |
| - | |
865 |
| - | |
866 |
| - | |
867 |
| - | |
868 |
| - | |
869 |
| - | |
870 |
| - | |
871 |
| - | |
872 |
| - | |
873 |
| - | |
874 |
| - | |
875 |
| - | |
876 |
| - | |
877 |
| - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
878 | 838 |
| |
879 | 839 |
| |
880 | 840 |
| |
881 | 841 |
| |
882 | 842 |
| |
883 | 843 |
| |
884 | 844 |
| |
885 |
| - | |
886 |
| - | |
887 |
| - | |
888 |
| - | |
889 |
| - | |
| 845 | + | |
890 | 846 |
| |
891 | 847 |
| |
892 | 848 |
| |
|
0 commit comments
Comments
(0)