RE: Disabled logical replication origin session causes primary key errors
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'vignesh C' <vignesh21@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Shawn McCoy <shawn.the.mccoy@gmail.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>, "drewwcallahan@gmail.com" <drewwcallahan@gmail.com>, "scott@meads.us" <scott@meads.us>
Date: 2025-04-22T11:00:51Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix an oversight in 3f28b2fcac.
- 0e091ce409e0 18.0 landed
- 05676d87e2e6 17.5 landed
- 0de091a4b585 16.9 landed
-
Don't advance origin during apply failure.
- 3f28b2fcac33 18.0 cited
Attachments
- v5-PG16-PG17-0001-Fix-oversight-3f28b2f.patch (application/octet-stream) patch v5-0001
- v5-HEAD-0001-Fix-oversight-3f28b2f.patch (application/octet-stream) patch v5-0001
Dear Vignesh,
> Couple of minor suggestions in the test:
> 1) I felt this is not required for this test as it has been verified many times:
> +
> +# Insert tuples and confirms replication works well
> +$node_publisher->safe_psql('postgres', "INSERT INTO t1 VALUES (1);");
> +
> +$node_publisher->wait_for_catchup('regress_sub');
I added it to ensure remote_lsn to the valid value, but yes it is not mandatory.
> 2) How about we change:
> +# Confirms the origin can be advanced
> +ok( $node_subscriber->poll_query_until(
> + 'postgres',
> + "SELECT remote_lsn > '$remote_lsn' FROM
> pg_catalog.pg_replication_origin_status os, pg_catalog.pg_subscription
> s WHERE os.external_id = 'pg_' || s.oid AND s.subname =
> 'regress_sub'",
> + 't')
> + or die "Timed out while waiting for replication origin to be
> updated");
>
> to:
> $node_publisher->wait_for_catchup('regress_sub');
>
> # Confirms the origin can be advanced
> $result = $node_subscriber->safe_psql('postgres',
> "SELECT remote_lsn > '$remote_lsn' FROM
> pg_catalog.pg_replication_origin_status os, pg_catalog.pg_subscription
> s WHERE os.external_id = 'pg_' || s.oid AND s.subname = 'regress_sub'"
> );
> is($result, 't',
> 'remote_lsn has advanced for apply worker raising an exception');
>
> In that way, we need not wait on poll_query_until.
I intentionally used poll_query_until(), but I have no strong opinions.
Modified.
PSA new patches.
Best regards,
Hayato Kuroda
FUJITSU LIMITED