Re: Orphan page in _bt_split

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Konstantin Knizhnik <knizhnik(at)garret(dot)ru>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Orphan page in _bt_split
Date: 2025-09-25 06:45:21
Message-ID: aNTlAbS0By8kTcKJ@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-09-25 06:53:40 Re: Logical Replication of sequences
Previous Message Michael Paquier 2025-09-25 06:42:33 Re: Get rid of pgstat_count_backend_io_op*() functions