Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZPpk-0006NR-7n for pgsql-admin@arkaria.postgresql.org; Thu, 22 Apr 2021 03:16:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZPpi-0005y1-PR for pgsql-admin@arkaria.postgresql.org; Thu, 22 Apr 2021 03:16:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZPpi-0005xs-BX for pgsql-admin@lists.postgresql.org; Thu, 22 Apr 2021 03:16:50 +0000 Received: from admin.sibptus.ru ([2001:19f0:5001:21dc::10]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZPpd-0007mf-CZ for pgsql-admin@lists.postgresql.org; Thu, 22 Apr 2021 03:16:49 +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=VC5AcE6HmG8q6i/+HJpt6S604EKI7FXhazexPuKJC7E=; b=B+M8G12Gba/0VJZPSSMEebbDqU FcL9YkVWY9enWvtTgdqhHfezIjmto92dcdKn3g3OVxxlhaR78kQs8V1pPGKezVFqO/uEjxMvqP0RX O//fE/mL2d2bxO+aUXA+uSx+avPxLi5cp0S7RqjvTEBQacBK4jaF3ElkZpAAhOV2azUU=; Received: from vas by admin.sibptus.ru with local (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lZPpa-000CyZ-GN for pgsql-admin@lists.postgresql.org; Thu, 22 Apr 2021 10:16:42 +0700 Date: Thu, 22 Apr 2021 10:16:42 +0700 From: Victor Sudakov To: pgsql-admin@lists.postgresql.org Subject: A streaming replica catching up 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, After a streaming standby has been down for a time, I know of two options for it to catch up with the master: 1. The replica can fetch all the necessary WAL records via the replication protocol from the master (unless max_slot_wal_keep_size is not the default -1, all the required WAL archives should be available from the master). 2. The replica can be provided with a restore_command and will fetch all WAL files from the WAL archive before starting streaming WAL from the master. Which is the preferred way? Of course if max_slot_wal_keep_size is limited, the second options seems the only safe one. OTOH, if the master does not write to a WAL archive, only the first option is left to us. -- Victor Sudakov VAS4-RIPE http://vas.tomsk.ru/ 2:5005/49@fidonet