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 1jfVTX-00081p-VV for pgsql-general@arkaria.postgresql.org; Sun, 31 May 2020 21:26:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jfVTW-0005Jk-Lp for pgsql-general@arkaria.postgresql.org; Sun, 31 May 2020 21:26:34 +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 1jfVTW-0005Jd-E1 for pgsql-general@lists.postgresql.org; Sun, 31 May 2020 21:26:34 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfVTT-0003oN-Uz for pgsql-general@postgresql.org; Sun, 31 May 2020 21:26:33 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 78D35316; Sun, 31 May 2020 17:26:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 31 May 2020 17:26:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=R K19d32RkPgCSZIkBppnV8wp/raT5rbusTgQ1fvC4zc=; b=d6Q18g88pFAg7H0PS 1qf9s+amLj754KRA1ZjPCH7ET9TZA0oMiXKkI1K8NUKRZRMGyXuThhFlgLozdg5M mmK7KSbLO8kNCnHkbRTsvROdPwxDNrnEbsfvyCOLhu3T7Gb/+qepoaqoT2WuK+GU rVOURzvVljGIHSiNXakUfxixFV5omeAJR9ym1afd5SspVluiDNY01yKTzGmoZmBM TB02mH1cVT64lkZLsWaJymh+0I/NfHvvnhRp5tsqqTgpt+H5I/LapEzSpB6VvsdW Txb0OL3qfnedq/98qGbq6CsxfSrxj3q3YNkE6/23YvdJ2Uhn+Bd24v1ig+rSAIkx RjaNA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=RK19d32RkPgCSZIkBppnV8wp/raT5rbusTgQ1fvC4 zc=; b=jZpPSs5VH9fq/kFYKwGHAK8BPAJxjhrb6wVBFimyrRr/o3q5ufMWLlAef BNIpdoSmyMsp72mU5M+3LHItXptXtr/gsLB59CevxWsVFjZFunLsE50gYF513m9K /Av0q9thMO1tdOkMmNvDzIILpB2DZWDdaMEEoDILmFTt0UK1JPIA6fgWgAmF5JjH 4J5b4S/LfE25yR9WGZLqvkvY3CRNnw0UgrD5Glo2LyuTiWqUJsultQq4sYak6r7u dII7t6eX9YcZ4fVXYug6AkLQCPJd1+0xomNVKbgUWhZSweMinbPPeWnO/WhKkAE7 dM/W4UUPPSfk14k8CPhdl3tbIhS4A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeffedgudehlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefhhenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeelvdegfe euueffleegvdfgueekvefgkeeiffdvhffhtdejudffvefggeefudeugfenucffohhmrghi nhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejhedrudejvddrhedrvdefudenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 2CA49328005D; Sun, 31 May 2020 17:26:29 -0400 (EDT) Subject: Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated To: Andrus , pgsql-general References: <26EC9619620649D1B55C9C95811E4ADB@dell2> <16e57e3f-5c26-fd55-d42a-f030c8550952@aklaver.com> <102C5FA16F1549659B393B6A824B561F@dell2> From: Adrian Klaver Message-ID: <698dbad1-e3b2-f13a-8e97-8ce01efed516@aklaver.com> Date: Sun, 31 May 2020 14:26:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <102C5FA16F1549659B393B6A824B561F@dell2> Content-Type: text/plain; charset=windows-1257; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/31/20 2:03 PM, Andrus wrote: > Hi! > >> I'm guessing are looking for: >> https://www.postgresql.org/docs/12/runtime-config-replication.html >> 26.2.6. Replication Slots >> Replication slots provide an automated way to ensure that the master >> does not remove WAL segments until they have been received by all >> standbys, and that the master does not remove rows which could cause a >> recovery conflict even when the standby is disconnected. > > Using replication slot can cause pg_wal directoy to occupy all free disk > space and after that server stop respondig. > >> This is spelled out here: >> https://www.postgresql.org/docs/12/warm-standby.html#STREAMING-REPLICATION >> >> "If you use streaming replication without file-based continuous >> archiving, the server might recycle old WAL segments before the >> standby has received them. If this occurs, the standby will need to be >> reinitialized from a new base backup. You can avoid this by setting >> wal_keep_segments to a value large enough to ensure that WAL segments >> are not recycled too early, or by configuring a replication slot for >> the standby. > > Will wal_keep_segments  keep segments also if named replication slot is > lot used ? In addition to my most recent questions: What are you trying to achieve? In other words why do a pg_basebackup if you have a standby receiving WALs? > > Andrus. -- Adrian Klaver adrian.klaver@aklaver.com