Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7rut-007BEL-Df for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Nov 2023 06:49:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r7rus-002wfT-2g for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Nov 2023 06:49:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7rur-002wfK-Oz for pgsql-hackers@lists.postgresql.org; Tue, 28 Nov 2023 06:49:53 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r7rup-007j7J-3j for pgsql-hackers@postgresql.org; Tue, 28 Nov 2023 06:49:52 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40b30308c67so37753385e9.0 for ; Mon, 27 Nov 2023 22:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701154190; x=1701758990; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=aTm+V7DIExxMtj3gNDwTeGGNVOn6w+lDOf4hsqGdaLQ=; b=PiR0mjlRRfMYFGVIM1HYVUjJVlKYEaHFe1raqmasqHaea/DQispgZjXfarWSu2EC3t 25dKFakakEP6A7pUaTnwD18AHFLnJd4eYm8fwES8LRUjs8S7SXd3X+PE8T1JZDouWvfY dkraSU5Icb6uF3T27C8Lufb+ERh7/VvXC3RsrjuwfGrK8gYiNa4i8wtDiSHrA7O8Rq3E kycyzqiSM7/JMdszvMbByKq6IuWSChEVbeAblCBtrgQTEpt6jv1sbwjZ66Cop11X8xSc iZ8paqg9SYOLKGcBqWpZuLs9woG6t72V61+jpXlzYSuHCGRWsQ+0zn2GXq5pLLFKcsxV JgFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701154190; x=1701758990; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aTm+V7DIExxMtj3gNDwTeGGNVOn6w+lDOf4hsqGdaLQ=; b=bTgpJG6iqwxZvi0N+c10UwhtZ45KU7m5s6hkk4gKp0yqAcOTJpMF6QrqhYYhxRNOb9 YyOdv9toSa1Ef54qDKa0PmPQBWfYSIEzTBUreLFeolmItV87KRfkwci6vSVk84YhCMPZ fhTdy6FZKSCsbRN8NR8R99APXGJfMpTmEeEXgPLH0NZgGex/ELxO0zFOfU5vl/3Tl6Os hLngvxSuzllQtmSp0ah1LjNTkeCHwnjtzAegtROfLJGYw/8+GYIKGFsF8S1wChm74ctD /cqQcsVYK0aPVwqlPSD47ivpqPULlobsvwePLhYL81VoVdjg5Ej4b1iTO62Ijp/MUVTa +sqw== X-Gm-Message-State: AOJu0YyT+6ppQM05RT+QtUH2SbkPsAtyROg7/yC80DAlDrCV7k8khttm Et7+tmL6/wHmnYoxewKbyN8= X-Google-Smtp-Source: AGHT+IGyMyCGZfnSqjoA+crLCzc7QbWZcE3KcL4RacuLP6dkQGAoCWfsPi+bgxF4SYxOhCUjkXd8sA== X-Received: by 2002:a05:600c:4ed2:b0:40b:4da2:d292 with SMTP id g18-20020a05600c4ed200b0040b4da2d292mr360069wmq.8.1701154189491; Mon, 27 Nov 2023 22:49:49 -0800 (PST) Received: from ?IPV6:2a01:cb11:192:7000:5d1:c112:938:fccd? ([2a01:cb11:192:7000:5d1:c112:938:fccd]) by smtp.gmail.com with ESMTPSA id h8-20020a05600c314800b0040b3937833dsm14092345wmo.3.2023.11.27.22.49.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Nov 2023 22:49:49 -0800 (PST) Message-ID: Date: Tue, 28 Nov 2023 07:49:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Synchronizing slots from primary to standby Content-Language: en-US To: shveta malik , Amit Kapila Cc: "Zhijie Hou (Fujitsu)" , Peter Smith , "Hayato Kuroda (Fujitsu)" , Bharath Rupireddy , Peter Eisentraut , Bruce Momjian , Ashutosh Sharma , Andres Freund , pgsql-hackers , Ajin Cherian , Alvaro Herrera References: <46070646-9e09-4566-8a62-ae31a12a510c@gmail.com> <65326908-f1ef-40ce-acc6-414801c30946@gmail.com> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 11/28/23 4:13 AM, shveta malik wrote: > On Mon, Nov 27, 2023 at 4:08 PM Amit Kapila wrote: >> >> On Mon, Nov 27, 2023 at 2:27 PM Zhijie Hou (Fujitsu) >> wrote: >>> >>> Here is the updated version(v39_2) which include all the changes made in 0002. >>> Please use for review, and sorry for the confusion. >>> >> >> --- a/src/backend/replication/logical/launcher.c >> +++ b/src/backend/replication/logical/launcher.c >> @@ -8,20 +8,27 @@ >> * src/backend/replication/logical/launcher.c >> * >> * NOTES >> - * This module contains the logical replication worker launcher which >> - * uses the background worker infrastructure to start the logical >> - * replication workers for every enabled subscription. >> + * This module contains the replication worker launcher which >> + * uses the background worker infrastructure to: >> + * a) start the logical replication workers for every enabled subscription >> + * when not in standby_mode. >> + * b) start the slot sync worker for logical failover slots synchronization >> + * from the primary server when in standby_mode. >> >> I was wondering do we really need a launcher on standby to invoke >> sync-slot worker. If so, why? I guess it may be required for previous >> versions where we were managing work for multiple slot-sync workers >> which is also questionable in the sense of whether launcher is the >> right candidate for the same but now with the single slot-sync worker, >> it doesn't seem worth having it. What do you think? >> >> -- > > Yes, earlier a manager process was needed to manage multiple slot-sync > workers and distribute load among them, but now that does not seem > necessary. I gave it a try (PoC) and it seems to work well. If there > are no objections to this approach, I can share the patch soon. > +1 on this new approach, thanks! Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com