On Thursday, November 21, 2024 17:56 MSK, "Vitaly Davydov" 
<v.davy...@postgrespro.ru> wrote:

> I'm trying to create a perl test to reproduce it. Please, give me some time 
> to create the test script.

Attached is the test script which reproduces my problem. It should be run on a 
patched postgresql with the following changes (see below). It is the easiest 
way to emulate long checkpoint during high load.

CheckPointBuffers(int flags)
{
    BufferSync(flags);
+    pg_usleep(10000000);
}

I used the following command line to run the script, where <postgresqldir> - 
the directory with postgresql sources. The module IPC::Run should be installed 
as well. PATH and LD_LIBRARY_PATH should be set to a proper postgresql binary 
and libraries as well.

perl -I <postgresqldir>/src/test/perl/ restartlsn.pl

Finally, it should produce the following error into the log:

error running SQL: 'psql:<stdin>:1: ERROR:  requested WAL segment 
pg_wal/000000010000000000000001 has already been removed'

With best regards,
Vitaly

Attachment: restartlsn.pl
Description: Perl program

Reply via email to