Skip to content

Commit f71fa98

Browse files
committed
Avoid unexpected shutdown when sync_replication_slots is enabled.
Previously, enabling sync_replication_slots while wal_level was not set to logical could cause the server to shut down. This was because the postmaster performed a configuration check before launching the slot synchronization worker and raised an ERROR if the settings were incompatible. Since ERROR is treated as FATAL in the postmaster, this resulted in the entire server shutting down unexpectedly. This commit changes the postmaster to log that message with a LOG-level instead of raising an ERROR, allowing the server to continue running even with the misconfiguration. Back-patch to v17, where slot synchronization was introduced. Reported-by: Hugo DUBOIS <hdubois@scaleway.com> Author: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Hugo DUBOIS <hdubois@scaleway.com> Reviewed-by: Shveta Malik <shveta.malik@gmail.com> Discussion: https://postgr.es/m/CAH0PTU_pc3oHi__XESF9ZigCyzai1Mo3LsOdFyQA4aUDkm01RA@mail.gmail.com Backpatch-through: 17
1 parent a9b4b06 commit f71fa98

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/replication/logical/slotsync.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,14 +1040,14 @@ ValidateSlotSyncParams(int elevel)
10401040
{
10411041
/*
10421042
* Logical slot sync/creation requires wal_level >= logical.
1043-
*
1044-
* Since altering the wal_level requires a server restart, so error out in
1045-
* this case regardless of elevel provided by caller.
10461043
*/
10471044
if (wal_level < WAL_LEVEL_LOGICAL)
1048-
ereport(ERROR,
1045+
{
1046+
ereport(elevel,
10491047
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
10501048
errmsg("replication slot synchronization requires \"wal_level\" >= \"logical\""));
1049+
return false;
1050+
}
10511051

10521052
/*
10531053
* A physical replication slot(primary_slot_name) is required on the

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy