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 1fpDUV-0001cS-1m for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 14:06:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpDUS-0004ZA-QI for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 14:06:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpDUS-0004Yy-IL for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 14:06:36 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpDUC-00077l-CZ for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 14:06:36 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3300320E7B; Mon, 13 Aug 2018 10:06:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 13 Aug 2018 10:06:18 -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=k+4al/Juvh3t0jY85dHJbAW8x9XFs 8DPozWly17nXxE=; b=HaFiNWjyRFDHR36uYXlbQH9XUdYXeYG7OnUUaj/brFJwH ugyrPUYmv73GW+5nD+t1zvGBTyQX/boBGpEiW9IgkIrnOQ19Esc174jw77NV4gTa htCvKRDkCy/WXornmedCP3N4RhGKhgVovlWV5lbnxLSRds+/Ucryk4ObhVann9J4 jYMnacnOo/8reeXbtL1SoFf0lv0FooaIIj9BK2VF1y2v7t9trzDr+AoHjHydF4pp kmkKpZU/INN8wyI9AfRYZFnDig+wbINN3Q0aC3bJqxN7JTfJ4DhST6jKYinrumxs iizNe8aEkQWO+CsBNM5BZGX3t6duG91rpm6reR8Ag== 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=k+4al/ Juvh3t0jY85dHJbAW8x9XFs8DPozWly17nXxE=; b=j77a8V6tyj6A0tJ659BzEZ XYi7NzB3ELW3P0oKUgmA4BKZjakg9sX4CQA6Cao3116MlgeFq73aXHJo6KIAEnZa ZGL1bORZtV0ofAn/crTGMa91h9JWPMu1AbOJ7JXp8Ndj/IsUQ/SHyVN5CJlNJsjj 00c540g6Xztw1TO1Gle2M0/Xy5tfR3MoiQyVl14pdte5/eeDHGmB0l0Ir5mpBwFQ TYa7phNwfhZRjafXNMWVE1Y5nADsqrAHS/Sf/lbwhxg903LekxQ4c7I6sXs6fz4K ndkMKQI0JbtoJpNxs33pn8wxNly2hueIcRIrL8bIFif8fQcbVMF/hFlMoCrOykwA == 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 6128810286; Mon, 13 Aug 2018 10:06:17 -0400 (EDT) Subject: Re: Replication failure, slave requesting old segments To: Phil Endecott , pgsql-general@lists.postgresql.org References: <31ba3812-6a0a-4639-5386-e804e59bc322@aklaver.com> <1534162092902@dmwebmail.dmwebmail.chezphil.org> From: Adrian Klaver Message-ID: <07fbb899-570d-ccf2-a4ad-11d6cc295ed3@aklaver.com> Date: Mon, 13 Aug 2018 07:06:16 -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: <1534162092902@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/13/2018 05:08 AM, Phil Endecott wrote: > Adrian Klaver wrote: >> On 08/12/2018 02:56 PM, Phil Endecott wrote: >>> 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. > > Really?  I thought the intention was that the system should be > able to recover reliably when the slave reconnects after a > period of downtime, subject only to there being sufficient > network/CPU/disk bandwidth etc. for it to eventually catch up. See also my reply to Stephen earlier. Basically you are trying to coordinate two different operations. They start from the same source pg_xlog(pg_wal 10+) but arrive on a different time scale and from different locations. Without sufficient sanity checks it is possible they diverge enough on one or both paths to render the process unstable. > > If that's not true, I think the docs need an even more extensive > overhaul!  Suggestion for the paragraph that I quoted before from > 26.2.5: > > "If you set up a WAL archive that's accessible from the standby, > it's anyone's guess what is appropriate for wal_keep_segments." I would say that: "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." should be more like: "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. *This is dependent on verification that the archiving is working properly. A belt and suspenders approach would be to set wal_keep_segments to a value > 0 in the event archiving is not properly functioning*" " > > > Regards, Phil. > > > > > -- Adrian Klaver adrian.klaver@aklaver.com