Simon Riggs wrote:
  * btree VACUUM code - must scan every block of index (v6)

Need to unlock them too.

--- a/src/backend/access/nbtree/nbtxlog.c
+++ b/src/backend/access/nbtree/nbtxlog.c
@@ -472,7 +472,7 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record)
        xlrec = (xl_btree_vacuum *) XLogRecGetData(record);

        /*
-        * We need to ensure everyy block is unpinned between the
+        * We need to ensure every block is pinned between the
         * lastBlockVacuumed and the current block, if there are any.
         * This ensures that every block in the index is touched during
         * VACUUM as required to ensure scans work correctly.
@@ -482,7 +482,11 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record)
                BlockNumber blkno = xlrec->lastBlockVacuumed + 1;

                for (; blkno < xlrec->block; blkno++)
+               {
buffer = XLogReadBufferForCleanup(xlrec->node, blkno, false);
+                       if (BufferIsValid(buffer))
+                               UnlockReleaseBuffer(buffer);
+               }
        }

        /*

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to