On 31/08/2024 19:09, Kyotaro Horiguchi wrote:
Subject: [PATCH v34 03/16] Remove function for retaining files on outer
transaction aborts
The function RelationPreserveStorage() was initially created to keep
storage files committed in a subtransaction on the abort of outer
transactions. It was introduced by commit b9b8831ad6 in 2010, but no
use case for this behavior has emerged since then. If we move the
at-commit removal feature of storage files from pendingDeletes to the
UNDO log system, the UNDO system would need to accept the cancellation
of already logged entries, which makes the system overly complex with
no benefit. Therefore, remove the feature.
I don't think that's quite right. I don't think this was meant for
subtransaction aborts, but to make sure that if the top-transaction
aborts after AtEOXact_RelationMap() has already been called, we don't
remove the new relation. AtEOXact_RelationMap() is called very late in
the commit process to keep the window as small as possible, but if it
nevertheless happens, the consequences are pretty bad if you remove a
relation file that is in fact needed.
--
Heikki Linnakangas
Neon (https://neon.tech)