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 1jYWr1-0000KQ-ST for pgsql-general@arkaria.postgresql.org; Tue, 12 May 2020 15:29:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYWr0-00048f-Qb for pgsql-general@arkaria.postgresql.org; Tue, 12 May 2020 15:29:58 +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 1jYWr0-00045q-Hx for pgsql-general@lists.postgresql.org; Tue, 12 May 2020 15:29:58 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jYWqx-0000Pf-Lm for pgsql-general@lists.postgresql.org; Tue, 12 May 2020 15:29:57 +0000 Received: by mail-wm1-x341.google.com with SMTP id g14so9646604wme.1 for ; Tue, 12 May 2020 08:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=7Hk2+tDdmmLRZJOpBUrE+7ySK8c5E2SImnhIfCo5R1w=; b=jqA6U/O6VQPJ6gv55DyFpcejzvKE9Qq7xlT0HYVHv2n2sUNq1yB1B0bUtcisCNy+w8 2WbjF4zLwtTBAL1NEggne+/tE6W3ZkYIQe0i/UU01GaBxnsbG9oaKWd+UvKam59DFUXN aIXZmYm1K6Xz783J8t3AywAwe7yEuCyamJsB5r5q4eDYTFIXfTamvx5GTnApBk+KKY4f dQSPsLG0+ysy0ZIegfj0TyB6WwAUPNCUJx89CuhZ+eTRDMCEvoP061Kt4TuNkmDf1S/r hYwErtSNZXscK25GsEZokhzki2JGZ7Q723LKt4O0/MitveitjGhd1WRc8mTKuACO+QFg nERQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=7Hk2+tDdmmLRZJOpBUrE+7ySK8c5E2SImnhIfCo5R1w=; b=Ma6WtmGgYe2a5JJuVU+Lqrg42qdSNR9oTSLsPlZICeEDOKN5K6AuxORqmuacly+UGI lk07dBALnesVgbWnB0TRMUdZrNfxI0H0RYCM6asV53Cb37dPNx2hlwuWdT3WDKLGhD0E ysmRRGxmE9gDy5ZslII7TElDWTXMWaDqWhC5U1fw8hA/bnfPiF3VbAXFuyh2fyqVFaO3 lfrEUsX0Bi6ni/cg7WIUNE9BfEmvAK6Y7alFTy+KitqrYlkWYygtI41mSrTEYcFHJKEX EkowJCH1348lpzZNROC9y10q8tQ/Yp2ZTiQj5ekzCR0CxwZN2mmuYc5Fu2BJtLo0V0yu wpUA== X-Gm-Message-State: AGi0PuYwuDGQirvt/b51rlmWjca6/GvjdmzZ3boFPc68EYIbfAI1vbeu jiJ30/XNGMNyJHaBjkyDsbtL+Q== X-Google-Smtp-Source: APiQypJH7HkcYcdt1OfbZFeW8nBjZgH0q9WTw4eF2hzwKCLwJWwjqg1MSTYNdO4bnfq7eTTPjqGqYQ== X-Received: by 2002:a7b:c1d2:: with SMTP id a18mr12895722wmj.176.1589297391787; Tue, 12 May 2020 08:29:51 -0700 (PDT) Received: from localhost.localdomain (217-149-172-73.nat.highway.telekom.at. [217.149.172.73]) by smtp.gmail.com with ESMTPSA id a81sm25508959wmh.7.2020.05.12.08.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 08:29:51 -0700 (PDT) Message-ID: Subject: Re: [EXTERNAL] Re: PostgreSQL-12 replication failover, pg_rewind fails From: Laurenz Albe To: Mariya Rampurawala , Kyotaro Horiguchi Cc: "pgsql-general@lists.postgresql.org" Date: Tue, 12 May 2020 17:29:50 +0200 In-Reply-To: <8BD51BB9-8695-4F10-8E9A-144D3F97059C@veritas.com> References: <2775DB08-A4FB-44EE-9A3B-81ABB4CB4F7F@veritas.com> <76BE6093-8449-4D52-BC16-34B69B02CE2D@veritas.com> <20200512.174507.1640068515388747886.horikyota.ntt@gmail.com> <8BD51BB9-8695-4F10-8E9A-144D3F97059C@veritas.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2020-05-12 at 09:40 +0000, Mariya Rampurawala wrote: > > but if the target cluster ran for a long time after the divergence, > > the old WAL files might no longer be present. In that case, they can > > be manually copied from the WAL archive to the pg_wal directory, or > > fetched on startup by configuring primary_conninfo or restore_command. > > I hit this issue every time I follow the aforementioned steps, manually as well as with scripts. > How long is "long time after divergence"? Is there a way I can make some > configuration changes so that I don’t hit this issue? > Is there anything I must change in my restore command? What you can do is to use a higher value for "wal_keep_segments". Then PostgreSQL will keep around that number of old WAL segments, which increases the chance for "pg_rewind" to succeed. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com