• Heikki Linnakangas's avatar
    Change how first WAL segment on new timeline after promotion is created. · ba94518a
    Heikki Linnakangas authored
    Two changes:
    
    1. When copying a WAL segment from old timeline to create the first segment
    on the new timeline, only copy up to the point where the timeline switch
    happens, and zero-fill the rest. This avoids corner cases where we might
    think that the copied WAL from the previous timeline belong to the new
    timeline.
    
    2. If the timeline switch happens at a segment boundary, don't copy the
    whole old segment to the new timeline. It's pointless, because it's 100%
    identical to the old segment.
    ba94518a
xlog.c 334 KB