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 1qZUq2-005bhz-QN for pgsql-admin@arkaria.postgresql.org; Fri, 25 Aug 2023 11:18:51 +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 1qZUq1-002DY5-Bq for pgsql-admin@arkaria.postgresql.org; Fri, 25 Aug 2023 11:18:49 +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 1qZUq0-002DXv-Ug for pgsql-admin@lists.postgresql.org; Fri, 25 Aug 2023 11:18:48 +0000 Received: from admin.sibptus.ru ([2001:19f0:5001:21dc::10]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZUpw-000xZL-IT for pgsql-admin@lists.postgresql.org; Fri, 25 Aug 2023 11:18:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=Message-ID:Subject:To:From:Date:In-Reply-To; bh=KR3Fyqx/u1HbCiX5oETATt7KNX4Dsp0JAmHVowwbDeM=; b=VIv2KK7Z7TOFaLkIh8eIzbHRkM W7OQvU+vl8G8HnQAs0liAobqGdO0sKxge+Vg7YQmNGEyniC+SjjEHTOMVjBAmqFJje7UbBygx32q4 +ETjtFBUtv7Kdj1kQaE7ruGS6smP+SZXAwSOY1OrTTqzNQof7XDXTcnPeWnZu5CvCVF4=; Received: from vas by admin.sibptus.ru with local (Exim 4.95 (FreeBSD)) (envelope-from ) id 1qZUpu-000EQa-LZ for pgsql-admin@lists.postgresql.org; Fri, 25 Aug 2023 11:18:42 +0000 Date: Fri, 25 Aug 2023 11:18:42 +0000 From: Victor Sudakov To: pgsql-admin@lists.postgresql.org Subject: Temporary disabling a replica in a Patroni cluster Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-PGP-Key: http://admin.sibptus.ru/~vas/ X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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? -- Victor Sudakov VAS4-RIPE http://vas.tomsk.ru/ 2:5005/49@fidonet