On Sat, Nov 1, 2008 at 10:02 PM, Simon Riggs <[EMAIL PROTECTED]> wrote:

> Hot Standby patch, including all major planned features.
>
>
While experimenting with the patch, I noticed that sometimes the archiver
process indefinitely waits for WALInsertLock. I haven't spent much time
debugging that, but the following chunk clearly seems to be buggy. The
WALInsertLock is not released if (leavingArchiveRecovery == true).

--- 6565,6592 ----
        }
    }

!   if (leavingArchiveRecovery)
!       checkPoint.redo = GetRedoLocationForArchiveCheckpoint();
!   else
    {
!       /*
!        * Compute new REDO record ptr = location of next XLOG record.
!        *
!        * NB: this is NOT necessarily where the checkpoint record itself
will be,
!        * since other backends may insert more XLOG records while we're off
doing
!        * the buffer flush work.  Those XLOG records are logically after
the
!        * checkpoint, even though physically before it.  Got that?
!        */
!       checkPoint.redo = GetRedoLocationForCheckpoint();

!       /*
!        * Now we can release WAL insert lock, allowing other xacts to
proceed
!        * while we are flushing disk buffers.
!        */
!       LWLockRelease(WALInsertLock);
    }

    /*
     * If enabled, log checkpoint start.  We postpone this until now so as
not
     * to log anything if we decided to skip the checkpoint.
     */


Thanks,
Pavan

-- 
Pavan Deolasee
EnterpriseDB     http://www.enterprisedb.com

Reply via email to