Обсуждение: Re: Compression of bigger WAL records

Поиск
Список
Период
Сортировка

Re: Compression of bigger WAL records

От
Kirill Reshke
Дата:
I



./pgbin/bin/pg_waldump

On Sun, 12 Jan 2025 at 17:43, Andrey M. Borodin <x4mmm@yandex-team.ru> wrote:
>
> Hi hackers!
>
> I propose a slight change to WAL compression: compress body of big records, if it's bigger than some threshold.
>


Hi,
initdb fails when configured with --without-zstd

```
reshke@ygp-jammy:~/postgres$ ./pgbin/bin/initdb -D db
The files belonging to this database system will be owned by user "reshke".
This user must also own the server process.

The database cluster will be initialized with locale "C.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are enabled.

creating directory db ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "autovacuum_worker_slots" ... 16
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... 2025-01-12 18:10:47.657 UTC [4167965]
FATAL:  zstd is not supported by this build
2025-01-12 18:10:47.657 UTC [4167965] PANIC:  cannot abort transaction
1, it was already committed
Aborted (core dumped)
child process exited with exit code 134
initdb: removing data directory "db"
```

Also pg_waldump fails with

```
corrupted size vs. prev_size
Aborted (core dumped)
```

Best regards,
Kirill Reshke



Re: Compression of bigger WAL records

От
Andrey Borodin
Дата:
Hi! Thanks for looking into this!

> On 12 Jan 2025, at 23:36, Kirill Reshke <reshkekirill@gmail.com> wrote:
>
> initdb fails when configured with --without-zstd

Yes, the patch is intended to demonstrate improvement when using Zstd.

> On 12 Jan 2025, at 17:43, Andrey M. Borodin <x4mmm@yandex-team.ru> wrote:
>
> WAL_DEBUG and wal_compression are enabled for debugging purposes. Of course, I do not propose to turn them on by
default.

And this does not work well --without-zstd.

> Also pg_waldump fails with
>
> ```
> corrupted size vs. prev_size
> Aborted (core dumped)
> ```

I’ll fix that, thanks!
Also seems like I forgot to bump WAL_FILE_MAGIC…

What do you think about proposed approach?


Best regards, Andrey Borodin.