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 1mjxhJ-0004mE-7i for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Nov 2021 06:00:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mjxhI-0006Tz-0G for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Nov 2021 06:00:00 +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 1mjxhH-0006Tq-D9 for pgsql-hackers@lists.postgresql.org; Mon, 08 Nov 2021 05:59:59 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mjxhA-000405-J5 for pgsql-hackers@lists.postgresql.org; Mon, 08 Nov 2021 05:59:58 +0000 Received: by mail-pf1-x432.google.com with SMTP id m14so14961982pfc.9 for ; Sun, 07 Nov 2021 21:59:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=0dlXqgZeJZv+g4NVK63vy59OpR3dZaK9EjykGWU1FrY=; b=iJZCmeZFDVv86LUHfOKrDlXsHNMcpL9NbYGdK98kSdM/nA2fJLKpwwYzco6d2ZXSnJ 3c0vuqOk4HKDLSqIUb6GdUUWGNNFVrs8qPAnb7pyt0QKO5s5TggBOsUHHXddoIFCcjza CL25HwNIzWwctX+2QR75AMdhJ3PVkLjZzJ5+4DiW2rjH9EP79fweD9NUH98ReHJqgeA1 B9ySGjFUdeF0ZfSLGoveHnj9YSEyaZHvcKB4suF/desJ3G5RnYpTC//OKNWi8joKf6kr jlAFukJPtAi0EONRJhl3nGYa9DiGED3E+R21sVEiA0D7eYn7PmKmom0urHRycYf3zRJr W/Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=0dlXqgZeJZv+g4NVK63vy59OpR3dZaK9EjykGWU1FrY=; b=GbGS+IbK4FpkmYlQvs+EedB94iD2XUeTRj5u2ZS0QLwICz8zRMegF4AEPaynz501TE IsqvoEFjh/KTGHLnbkdbIutzKtgecwQgPdnbAjNikFqDkv/cb7dTC412h4YX607GHSf+ lxFjSMQcNWgngJaR5BPpc+e855TY8J/an8QCJU2EbAU5du2MywsDkqeQ9lRjMntk9Yet sUPessSAydTUKnuP0oCL68d6a8KLeGUCMdALD1ZRVw2A7HA+DcBHBQR+OpWqupNMzxr+ RFy2T83fSRsRbYwgALANcrh4ILmkuYfYDEzZVT5fcgT6dz/eKnS2zMvlvoyA3XiM7Ba7 XCMg== X-Gm-Message-State: AOAM531tMZiGcu/vpgAqOtiNp/n7apB1z6h+KvrDKZuM482jkIMBkFu9 OV4ZUZBStzEEuM0zBSRJGtA= X-Google-Smtp-Source: ABdhPJyDi6G3JLmTgnh7b7a9gsU1tcB5pGyzuyYmf34pKCs3i+wLibIfQ6LooEHOiY+azvCdUlt9rg== X-Received: by 2002:a63:182:: with SMTP id 124mr7285147pgb.172.1636351191079; Sun, 07 Nov 2021 21:59:51 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id a20sm13756909pfn.136.2021.11.07.21.59.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 07 Nov 2021 21:59:50 -0800 (PST) Date: Mon, 08 Nov 2021 14:59:46 +0900 (JST) Message-Id: <20211108.145946.1513355777186578917.horikyota.ntt@gmail.com> To: bossartn@amazon.com Cc: david@pgmasters.net, peter.eisentraut@2ndquadrant.com, andres@anarazel.de, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org, jtc331@gmail.com, robertmhaas@gmail.com Subject: Re: Make mesage at end-of-recovery less scary. From: Kyotaro Horiguchi In-Reply-To: References: <20210304.155039.2020434514871976864.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Nov__8_14_59_46_2021_800)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Mon_Nov__8_14_59_46_2021_800)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Fri, 22 Oct 2021 17:54:40 +0000, "Bossart, Nathan" wrote in > On 3/4/21, 10:50 PM, "Kyotaro Horiguchi" wrote: > > As the result, the following messages are emitted with the attached. > > I'd like to voice my support for this effort, and I intend to help > review the patch. It looks like the latest patch no longer applies, > so I've marked the commitfest entry [0] as waiting-on-author. > > Nathan > > [0] https://commitfest.postgresql.org/35/2490/ Sorry for being late to reply. I rebased this to the current master. - rebased - use LSN_FORMAT_ARGS instead of bare shift and mask. - v4 immediately exited walreceiver on disconnection. Maybe I wanted not to see a FATAL message on standby after primary dies. However that would be another issue and that change was plain wrong.. v5 just removes the "end-of-WAL" part from the message, which duplicate to what startup emits. - add a new error message "missing contrecord at %X/%X". Maybe this should be regarded as a leftover of the contrecord patch. In the attached patch the "%X/%X" is the LSN of the current record. The log messages look like this (026_overwrite_contrecord). LOG: redo starts at 0/1486CB8 WARNING: missing contrecord at 0/1FFC2E0 LOG: consistent recovery state reached at 0/1FFC2E0 LOG: started streaming WAL from primary at 0/2000000 on timeline 1 LOG: successfully skipped missing contrecord at 0/1FFC2E0, overwritten at 2021-11-08 14:50:11.969952+09 CONTEXT: WAL redo at 0/2000028 for XLOG/OVERWRITE_CONTRECORD: lsn 0/1FFC2E0; time 2021-11-08 14:50:11.969952+09 While checking the behavior for the case of missing-contrecord, I noticed that emode_for_corrupt_record() doesn't work as expected since readSource is reset to XLOG_FROM_ANY after a read failure. We could remember the last failed source but pg_wal should have been visited if page read error happened so I changed the function so that it treats XLOG_FROM_ANY the same way with XLOG_FROM_PG_WAL. (Otherwise we see "LOG: reached end-of-WAL at .." message after "WARNING: missing contrecord at.." message.) regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Mon_Nov__8_14_59_46_2021_800)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0001-Make-End-Of-Recovery-error-less-scary.patch"