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 1mMD6x-00045g-4H for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Sep 2021 17:36:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mMD6P-0003gA-Le for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Sep 2021 17:35:45 +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 1mMD6P-0003g2-Dj for pgsql-hackers@lists.postgresql.org; Fri, 03 Sep 2021 17:35:45 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mMD6H-0005Jm-5u for pgsql-hackers@lists.postgresql.org; Fri, 03 Sep 2021 17:35:44 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6A5035C00F2; Fri, 3 Sep 2021 13:35:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 03 Sep 2021 13:35:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=AtbI9LV8TIlHzOIlANZZV6BRgWD7Uc+0HFG8ZO7+r6M=; b=K6DeKqGl qYZm50JC83T/WvsFW/OjyLzYGx+kd/cZW8uMxDSFul4tkzhmNgXZHevESL5aswvf lCQndGgDNzVRPcLe5NrIffCIHkEfs3LQKQOhxrFGUw/VOfbDigBcWirTVqVHYINE otrqISLqNBvdiatA+TkH4d2ygAFGjGnzcTyxYdg4ZzNETpBINna/+3MCupnCqy7M UezBftedw03kxgipLyIE9TmNpdgdmwi77671JShucCXj05c14vfXwsRfk3Li/e/+ siPcVnbmMyaYB2q6OovZAf3QlNd86QFfVUZM85MIiOYEN9ObiiJHJ6xkJhEZVTtp bKAhi8kcWfGQuw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvjedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjsehtke ertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedujeevjeffje evuddutedvkeeiueeitddvieelfeekveejudefgeeuvdejhfeuleenucffohhmrghinhep vghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhr gh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Sep 2021 13:35:34 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 437E42A07D0; Fri, 3 Sep 2021 13:35:32 -0400 (-04) Date: Fri, 3 Sep 2021 13:35:32 -0400 From: Alvaro Herrera To: Kyotaro Horiguchi Cc: masao.fujii@oss.nttdata.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org, bossartn@amazon.com, mengjuan.cmj@alibaba-inc.com, Jakub.Wartak@tomtom.com Subject: Re: prevent immature WAL streaming Message-ID: <202109031735.lhfhywziaksp@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210903.160904.904317102157226316.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Sep-03, Kyotaro Horiguchi wrote: > At Thu, 2 Sep 2021 18:43:33 -0400, Alvaro Herrera wrote in > The name sounds like the start LSN. doesn't contrecordAbort(ed)Ptr work? > > > if (!(pageHeader->xlp_info & XLP_FIRST_IS_CONTRECORD)) > > { > > report_invalid_record(state, > > "there is no contrecord flag at %X/%X", > > LSN_FORMAT_ARGS(RecPtr)); > > + goto aborted_contrecord; > > This loses the exclusion check between XLP_FIRST_IS_CONTRECORD and > _IS_ABROTED_PARTIAL. Is it okay? (I don't object to remove the check.). On second thought, I'm not sure that we should make xlogreader report an invalid record here. If we do, how is the user going to recover? Recovery will stop there and lose whatever was written afterwards. Maybe you could claim that if both bits are set then WAL is corrupted, so it's okay to stop recovery. But if WAL is really corrupted, then the CRC check will fail. All in all, I think I'd rather ignore the flag if we see it set. At most, we could have an #ifndef FRONTEND ereport(WARNING, "found unexpected flag xyz"); #endif or something like that. However, xlogreader does not currently have anything like that, so I'm not completely sure. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/