Re: nbtree: opt-in leaf key prefix compression

From: Greg Burd <greg(at)burd(dot)me>
To: Yao Feng <fengyao0087(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: nbtree: opt-in leaf key prefix compression
Date: 2026-11-28 01:38:39
Message-ID: 179579643534.3871747.3747591232390202469@burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 27, 2026 at 2:00 AM Greg Burd <greg(at)burd(dot)me> wrote:
> v17 attached, rebased onto 31878ccc2cd.

v18 attached, rebased onto e347dae2d40. One fix.

cfbot's Linux Autoconf run, which builds with -fsanitize=alignment,
caught a misaligned read in btree_xlog_split(). The split redo reads
the key-column layout the primary logs after xl_btree_split for a coded
left half from a plain original (XLH_SPLIT_LEFT_DESC). It read the
leading uint16 count by dereferencing a pointer into that main-data
area, which is not two-byte aligned, so the sanitizer aborted the
standby in 027_stream_regress and 062_nbtree_prefix. It now copies the
count out with memcpy, as the rest of the WAL code does for unaligned
main data. No format change; the bytes on the wire are the same.

-greg

Attachment Content-Type Size
v18-0001-nbtree-add-opt-in-leaf-key-prefix-compression.patch application/octet-stream 266.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xnerv Wang 2026-11-28 02:35:49 GetNewOidWithIndex() can reuse a TOAST value ID while its chunks are still in the heap
Previous Message Chao Li 2026-11-28 01:19:11 Re: Skip Var resolution when checking expression type dependencies