Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

From: Timur Magomedov <t(dot)magomedov(at)postgrespro(dot)ru>
To: Peter Smith <smithpb2250(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, "Aya Iwata (Fujitsu)" <iwata(dot)aya(at)fujitsu(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: [WIP]Vertical Clustered Index (columnar store extension) - take2
Date: 2025-09-17 15:15:00
Message-ID: 149d6694c0c5a789b0ee865e80109022002bade5.camel@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Peter!

I've found (using valgrind) some cases of reading random garbage after
allocated memory. Investigation showed this was caused by converting
some nodes to VciScanState* even if they have smaller size allocated
originally. So accessing VciScanState fields was accessing memory after
palloc'ed memory which could be used by any other allocation.

I think converting to VciScanState* is only valid for nodes with tag
T_CustomScanState so here is a patch that adds assertions for this:
0001-Assert-corrrect-node-tags-when-casting-to-VciScanSta.patch

VCI v23 passes the tests with this patch applied.

There are queries that fail unfortunately. I've added one of them to
bugs.sql:
0002-Reproducer-of-invalid-cast-to-VciScanState.patch
Node with tag 420 (T_NestLoopState) is cast to VciScanState* that fails
newly added assertion.

I'm not sure where to look next to fix this. Looking forward for you
comments and ideas.

--
Regards,
Timur Magomedov

Attachment Content-Type Size
0001-Assert-corrrect-node-tags-when-casting-to-VciScanSta.patch text/x-patch 5.4 KB
0002-Reproducer-of-invalid-cast-to-VciScanState.patch text/x-patch 1.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-09-17 15:23:22 Re: Schedule for PG 18 RC and GA releases
Previous Message Álvaro Herrera 2025-09-17 15:03:42 Re: REPACK and naming