You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Replace the stopgap fix I made in0e758ae with a cleaner one.The real problem with4ab5dae is that it contorted this function'slogic substantially, by introducing a third code path that requireddifferent behavior in the function's main loop. That seems quiteunnecessary on closer inspection: the new IsBinaryUpgrade case canjust share the behavior of the other immediate-unlink cases. Hence,revert4ab5dae and most of0e758ae (keeping the latter'ssave/restore errno fix), and add IsBinaryUpgrade to the set ofconditions tested to choose immediate unlink.Also fix some additional places with sloppy handling of errno,to ensure we have an invariant that we always continue processingafter any non-ENOENT failure of do_truncate. I doubt that that'sfixing any bug of field importance, so I don't feel it necessary toback-patch; but we might as well get it right while we're here.Also improve the comments, which had drifted a bit from what thecode actually does, and neglected to mention some importantconsiderations.Back-patch to v15, not because this is fixing any bug but becauseit doesn't seem like a good idea for v15's mdunlinkfork logic to besignificantly different from both v14 and v16.Discussion:https://postgr.es/m/3797575.1667924888@sss.pgh.pa.us