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 1k5ImN-0007xG-HU for pgsql-admin@arkaria.postgresql.org; Tue, 11 Aug 2020 01:08:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5ImM-0003c1-Fc for pgsql-admin@arkaria.postgresql.org; Tue, 11 Aug 2020 01:08:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k5ImM-0003bu-4f for pgsql-admin@lists.postgresql.org; Tue, 11 Aug 2020 01:08:38 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k5ImF-0007rT-2G for pgsql-admin@lists.postgresql.org; Tue, 11 Aug 2020 01:08:37 +0000 Received: by mail-pl1-x62f.google.com with SMTP id x15so1254916plr.11 for ; Mon, 10 Aug 2020 18:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=aHbg7M/YRClvHw3/mCdPQcDuXmLs6kuBb2D8KYlIy8E=; b=v4HNjIRXXmlOMpGolZagSNKFf2DTixdUMTIxCWDa8ODEmdETnS8aupDToN4oVLp0NV QmyjKEREYN8nGJuVmw9hk+HsrBtrB+HDZbPeDWhMJGFQKt54mI60F7nTDakPKlSFnNZu RiAXORDB6j9cHlCSrKsoSwlkRggh0TVBd88THvSz3CBFN88Z8NNpVav/QxlOooOS0G6y 0V5y279iptHBZp9F5Ot2fAzNxkuEQXK8HTItZb3Oz1NGWGX8MYH3cSBz+EwwFiRxOkbZ 8OgWpMfENNHAQR7kMv63MUap2S5lOlisbsLQtb1F8GYc4jjY6vhM8qmi15y6q3sbPQGN 89cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aHbg7M/YRClvHw3/mCdPQcDuXmLs6kuBb2D8KYlIy8E=; b=E7L7TOyluHEF2GuzOt+highBRR1PKH8/pYjtGwqtn2DCjXgY/FHGtZ/41ZbNhIweqW gn4m0lCcG1pqsCI/7BoqNyJG4QJnhs4ItiZH6eqIWEu0JeqWnLRY9DhpAupwRuCX86hQ /C+sUJj/AQu4E5ev8nkZM3WTek0XIzOMz+9WyDzmFiuj63wqo0noL0ucqTuFVkvG4hbI IxoBvzaH6/AB+jfGe4K0VzWsTzhijI7NoHsA5RXgXttbjU/hRIpYhaeZbAKrsJApIc5V U724sbQUrbLcP74b3Knbwh/Dv/M3i9oKUrJ15gJ3Mwi0Lzj0kvQ4IbwQaQqNqD9nCDs2 zQrg== X-Gm-Message-State: AOAM531oUz5+IyPt30bBgGs+QCP/VdPMnSy0TiO5n5k21IwCD4wYbp3t 6NkMI2Q3HuXXf5oY1dASxvmkQeB+AhUTDrL7Ytnjmw5Z8xHyMGNJDJajfnad63oXqdnhUWZH5sw DcAuCg6Ju3Rmud14e0Y58FALNUth5Xd4TF/6Rjr6S/cTNFu2mhFu3igl4vv2QGIZCJREEYJ+msD og51dF8teKQVJ1WmizPw== X-Google-Smtp-Source: ABdhPJw5Om7Ylye1ONA8yuOS3yys5M1A5QisXBilHO6u1Pw99iGWXeOE4R9Bh0OO8J0rcUtA5N/ihw== X-Received: by 2002:a17:90b:1b43:: with SMTP id nv3mr2095730pjb.22.1597108107783; Mon, 10 Aug 2020 18:08:27 -0700 (PDT) Received: from osaka.octopusnet (p1382088-ipngn14901marunouchi.tokyo.ocn.ne.jp. [153.206.35.88]) by smtp.gmail.com with ESMTPSA id u15sm19246102pgm.10.2020.08.10.18.08.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Aug 2020 18:08:26 -0700 (PDT) Subject: Re: Recovery from WAL archives not advancing timeline? To: Don Seiler Cc: Ian Lawrence Barwick , Pgsql-admin References: From: Ian Barwick Message-ID: Date: Tue, 11 Aug 2020 10:08:23 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: 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 2020/08/09 0:59, Don Seiler wrote: > On Sat, Aug 8, 2020 at 10:34 AM Ian Lawrence Barwick > wrote: > > 2020年8月9日(日) 0:12 Don Seiler >: > > > > There's no attempt to look for 00000002.history that I would normally expect when a replica doing WAL restore/recovery runs of out of files to restore. > > In that case are you > a) absolutely sure recovery.conf contains "recovery_target_timeline = 'latest'"? > b) the standby was restarted *after* the change was made? > > I ask because not attempting to fetch a history file would be a sign > that "recovery_target_timeline" > is not set (or set but not to "latest"). > > > I'm 100% confident that it was set, as I did it via script that wrote the recovery.conf to all while the DBs were still shut down. The file still has: > > recovery_target_timeline = 'latest' Unfortunately it's not practical to verify what setting the server has in Pg11 and earlier. Is restarting the server an option? I'm sure I'm not the only person who's been in a situation where I'm sure I've done something and it turns out I hadn't. The code path there should definitely attempt to fetch a history file if "recovery_target_timeline = 'latest'", so it would be useful rule out the possibility that the setting simply hasn't been applied before looking into other potential causes. > Can I set that parameter to a specific timeline (eg '2')? Or does it just take 'latest'? Yes, you can explicitly specify the timeline, though as changing it would require a server restart, I suggest restarting the server as-is to double-check whether the "recovery_target_timeline = 'latest'" is being applied, and only if not try setting it to "recovery_target_timeline = 2". > From the timestamps, 000000010000142E0000005C and later are files > which were "recycled" > for future use and as such are perfectly normal. > Do you think it would be worth trying to delete (move/rename) the 000000010000142E0000005B file and see if it changes things? It probably wouldn't do any harm in this case, but in general nothing good ever came of speculatively moving/deleting files in the WAL directory. Regards Ian Barwick -- Ian Barwick https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services