• Alvaro Herrera's avatar
    Fix commit timestamp initialization · 69e7235c
    Alvaro Herrera authored
    This module needs explicit initialization in order to replay WAL records
    in recovery, but we had broken this recently following changes to make
    other (stranger) scenarios work correctly.  To fix, rework the
    initialization sequence so that it always takes place before WAL replay
    commences for both master and standby.
    
    I could have gone for a more localized fix that just added a "startup"
    call for the master server, but it seemed better to restructure the
    existing callers as well so that the whole thing made more sense.  As a
    drawback, there is more control logic in xlog.c now than previously, but
    doing otherwise meant passing down the ControlFile flag, which seemed
    uglier as a whole.
    
    This also meant adding a check to not re-execute ActivateCommitTs if it
    had already been called.
    
    Reported by Fujii Masao.
    
    Backpatch to 9.5.
    69e7235c
xlog.c 358 KB