Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fp0VQ-0004H7-TU for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 00:14:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fp0VO-0004QO-TO for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 00:14:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fp0VM-0004Q1-T1 for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 00:14:42 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fp0VI-0006WE-C4 for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 00:14:39 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 763DF21B54; Sun, 12 Aug 2018 20:14:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 12 Aug 2018 20:14:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=nERH9HqYvDu3mjsFqrP7fRSccDvvu SudjW4TbJm3vbI=; b=HUX/vU+obYzGRhJ4auEuVGkwSNtxvhtlPW3iQP3c6ZpHQ JJbkbIJz+jWh4dSbnPi0/L6AgOdC4jUaK63mZuDqC1rlsjs2XjNEcINCWA9OKHOy qiZwfc87Ap2QwGE3H+D8UcgQ+2S+isdezIq1IUL2GUhbTpGXJ20yJed3jwdVyDX/ hU9DcKdxGawAbeGeIDCFMk7XiV5XT52KjvZThWCv/7Zur2bHaHCnvXXd77EODZzO cy9Gq3BjoQC2GwPRx6WsAKWh0FdpEbgGM4lwWvI8J2KcVp8RMttKJm2Q5kA2jKGy L6GlxdxJACp+ppgFiyXjVQ4isLMimFWpAgOXEvhxw== 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-sender:x-me-sender:x-sasl-enc; s=fm3; bh=nERH9H qYvDu3mjsFqrP7fRSccDvvuSudjW4TbJm3vbI=; b=WitNsRWLtRzl1uBgIYVipJ TjJGaoND821KDpfuqoRsIEr99xTdqyIEd1loRsAb2TZRFj5xWfZa3jFWlZm55Z6I F8o+UTCkHpRbkR//Y5SQtGjDhgpU5OcNGbcSRshSfzZXtKX+hYhcuTIFzX+W9qP2 QekRl1QXSh6fmEpnBSi9VWl4PAxvf2qvtt6/LV4XFtmp+m7dqXOsqhG6MibD0w8t Rxs6FXdk+Dxx3tpERD5sqRXXmgD9x6Du4RY9Ml9+L7lVws+Jh/bBb8GONjviBasS Jd2PkDSal1Whh4m9368YkAdsSGwDJ8KptX08jHW6OIbQ7+34H3JIGAG9GseN8Ccw == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 6FCEEE425A; Sun, 12 Aug 2018 20:14:33 -0400 (EDT) Subject: Re: Replication failure, slave requesting old segments To: Phil Endecott , pgsql-general@lists.postgresql.org References: <20180812212953.GU3326@tamriel.snowman.net> <1534110971810@dmwebmail.dmwebmail.chezphil.org> From: Adrian Klaver Message-ID: <31ba3812-6a0a-4639-5386-e804e59bc322@aklaver.com> Date: Sun, 12 Aug 2018 17:14:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1534110971810@dmwebmail.dmwebmail.chezphil.org> Content-Type: text/plain; charset=utf-8; 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 08/12/2018 02:56 PM, Phil Endecott wrote: > Stephen Frost wrote: > > Specifically, section 26.2.5 of the docs says: > > "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. If you set up a WAL archive > that's accessible from the standby, these solutions are not required, since > the standby can always use the archive to catch up provided it retains > enough > segments." > > OR, maybe the WAL reader that process the files that restore_command > fetches > could be smart enough to realise that it can skip over the gap at the end? > > Anyway.  Do others agree that my issue was the result of > wal_keep_segments=0 ? Only as a sub-issue of the slave losing contact with the master. The basic problem is maintaining two separate operations, archiving and streaming, in sync. If either or some combination of both lose synchronization then it is anyone's guess on what is appropriate for wal_keep_segments. > > > Regards, Phil. > > > > > > -- Adrian Klaver adrian.klaver@aklaver.com