| From: | Andrey Silitskiy <a(dot)silitskiy(at)postgrespro(dot)ru> |
|---|---|
| To: | Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
| Cc: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "Takamichi Osumi (Fujitsu)" <osumi(dot)takamichi(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "sawada(dot)mshk(at)gmail(dot)com" <sawada(dot)mshk(at)gmail(dot)com>, "michael(at)paquier(dot)xyz" <michael(at)paquier(dot)xyz>, "peter(dot)eisentraut(at)enterprisedb(dot)com" <peter(dot)eisentraut(at)enterprisedb(dot)com>, "dilipbalaut(at)gmail(dot)com" <dilipbalaut(at)gmail(dot)com>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "amit(dot)kapila16(at)gmail(dot)com" <amit(dot)kapila16(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
| Subject: | Re: Exit walsender before confirming remote flush in logical replication |
| Date: | 2026-01-21 15:11:47 |
| Message-ID: | d062db6a-8040-41eb-b3c9-32c3af30ef2b@postgrespro.ru |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Dear Vitaliy,
Thanks for reproducing the error.
The problem occurred during a test case with a full output buffer after
adding ereport about the termination of walsender process in immediate mode.
ereport sends message by default if replica is interested in this logging
level(WARNING level fit this description). And since the output buffer was
already full, the message could not be sent and the process could not exit.
Changed the logging level to LOG_SERVER_ONLY to exclude sending a message
to the replica during immediate shutdown.
In my environment, this error was not reproduced due to the fact that
buffers did not have time to fill up because pg_ctl stop was called
immediately after data was inserted and the buffers did not have time to
fill up and ereport did not hang.
I added a wait for sent_lsn from pg_stat_replication to stop advancing
in the test before server shutdown to give walsender time to fill output
buffers.
Regards,
Andrey Silitskiy
| Attachment | Content-Type | Size |
|---|---|---|
| v4-0001-Introduce-a-new-GUC-wal_sender_shutdown_mode.patch | text/x-patch | 14.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zsolt Parragi | 2026-01-21 15:22:54 | Re: CREATE TABLE LIKE INCLUDING POLICIES |
| Previous Message | Bertrand Drouvot | 2026-01-21 14:56:37 | Re: Fix accidentally cast away qualifiers |