• T
    Avoid crashing when we have problems unlinking files post-commit. · d0024cd1
    Tom Lane 提交于
    smgrdounlink takes care to not throw an ERROR if it fails to unlink
    something, but that caution was rendered useless by commit
    33960006, which put an smgrexists call in
    front of it; smgrexists *does* throw error if anything looks funny, such
    as getting a permissions error from trying to open the file.  If that
    happens post-commit, you get a PANIC, and what's worse the same logic
    appears in the WAL replay code, so the database even fails to restart.
    
    Restore the intended behavior by removing the smgrexists call --- it isn't
    accomplishing anything that we can't do better by adjusting mdunlink's
    ideas of whether it ought to warn about ENOENT or not.
    
    Per report from Joseph Shraibman of unrecoverable crash after trying to
    drop a table whose FSM fork had somehow gotten chmod'd to 000 permissions.
    Backpatch to 8.4, where the bogus coding was introduced.
    d0024cd1
md.c 50.5 KB