Re: Orphan page in _bt_split - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Orphan page in _bt_split
Date
Msg-id aNTlAbS0By8kTcKJ@paquier.xyz
Whole thread Raw
In response to Re: Orphan page in _bt_split  (Konstantin Knizhnik <knizhnik@garret.ru>)
Responses Re: Orphan page in _bt_split
List pgsql-hackers
On Thu, Sep 25, 2025 at 09:41:00AM +0300, Konstantin Knizhnik wrote:
> Sorry, I have attached wrong patch.

Thanks, I was confused for a couple of minutes.

+    /*
+     * Now we are in critical section and it is not needed to maintain temporary
+     * copy of right page in the local memory. We can copy it to the destination buffer.
+     * Unlike leftpage, rightpage and ropaque are still needed to complete update
+     * of the page, so we need to correctly reinitialize them.
+     */
+    rightpage = BufferGetPage(rbuf);
+    memcpy(rightpage, rightpage_buf.data, BLCKSZ);
+    ropaque = BTPageGetOpaque(rightpage);

Hmm.  This looks kind of explicit enough to document the purpose.
The wording could be simplified a bit more.  I'll take it from there.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Get rid of pgstat_count_backend_io_op*() functions
Next
From: shveta malik
Date:
Subject: Re: Logical Replication of sequences