Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YgRJC-0007JE-6d for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Apr 2015 05:16:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YgRJB-0006Tx-DP for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Apr 2015 05:16:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YgRJ9-0006Te-D7 for pgsql-bugs@postgresql.org; Fri, 10 Apr 2015 05:16:47 +0000 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YgRIz-0001Tp-AI for pgsql-bugs@postgresql.org; Fri, 10 Apr 2015 05:16:46 +0000 Received: by qkgx75 with SMTP id x75so14910561qkg.1 for ; Thu, 09 Apr 2015 22:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=P1Jaeo1IgS+xKkHyPJouk5h5fZgXgtE1Zw2hfnvTZb8=; b=djcvgJhuCXyKiZ5MztvTjdDlDKguv1IYmKQMJstrMYbOqOzH4sPyglbFGGYJi5ySS8 F+t4YFoQ8Jv94GwlREX6RCNxssmhMdZrw5z0PNMLhLWKUdbMsJKUpdpmpPtQJgp3tBYV G9ucs8eG4Idcvnd3UsN0y33UKDm1A+JHS82VF8BV18lt/43R6mWKH+t1N8gzrpMXKW20 10Qqu8c0nCHZ2Ft2SlpPrZNqoKMN6uZM33x2mOZFtuzlvwqx1OUYiJKUlIV6of3ivaGx uhYV30XPnniORoIyaoSXnOuOiAbMp8k+NRLgjUCRK0Nuu/e+sSic0hZLmiP0MGbdxJfb +csA== MIME-Version: 1.0 X-Received: by 10.229.87.68 with SMTP id v4mr41734191qcl.6.1428642995219; Thu, 09 Apr 2015 22:16:35 -0700 (PDT) Received: by 10.140.97.69 with HTTP; Thu, 9 Apr 2015 22:16:35 -0700 (PDT) In-Reply-To: <20150409140218.26383.3403@wrigleys.postgresql.org> References: <20150409140218.26383.3403@wrigleys.postgresql.org> Date: Fri, 10 Apr 2015 14:16:35 +0900 Message-ID: Subject: Re: BUG #13010: After promote postgres try to send old timeline WALs to archive From: Michael Paquier To: eshkinkot@gmail.com Cc: pgsql-bugs@postgresql.org, hlinnaka@iki.fi Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Thu, Apr 9, 2015 at 11:02 PM, wrote: > I do not use streaming, only WAL archive and after promote standby > it try to archive WALs with old timeline, but I already have it in > archive (from old master) and at new master WAL archiving stopped. > > [...] > now WAL archiving stopped with messages: > > 2015-04-08 20:49:31 MSK LOG: archive command failed with exit code 1 > 2015-04-08 20:49:31 MSK DETAIL: The failed archive command was: test ! -f > ~/tmp/pg-slave-switch/w/000000010000000000000025 && cp > pg_xlog/000000010000000000000025 > ~/tmp/pg-slave-switch/w/000000010000000000000025 > 2015-04-08 20:49:32 MSK LOG: archive command failed with exit code 1 The standby has recycled some WAL segments ahead thinking to reuse them and at promotion they became actually bogus. It is an expected behavior for a standby to archive the files that it thinks are not archived yet after promotion even if they are not of its own timeline, but those bogus segments should never be archived. See this thread for example that has a patch: http://www.postgresql.org/message-id/54942034.7080303@vmware.com Note that I got this patch on my list-of-things-to-look-at for some time, perhaps it is time to accelerate the move. Regards, -- Michael -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs