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 1lQhkC-00088A-Tt for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Mar 2021 02:35:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lQhk9-0007T5-Jl for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Mar 2021 02:35:05 +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 1lQhk9-0007Qb-Bk for pgsql-bugs@lists.postgresql.org; Mon, 29 Mar 2021 02:35:05 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lQhk6-0004bq-3A for pgsql-bugs@lists.postgresql.org; Mon, 29 Mar 2021 02:35:04 +0000 Received: by mail-pj1-x1030.google.com with SMTP id w8so5292301pjf.4 for ; Sun, 28 Mar 2021 19:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=UqQs7DwEGrW5yd6UEKX7cJjOyISbSmMmiWvIC5lNHgo=; b=b+Hx57XZLa9ufSkfQtaiN/MdHhOxP8tNgJ6CpDbzajLyRJkWNNKhF/AT8fduOW2L6M F9pvmSd0MaeurTHOb3ZSm1Nvd7sXVKsKOabF/Jb+zAEW+y/koKQzR6WDLPeLDBIgypWy vkCp0YqjiIEXqjZphFRU7jDPFfXvxJKJvccTXFuRAJeTjAxDiE2PX6W15onT0mXHyGcB DvtCl81YJiLHoCq/UKC2/rA7O7FUFnvq/OFtUSpU56LZYNmfaZJK9abVL2Ak1guq65M3 qw6JIE3K4dA6OmO4NlpF8EzjO4qK9SjtWU1xELLVf2kCwaf/W7Irah56hDGPZSvJ+f48 vB5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=UqQs7DwEGrW5yd6UEKX7cJjOyISbSmMmiWvIC5lNHgo=; b=YB0wQJwkGC0/MVXMs+OMNXi+GUiQZOkjHMPXoAz5pWFNuBHYjmA1yB24QKyfeXSQFg Z3/NYbSLeMyPKEu0heTwChyWKS4focpQjipBdGU7EfdLwYMl/CqRQGBqcNTPWVM572bl BDn3YATxMEGmq62mEKixiN/+f09earjJNsxnih/+hzdhOSZ2cE+HOWT+rJ8xS9A8vzN4 FXoUMQdMK98un5WZ873Y8P59rDheWe3880U0q0u4cfdVgr7SU5mpQPW3p4DSj72C42RN 8cEl+4AOeXEVM1ZpAYSOim/ZuxHUWWEpmT13MpTrtEc+gbCWft4csMwbosU76hWS/9ya Laxw== X-Gm-Message-State: AOAM5315su2CZA73HIAWOvtH0nSHwa2Lc8HQaaLqalTk16fyf7G2wDOl 7KGlQ/2XnmFgEi5uSlB0o0E= X-Google-Smtp-Source: ABdhPJy8QL8A8D1Ey+mGfv7oZ+7TjvyvrU9+OqBrMzqRN6kraoU0wtjjvRqiJL1eAAK/a6ZuUS4I4w== X-Received: by 2002:a17:90a:9f48:: with SMTP id q8mr24839862pjv.53.1616985300867; Sun, 28 Mar 2021 19:35:00 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id d14sm13919653pji.22.2021.03.28.19.34.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Mar 2021 19:35:00 -0700 (PDT) Date: Mon, 29 Mar 2021 11:34:57 +0900 (JST) Message-Id: <20210329.113457.933340007488906032.horikyota.ntt@gmail.com> To: egashira.yusuke@fujitsu.com Cc: bossartn@amazon.com, x4mmm@yandex-team.ru, hlinnaka@iki.fi, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16922: In cascading replication, a standby server aborted when an upstream standby server promoted From: Kyotaro Horiguchi In-Reply-To: References: <16922-3d1488a219f53da4@postgresql.org> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello. (Mmm. Sorry for annoying, but added some persons in Cc:) This is the same issue with what is discussed in [1] and recently reported by [2]. [1] https://www.postgresql.org/message-id/E63E5670-6CC3-4B09-9686-A77CF94FE4A8%40amazon.com [2] https://www.postgresql.org/message-id/3f9c466d-d143-472c-a961-66406172af96.mengjuan.cmj@alibaba-inc.com At Thu, 25 Mar 2021 00:23:52 +0000, "egashira.yusuke@fujitsu.com" wrote in > > The replication between "NODE-A" and "NODE-B" is synchronous replication, > > and between "NODE-B" and "NODE-C" is asynchronous. > > > > "NODE-A" <-[synchronous]-> "NODE-B" <-[non-synchronous]-> "NODE-C" > > > > When the primary server "NODE-A" crashed due to full WAL storage and > > "NODE-B" promoted, the downstream standby server "NODE-C" aborted with > > following messages. > > > > 2021-03-11 11:26:28.470 JST [85228] LOG: invalid contrecord length 26 at > > 0/5FFFFF0 > > 2021-03-11 11:26:28.470 JST [85232] FATAL: terminating walreceiver process > > due to administrator command > > 2021-03-11 11:26:28.470 JST [85228] PANIC: could not open file > > "pg_wal/000000020000000000000005": No such file or directory > > 2021-03-11 11:26:28.492 JST [85260] LOG: started streaming WAL from primary > > at 0/5000000 on timeline 2 > > 2021-03-11 11:26:29.260 JST [85227] LOG: startup process (PID 85228) was > > terminated by signal 6: Aborted > > I would like to clarify the conditions under which this "abort" occurred to explain to the customer. > > By the result of pg_waldump, I think that the conditions are followings. > > 1) A partially written (across the following segment files) WAL record is recorded at the end of the WAL segment file. and > 2) The WAL segment file of 1) is the last WAL segment file that standby server received, and > 3) The standby server promoted. > > I think that the above conditions will be met only when the primary server crashed due to full WAL storage. > > Is my idea correct? The diagnosis looks correct to me, but the cause of the crash is irrelevant. A disk full just makes the crash hit accurately on the vital point. -- Kyotaro Horiguchi NTT Open Source Software Center