]> granicus.if.org Git - postgresql/commitdiff
After PageSetAllVisible, use MarkBufferDirty.
authorRobert Haas <rhaas@postgresql.org>
Wed, 18 Apr 2012 14:49:37 +0000 (10:49 -0400)
committerRobert Haas <rhaas@postgresql.org>
Wed, 18 Apr 2012 14:49:37 +0000 (10:49 -0400)
Previously, we used SetBufferCommitInfoNeedsSave, but that's really
intended for dirty-marks we can theoretically afford to lose, such as
hint bits.  As for 9.2, the PD_ALL_VISIBLE mustn't be lost in this
way, since we could then end up with a heap page that isn't
all-visible and a visibility map page that is all visible, causing
index-only scans to return wrong answers.

src/backend/commands/vacuumlazy.c

index 0a617e34b634658f5df0d10a82a78374c62f7c09..d2cfcc024c1ae801075b4b5bc27139c05fe58ca7 100644 (file)
@@ -603,7 +603,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
                        if (!PageIsAllVisible(page))
                        {
                                PageSetAllVisible(page);
-                               SetBufferCommitInfoNeedsSave(buf);
+                               MarkBufferDirty(buf);
                        }
 
                        LockBuffer(buf, BUFFER_LOCK_UNLOCK);
@@ -838,7 +838,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
                if (!PageIsAllVisible(page) && all_visible)
                {
                        PageSetAllVisible(page);
-                       SetBufferCommitInfoNeedsSave(buf);
+                       MarkBufferDirty(buf);
                }
 
                /*