Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goixP-0001Uu-Md for pgsql-general@arkaria.postgresql.org; Wed, 30 Jan 2019 06:02:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1goixO-0004Cq-Cc for pgsql-general@arkaria.postgresql.org; Wed, 30 Jan 2019 06:02:42 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1goixO-00047A-4D for pgsql-general@lists.postgresql.org; Wed, 30 Jan 2019 06:02:42 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goixL-0002gh-Kh for pgsql-general@lists.postgresql.org; Wed, 30 Jan 2019 06:02:41 +0000 Received: by mail-ot1-x330.google.com with SMTP id k98so20174427otk.3 for ; Tue, 29 Jan 2019 22:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=jQLnScJI32ge1ES+cY0J9Tvz2hd0uJNw0468v8bLz7E=; b=VRDcqL/cHlTnKCbTEet3dZMAUO/65acR4BEEwjgT3vEOHP8sL0Jq+QR/Fzz6T7MJmq 7Q4wu4GFOzENnsBzOHo/qOW0L0HqTPDy2W1x+2KMMedVQN6BWrNbjBzhfkiWl5QeopW0 FLHjvoMTBt/TMv+jgQ3H3OzDE+2erZGQovJlr8o8Wty0CHCVHUR8js9RGMO5G3aHUbWp 9qWWa9wzXeV3zIH4IhIqMY+t5I8aph4VpoGgcADR/ObLimTBwD7HVHcxErP4QBB/a2UR IYJTjdj3/3jofnZ6LHZagx5ERtr6QteF49DSGNrmXeDquoDOv+NGKJJYh0NM0y9i9Ka6 aNYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=jQLnScJI32ge1ES+cY0J9Tvz2hd0uJNw0468v8bLz7E=; b=SWkHECxn30+AyTpQEusfmLTeiv0ARXwK8YN8sm3d+MY2jL6HBjMTZc0BsE2us4p6CS Pf6dgUgRwqAHs8ByncOTjZ5+5wxKnGfzBWAwc0bHeAYZlLHJXOvaHlUZUojSL24hB15E bLBhF4EC/4EwtOFZBZ8AQIbK3qrOj5jp+6zdRpcdSjn3qRp5FbX4pw49qYL14NvA8InP YlabwFcUQaZvQgNk0HGLGhXUMCtXuDyM/hipXMnd92jpfipsGUcLAvIunUf5AbG05hn0 bU+IFgSuFqHTLk8orqeplJcPR2JaRW2TE9To+s9MVInWIXrMZTq2aGDSKr7mbemyO6m9 /roA== X-Gm-Message-State: AJcUukdjk77OlUZNnUTCiR0DHJnFUID0xG47wxNK9KnIFkTthGzL/1RK iUCJNo/o907jPioavkxRTTjBtKPP X-Google-Smtp-Source: ALg8bN4BQ+7RczsMXBZaU99WLj1AMta7yt/3VLl/1ZP6vwQJv/U1I3ibekRmAtJCkJ79S9rniqjt+Q== X-Received: by 2002:a9d:468:: with SMTP id 95mr21534574otc.312.1548828157487; Tue, 29 Jan 2019 22:02:37 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id v1sm233430otq.80.2019.01.29.22.02.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 22:02:36 -0800 (PST) Subject: Re: pg_rewind success even though getting error 'record with incorrect prev-link' To: pgsql-general@lists.postgresql.org References: <20190130014408.GM3121@paquier.xyz> From: Ron Message-ID: Date: Wed, 30 Jan 2019 00:02:35 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------8AAAFE4241652213CE1CA63E" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------8AAAFE4241652213CE1CA63E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 1/29/19 9:57 PM, Abdullah Al Maruf wrote: > Hi Michael > > > This is pointing out to the end of WAL for the current timeline.  You > > may face it after reading a WAL segment in an area which has been used > > in the past for a recycled segment. > > Are you talking about error `LOG:  invalid record length at 0/B000098: > wanted 24, got 0` ? > or, >  `LOG:  record with incorrect prev-link 10000/21B0000 at 0/B000098` > > Actually, the 1st error is not making any issue. This node starts to > streaming from primary successfully. > But when the second error comes, It appears every 5 seconds. And, the node > is not streaming from master. > > pg_rewind still resolves timeline conflict, but it's not fixing this > second error. > > Any work around?? > ---------------- > My scenario, in short, I have 1 master nodes (0th node) and three standby > nodes (1st, > > 2nd & 3rd node). When I make the 3rd node as master (by trigger file) and > restarts 0th node as a replica, It shows no problem. > > But when both nodes are offline and our leader selection chooses the 0th > node as a master, and tries to reattach the 3rd node as Replica, It throws > an error similar to: > > ``` LOG: invalid record length at 0/B000098: wanted 24, got 0 LOG: started > streaming WAL from primary at 0/B000000 on timeline 2 LOG: record with > incorrect prev-link 10000/21B0000 at 0/B000098 FATAL: terminating > walreceiver process due to administrator command LOG: record with > incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect > prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link > 10000/21B0000 at 0/B000098 > The only *error* I see is when you apparently manually kill the process.  The LOG messages aren't actually errors. -- Angular momentum makes the world go 'round. --------------8AAAFE4241652213CE1CA63E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 1/29/19 9:57 PM, Abdullah Al Maruf wrote:
Hi Michael

> This is pointing out to the end of WAL for the current timeline.  You
> may face it after reading a WAL segment in an area which has been used
> in the past for a recycled segment.

Are you talking about error ` LOG:  invalid record length at 0/B000098: wanted 24, got 0` ? 
or,
 `LOG:  record with incorrect prev-link 10000/21B0000 at 0/B000098`

Actually, the 1st error is not making any issue. This node starts to streaming from primary successfully. 
But when the second error comes, It appears every 5 seconds. And, the node is not streaming from master. 

pg_rewind still resolves timeline conflict, but it's not fixing this second error.

Any work around?? 
----------------
My scenario, in short, I have 1 master nodes (0th node) and three standby nodes (1st,

2nd & 3rd node). When I make the 3rd node as master (by trigger file) and restarts 0th node as a replica, It shows no problem.

But when both nodes are offline and our leader selection chooses the 0th node as a master, and tries to reattach the 3rd node as Replica, It throws an error similar to:

``` LOG: invalid record length at 0/B000098: wanted 24, got 0 LOG: started streaming WAL from primary at 0/B000000 on timeline 2 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 FATAL: terminating walreceiver process due to administrator command LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098 LOG: record with incorrect prev-link 10000/21B0000 at 0/B000098


The only error I see is when you apparently manually kill the process.  The LOG messages aren't actually errors.

--
Angular momentum makes the world go 'round.
--------------8AAAFE4241652213CE1CA63E--