File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
backend/replication/logical Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ int max_logical_replication_workers = 4;
5151int max_sync_workers_per_subscription = 2 ;
5252int max_parallel_apply_workers_per_subscription = 2 ;
5353
54+ bool disable_logical_replication_subscribers = false; /* NEON: GUC is defined in neon extension */
55+
5456LogicalRepWorker * MyLogicalRepWorker = NULL ;
5557
5658typedef struct LogicalRepCtxStruct
@@ -343,6 +345,15 @@ logicalrep_worker_launch(LogicalRepWorkerType wtype,
343345 (errcode (ERRCODE_CONFIGURATION_LIMIT_EXCEEDED ),
344346 errmsg ("cannot start logical replication workers when \"max_active_replication_origins\" is 0" )));
345347
348+ /* NEON GUC that allows to control logical replication without postgres restart */
349+ if (disable_logical_replication_subscribers )
350+ {
351+ ereport (WARNING ,
352+ (errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
353+ errmsg ("cannot start logical replication workers when disable_logical_replication_subscribers=true" )));
354+ return false;
355+ }
356+
346357 /*
347358 * We need to do the modification of the shared memory under lock so that
348359 * we have consistent view.
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ extern PGDLLIMPORT int max_logical_replication_workers;
1616extern PGDLLIMPORT int max_sync_workers_per_subscription ;
1717extern PGDLLIMPORT int max_parallel_apply_workers_per_subscription ;
1818
19+ extern PGDLLIMPORT bool disable_logical_replication_subscribers ;
20+
1921extern void ApplyLauncherRegister (void );
2022extern void ApplyLauncherMain (Datum main_arg );
2123
You can’t perform that action at this time.
0 commit comments