mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Add GUC option to control maximum active replication origins.
This commit introduces a new GUC option max_active_replication_origins to control the maximum number of active replication origins. Previously, this was controlled by 'max_replication_slots'. Having a separate GUC option provides better flexibility for setting up subscribers, as they may not require replication slots (for cascading replication) but always require replication origins. Author: Euler Taveira <euler@eulerto.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: vignesh C <vignesh21@gmail.com> Discussion: https://postgr.es/m/b81db436-8262-4575-b7c4-bc0c1551000b@app.fastmail.com
This commit is contained in:
		@@ -31,7 +31,7 @@
 | 
			
		||||
#include "postmaster/bgworker.h"
 | 
			
		||||
#include "postmaster/interrupt.h"
 | 
			
		||||
#include "replication/logicallauncher.h"
 | 
			
		||||
#include "replication/slot.h"
 | 
			
		||||
#include "replication/origin.h"
 | 
			
		||||
#include "replication/walreceiver.h"
 | 
			
		||||
#include "replication/worker_internal.h"
 | 
			
		||||
#include "storage/ipc.h"
 | 
			
		||||
@@ -325,10 +325,10 @@ logicalrep_worker_launch(LogicalRepWorkerType wtype,
 | 
			
		||||
							 subname)));
 | 
			
		||||
 | 
			
		||||
	/* Report this after the initial starting message for consistency. */
 | 
			
		||||
	if (max_replication_slots == 0)
 | 
			
		||||
	if (max_active_replication_origins == 0)
 | 
			
		||||
		ereport(ERROR,
 | 
			
		||||
				(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
 | 
			
		||||
				 errmsg("cannot start logical replication workers when \"max_replication_slots\"=0")));
 | 
			
		||||
				 errmsg("cannot start logical replication workers when \"max_active_replication_origins\"=0")));
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * We need to do the modification of the shared memory under lock so that
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user