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 1qZUvK-005c4m-QR for pgsql-admin@arkaria.postgresql.org; Fri, 25 Aug 2023 11:24:18 +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 1qZUvJ-002NBi-NP for pgsql-admin@arkaria.postgresql.org; Fri, 25 Aug 2023 11:24:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZUvJ-002NAx-B1 for pgsql-admin@lists.postgresql.org; Fri, 25 Aug 2023 11:24:17 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZUvG-000xdb-7D for pgsql-admin@lists.postgresql.org; Fri, 25 Aug 2023 11:24:16 +0000 Received: from [192.168.0.150] ([217.250.40.237]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mqal4-1pvoaa2onQ-00meHS; Fri, 25 Aug 2023 13:24:12 +0200 Message-ID: Date: Fri, 25 Aug 2023 13:24:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: Temporary disabling a replica in a Patroni cluster To: vas@sibptus.ru, pgsql-admin@lists.postgresql.org References: Content-Language: de-DE From: "Georg H." In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:ka6nBXGlNGOWNGDQL0Vy3DP2NfrcyEHWY1o1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1kae9fhphqtPvFYRm6g/WGKFnYufUe6JKdf9UsO/owIeLiYOyBkTQc1HlKSIZxhYjm AzlVuTxul3mzZUg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Victor, Am 25.08.2023 um 13:18 schrieb Victor Sudakov: > Dear Colleagues, > > Do you perchance know what is the correct procedure of temporarily > taking down a replica in a Patroni cluster, e.g. for 5-10 minutes of > hardware maintenance? > > The problem is that after stopping the patroni process (service) on a > replica, patroni removes the corresponding physical replication slot > from the leader, and unless the wal_keep_size value is unsanely high, > the replica, when up again, cannot restart streaming because the WAL > segments are already gone from the leader. > > Well, you all know: > <%%%>LOG: started streaming WAL from primary at B4A0/E2000000 on timeline 8 > <%%%>FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000080000B4A0000000E2 has already been removed > <%%%>LOG: waiting for WAL to become available at B4A0/E2002000 > > Do you think there is a way to tell Patroni that a replica is down > temporarily and its replication slot should not be removed? > > Or, what am I missing? you may use patronictl pause + resume keep in mind to set wal_keep_size (or wal_keep_segments depending on your PG version high enough) regards Georg