• Robert Haas's avatar
    In clog_redo(), don't set XactCtl->shared->latest_page_number. · 0fcc2dec
    Robert Haas authored
    The comment is no longer accurate, and hasn't been entirely accurate
    since Hot Standby was introduced. The original idea here was that
    StartupCLOG() wouldn't be called until the end of recovery and
    therefore this value would be uninitialized when this code is reached,
    but Hot Standby made that true only when hot_standby=off, and commit
    1f113abd means that this value is now
    always initialized before replay even starts.
    
    The original purpose of this code was to bypass the sanity check
    in SimpleLruTruncate(), which will no longer occur: now, if something
    is wrong, that sanity check might trip during recovery. That's
    probably a good thing, because in the current code base
    latest_page_number should always be initialized and therefore we
    expect that the sanity check should pass. If it doesn't, something
    has gone wrong, and complaining about it is appropriate.
    
    Patch by me, reviewed by Heikki Linnakangas.
    
    Discussion: http://postgr.es/m/CA+TgmoZYig9+AQodhF5sRXuKkJ=RgFDugLr3XX_dz_F-p=TwTg@mail.gmail.com
    0fcc2dec
clog.c 33.1 KB