Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: sawada.mshk@gmail.com
Cc: bdrouvot@amazon.com, pgsql-hackers@lists.postgresql.org,
minsoo@amazon.com
Date: 2021-10-08T07:50:55Z
Lists: pgsql-hackers
Attachments
- (unnamed) (text/plain)
At Thu, 7 Oct 2021 13:20:14 +0900, Masahiko Sawada <sawada.mshk@gmail.com> wrote in > Another idea to fix this problem would be that before calling > SnapBuildCommitTxn() we create transaction entries in ReorderBuffer > for (sub)transactions whose COMMIT record has XACT_XINFO_HAS_INVALS, > and then mark all of them as catalog-changed by calling > ReorderBufferXidSetCatalogChanges(). I've attached a PoC patch for > this idea. What the patch does is essentially the same as what the > proposed patch does. But the patch doesn't modify the > SnapBuildCommitTxn(). And we remember the list of last running > transactions in reorder buffer and the list is periodically purged > during decoding RUNNING_XACTS records, eventually making it empty. I came up with the third way. SnapBuildCommitTxn already properly handles the case where a ReorderBufferTXN with RBTXN_HAS_CATALOG_CHANGES. So this issue can be resolved by create such ReorderBufferTXNs in SnapBuildProcessRunningXacts. One problem with this is that change creates the case where multiple ReorderBufferTXNs share the same first_lsn. I haven't come up with a clean idea to avoid relaxing the restriction of AssertTXNLsnOrder.. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Fix the incorrect assertion introduced in commit 7f13ac8123.
- d2169c998553 16.0 landed
-
Fix catalog lookup with the wrong snapshot during logical decoding.
- 7f13ac812313 16.0 landed
- 272248a0c1b1 15.0 landed
- 68dcce247f1a 14.6 landed
- 547b963683e3 13.9 landed
- 794460783125 12.13 landed
- e721123b7a0c 11.18 landed
- bf0718c137c4 10.23 landed
-
Clean up assorted failures under clang's -fsanitize=undefined checks.
- 46ab07ffda9d 15.0 cited