Hi all, A while back I posted a patch[1] to change the order of resowner cleanup so that DSM handles are released last. That's useful for the error cleanup path on Windows, when a SharedFileSet is cleaned up (a mechanism that's used by parallel CREATE INDEX and parallel hash join, for spilling files to disk under a temporary directory, with automatic cleanup). Previously we believed that it was OK to unlink things that other processes might have currently open as long as you use the FILE_SHARE_DELETE flag, but that turned out not to be the full story: you can unlink files that someone has open, but you can't unlink the directory that contains them! Hence the desire to reverse the clean-up order.
It didn't seem worth the risk of back-patching the change, because the only consequence is a confusing message that appears somewhere near the real error: LOG: could not rmdir directory "base/pgsql_tmp/pgsql_tmp5088.0.sharedfileset": Directory not empty I suppose we probably should make the change to 12 though: then owners of extensions that use DSM detach hooks (if there any such extensions) will have a bit of time to get used to the new order during the beta period. I'll need to find someone to test this with a fault injection scenario on Windows before committing it, but wanted to sound out the list for any objections to this late change? [1] https://www.postgresql.org/message-id/CAEepm%3D2ikUtjmiJ18bTnwaeUBoiYN%3DwMDSdhU1jy%3D8WzNhET-Q%40mail.gmail.com -- Thomas Munro https://enterprisedb.com