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.92) (envelope-from ) id 1jGYkV-0006YH-V6 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2020 01:53:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jGYkU-0001pn-Ms for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2020 01:52:58 +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 1jGYkU-0001pf-E5 for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2020 01:52:58 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jGYkS-0006rG-8R for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2020 01:52:58 +0000 Received: by mail-pj1-x1043.google.com with SMTP id m15so698105pje.3 for ; Mon, 23 Mar 2020 18:52:56 -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=kPo/LVbDDKj6Gr9NogOMOK0cYJ45XzcnpSibHppvQo4=; b=CS2SxAnq2D9zg3ck53S1U8y40Q991V5K8SksAVjac9aesuSEad/9TRhYjta5dbchsk fmGewRpuWLnDO5T4R+SNgDsHtPdAItWS0jq/fLab2SATKjtrVqluipw8tH+XgPmbqjis WVBGWy9zjcVWhYg/8uH7r+FCZ6ot9kqHxNsjJ//WV+VW7jrP+zkr4ti8v5s0SvG/8OA8 90uaSPSGc58aNPgzfscFHkWapc5gC/i1qLlZQ3Ng+1t4stJQNNC6KwQRBw1h4oMQqHy0 i01M5Gmy85PomQptEDXEaAWfCCkGc++ZS+yabf9f9ocGz+aBQxjH0BsfyGhfcdbppXBQ y6PA== 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=kPo/LVbDDKj6Gr9NogOMOK0cYJ45XzcnpSibHppvQo4=; b=dOIGYtTYiyqxFAKS6Epm5bwyYgxNkHLv7DlrMgXo4sRxYsWpKQ4eekdqvMIfGtMLdA OKZUhj7KcDh78/uiYOYwe63HZRs6bFGyNr/oDU+OlHV0GjwLVqI54HTAjK8STTjBlku3 K18pLp/HhervheDfSU9t/8xTZNYBtcOs7nI7cJ34oTod87ivX1w1io43lyy+Lj88VXMo vKHJ013JdhBhF6jJuV5397hndN5y9TlYVnr4i29ZFaEgG0iZCXX6hHoqkN8l6tcPI5ex VhLn6D3QLPND7dwMuf6M+CRseWzyC0n6BhCe9o4CaGtA/85kCfkDjtsZJXFS0pl522vs eEuQ== X-Gm-Message-State: ANhLgQ1rKlieOPTRFDhmYCiYcvg4rQ+OdhSQqNlPEzExswwLqjYlDA0u NoIw6Wolvcze99FKWyrmzuk= X-Google-Smtp-Source: ADFU+vs+AGlIutXVCrFT//qKB7BT+2/tj7jsrkDNpZzHlWihrT7LGju4SRaufc1fCOzg7Ysn0IhpSA== X-Received: by 2002:a17:90a:4d43:: with SMTP id l3mr2296250pjh.165.1585014774317; Mon, 23 Mar 2020 18:52:54 -0700 (PDT) Received: from localhost (w196209.dynamic.ppp.asahi-net.or.jp. [121.1.196.209]) by smtp.gmail.com with ESMTPSA id z20sm13228825pge.62.2020.03.23.18.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 18:52:53 -0700 (PDT) Date: Tue, 24 Mar 2020 10:52:50 +0900 (JST) Message-Id: <20200324.105250.1584846618506385212.horikyota.ntt@gmail.com> To: andres@anarazel.de Cc: peter.eisentraut@2ndquadrant.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org Subject: Re: Make mesage at end-of-recovery less scary. From: Kyotaro Horiguchi In-Reply-To: <20200323194736.uijmupfle2ccvyah@alap3.anarazel.de> References: <20200305.160650.1027844943773682801.horikyota.ntt@gmail.com> <4a9fc5b1-34c8-46ec-9b71-d4763d70311d@2ndquadrant.com> <20200323194736.uijmupfle2ccvyah@alap3.anarazel.de> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Mar_24_10_52_50_2020_211)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ----Next_Part(Tue_Mar_24_10_52_50_2020_211)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Mon, 23 Mar 2020 12:47:36 -0700, Andres Freund wrote in > Hi, > > On 2020-03-23 10:37:16 +0100, Peter Eisentraut wrote: > > On 2020-03-05 08:06, Kyotaro Horiguchi wrote: > > > | [20866] LOG: replication terminated by primary server > > > | [20866] DETAIL: End of WAL reached on timeline 1 at 0/30001C8. > > > | [20866] FATAL: could not send end-of-streaming message to primary: no COPY in progress > > IMO it's a bug that we see this FATAL. I seem to recall that we didn't > use to get that? I thought that it is a convention that A auxiliary process uses ERROR (which is turned into FATAL in ereport) to exit, which I didn't like so much, but it was out of scope of this patch. As for the message bove, the FATAL is preceded by the "LOG: replication terminated by" message, that means walreceiver tries to send new data after disconnection just to fail, which is unreasonable. I think we should exit immediately after detecting disconnection. The FATAL is gone by the attached. > > > | [24267] LOG: reached end of WAL at 0/3000240 on timeline 1 in archive during standby mode > > > | [24267] DETAIL: invalid record length at 0/3000240: wanted 24, got 0 > > > > Is this the before and after? That doesn't seem like a substantial > > improvement to me. You still get the "scary" message at the end. > > It seems like a minor improvement - folding the DETAIL into the message > makes sense to me here. But it indeed doesn't really address the main > issue. > > I think we don't want to elide the information about how the end of the > WAL was detected - there are some issues where I found that quite > helpful. But we could reformulate it to be clearer that it's informative > output, not a bug. E.g. something roughly like > > LOG: reached end of WAL at 0/3000240 on timeline 1 in archive during standby mode > DETAIL: End detected due to invalid record length at 0/3000240: expected 24, got 0 > (I first elided the position in the DETAIL, but it could differ from the > one in LOG) > > I don't find that very satisfying, but I can't come up with something > that provides the current information, while being less scary than my > suggestion? The 0-length record is not an "invalid" state during recovery, so we can add the message for the state as "record length is 0 at %X/%X". I think if other states found there, it implies something wrong. LSN is redundantly shown but I'm not sure if it is better to remove it from either of the two lines. | LOG: reached end of WAL at 0/3000850 on timeline 1 in pg_wal during crash recovery | DETAIL: record length is 0 at 0/3000850 regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Tue_Mar_24_10_52_50_2020_211)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v3-0001-Make-End-Of-Recovery-error-less-scary.patch"