Re: Exit walsender before confirming remote flush in logical replication
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-12-28T03:56:29Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add wal_sender_shutdown_timeout GUC to limit shutdown wait for replication
- a8f45dee9176 19 (unreleased) landed
-
pg_upgrade: Add --copy option
- 746915c68669 16.0 cited
-
Prevent possibility of panics during shutdown checkpoint.
- c6c333436491 10.0 cited
-
Support clean switchover.
- 985bd7d49726 9.4.0 cited
On Wed, Dec 28, 2022 at 8:19 AM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote: > > > In logical replication, it can happen today as well without > > time-delayed replication. Basically, say apply worker is waiting to > > acquire some lock that is already acquired by some backend then it > > will have the same behavior. I have not verified this, so you may want > > to check it once. > > Right, I could reproduce the scenario with following steps. > > 1. Construct pub -> sub logical replication system with streaming = off. > 2. Define a table on both nodes. > > ``` > CREATE TABLE tbl (id int PRIMARY KEY); > ``` > > 3. Execute concurrent transactions. > > Tx-1 (on subscriber) > BEGIN; > INSERT INTO tbl SELECT i FROM generate_series(1, 5000) s(i); > > Tx-2 (on publisher) > INSERT INTO tbl SELECT i FROM generate_series(1, 5000) s(i); > > 4. Try to shutdown publisher but it will be failed. > > ``` > $ pg_ctl stop -D publisher > waiting for server to shut down............................................................... failed > pg_ctl: server does not shut down > ``` Thanks for the verification. BTW, do you think we should document this either with time-delayed replication or otherwise unless this is already documented? Another thing we can investigate here why do we need to ensure that there is no pending send before shutdown. -- With Regards, Amit Kapila.