pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Давыдов Виталий <v.davydov@postgrespro.ru>
To: Vitaly Davydov <v.davydov@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Date: Thu, 21 Nov 2024 19:13:23 +0300
Message-ID: <100d39-673f5c00-35-5ccfd100@179797392> (raw)
In-Reply-To: <fb689-673f4a00-25-21dfc440@244947041>
References: <1d12d2-67235980-35-19a406a0@63439497>
	<683f3c82-d38e-436d-88fd-27722af62005@vondra.me>
	<fb689-673f4a00-25-21dfc440@244947041>

On Thursday, November 21, 2024 17:56 MSK, "Vitaly Davydov" <v.davydov@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

Attachments:

  restartlsn.pl (application/x-perl, 2.3K) download

view thread (85+ messages)  latest in thread

Message-ID: <100d39-673f5c00-35-5ccfd100@179797392>
Permalink:  ../100d39-673f5c00-35-5ccfd100@179797392/
Also on:    postgresql.org/message-id/100d39-673f5c00-35-5ccfd100@179797392

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: v.davydov@postgrespro.ru
  Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
  In-Reply-To: <100d39-673f5c00-35-5ccfd100@179797392>
  References: <1d12d2-67235980-35-19a406a0@63439497> <683f3c82-d38e-436d-88fd-27722af62005@vondra.me> <fb689-673f4a00-25-21dfc440@244947041> <100d39-673f5c00-35-5ccfd100@179797392>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox