Re: [PoC] Improve dead tuple storage for lazy vacuum - Mailing list pgsql-hackers

From Pavel Borisov
Subject Re: [PoC] Improve dead tuple storage for lazy vacuum
Date
Msg-id CALT9ZEGUQf4U=AYxsndhHJvA=OjM21-4uxSFs6_J9ufgDHx53g@mail.gmail.com
Whole thread Raw
In response to Re: [PoC] Improve dead tuple storage for lazy vacuum  (John Naylor <johncnaylorls@gmail.com>)
List pgsql-hackers
Hi, John!

On Mon, 8 Apr 2024 at 03:13, John Naylor <johncnaylorls@gmail.com> wrote:
On Mon, Apr 8, 2024 at 2:07 AM Andres Freund <andres@anarazel.de> wrote:
>
> Looking at the code, the failure isn't suprising anymore:
>         char            data[MaxBlocktableEntrySize];
>         BlocktableEntry *page = (BlocktableEntry *) data;
>
> 'char' doesn't enforce any alignment, but you're storing a BlocktableEntry in
> a char[]. You can't just do that.  Look at how we do that for
> e.g. PGAlignedblock.
>
>
> With the attached minimal fix, the tests pass again.

Thanks, will push this shortly!
Buildfarm animal mylodon looks unhappy with this:
FAILED: src/backend/postgres_lib.a.p/access_common_tidstore.c.o 
ccache clang-14 -Isrc/backend/postgres_lib.a.p -Isrc/include -I../pgsql/src/include -I/usr/include/libxml2 -I/usr/include/security -fdiagnostics-color=never -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -fno-strict-aliasing -fwrapv -D_GNU_SOURCE -Wmissing-prototypes -Wpointer-arith -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -Wdeclaration-after-statement -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O1 -ggdb -g3 -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers -Wno-array-bounds -std=c99 -Wc11-extensions -Werror=c11-extensions -fPIC -isystem /usr/include/mit-krb5 -pthread -DBUILDING_DLL -MD -MQ src/backend/postgres_lib.a.p/access_common_tidstore.c.o -MF src/backend/postgres_lib.a.p/access_common_tidstore.c.o.d -o src/backend/postgres_lib.a.p/access_common_tidstore.c.o -c ../pgsql/src/backend/access/common/tidstore.c
../pgsql/src/backend/access/common/tidstore.c:48:3: error: anonymous structs are a C11 extension [-Werror,-Wc11-extensions]                struct                ^ 
1 error generated.

Regards,
Pavel Borisov
Supabase 

pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: Add last_commit_lsn to pg_stat_database
Next
From: John Naylor
Date:
Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum