• Noah Misch's avatar
    Maintain valid md.c state when FileClose() fails. · 38fc0560
    Noah Misch authored
    FileClose() failure ordinarily causes a PANIC.  Suppose the user
    disables that PANIC via data_sync_retry=on.  After mdclose() issued a
    FileClose() that failed, calls into md.c raised SIGSEGV.  This fix adds
    repalloc() calls during mdclose(); update a comment about ignoring
    repalloc() cost.  The rate of relation segment count change is a minor
    factor; more relevant to overall performance is the rate of mdclose()
    and subsequent re-opening of segments.  Back-patch to v10, where commit
    45e191e3 introduced the bug.
    
    Reviewed by Kyotaro Horiguchi.
    
    Discussion: https://postgr.es/m/20191222091930.GA1280238@rfd.leadboat.com
    38fc0560
md.c 38.6 KB