Re: Latest version of Hot Standby patch

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2009-01-07T09:35:10Z
Lists: pgsql-hackers
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