On Mon, May 15, 2023 at 03:03:48PM +0300, Karina Litskevich wrote:
> пн, 1 мая 2023 г. в 10:33, Michael Paquier <michael@paquier.xyz>:
> Recovery replays all the WAL records until the last one present. If the server
> was stopped immediately, there could be some records, that represent operations
> of the transaction, which commit or abort record wasn't flushed at the moment
> of the stop.
Yes, that's kind of the key point I was missing when looking first at
this thread: under a DDL that's run in a self-transaction, if we have
the files but not the records able to delete them, then boom.
> As I see now, the problem of operations on files is more than just about this
> particular case. So my fix is not the right solution, and we should rather
> consider Kyotaro's patch.
Yes, right. Orphan files are a much larger problem, and the unlogged
case is one symptom behind a much larger thing, in look for a solution
that requires, as far as I can see from the discussions, something
much more invasive than what would be acceptable for a backpatch.
--
Michael