RE: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Takamichi Osumi (Fujitsu) <osumi.takamichi@fujitsu.com>
From: "osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>
To: 'Masahiko Sawada' <sawada.mshk@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, "Drouvot, Bertrand" <bdrouvot@amazon.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, "Oh, Mike" <minsoo@amazon.com>
Date: 2022-07-15T13:43:14Z
Lists: pgsql-hackers
On Thursday, July 14, 2022 10:31 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> I've attached an updated patch that incorporated comments from Amit and Shi.
Hi,
Minor comments for v4.
(1) typo in the commit message
"When decoding a COMMIT record, we check both the list and the ReorderBuffer to see if
if the transaction has modified catalogs."
There are two 'if's in succession in the last sentence of the second paragraph.
(2) The header comment for the spec test
+# Test that decoding only the commit record of the transaction that have
+# catalog-changed.
Rewording of this part looks required, because "test that ... " requires a complete sentence
after that, right ?
(3) SnapBuildRestore
snapshot_not_interesting:
if (ondisk.builder.committed.xip != NULL)
pfree(ondisk.builder.committed.xip);
return false;
}
Do we need to add pfree for ondisk.builder.catchange.xip after the 'snapshot_not_interesting' label ?
(4) SnapBuildPurgeOlderTxn
+ elog(DEBUG3, "purged catalog modifying transactions from %d to %d",
+ (uint32) builder->catchange.xcnt, surviving_xids);
To make this part more aligned with existing codes,
probably we can have a look at another elog for debug in the same function.
We should use %u for casted xcnt & surviving_xids,
while adding a format for xmin if necessary ?
Best Regards,
Takamichi Osumi
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