From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Evgeny Morozov <postgresql3@realityexists.net>
Cc: PostgreSQL General <pgsql-general@postgresql.org>
Subject: Re: "PANIC: could not open critical system index 2662" - twice
Date: Tue, 9 May 2023 07:55:13 +0900
Message-ID: <ZFl90XRIOcDZd8j7@paquier.xyz> (raw)
In-Reply-To: <486434.1683583463@sss.pgh.pa.us>
References: <CA+hUKGK7A42wpGvW3HouYAy+ud9c_8=5=jsaByR2-oxnbFkpZA@mail.gmail.com>
<01020187f07f341f-d1593cf8-4fc7-4186-b70c-0c8862a2aa32-000000@eu-west-1.amazonses.com>
<CA+hUKGJ-yWVQGJQiK5XHpD+97Qc533mNr1L=-sOQmCqDYoMB-w@mail.gmail.com>
<CA+hUKGJDfBEfqatSsV16XosCkr=3k2vb6X1mcbL_kdod_wHQwQ@mail.gmail.com>
<4029098.1683422490@sss.pgh.pa.us>
<CA+hUKGJ5zz8a6-D5ZQcoftZbAeBDs_h_3NL87TndKhW_2_aw1Q@mail.gmail.com>
<ZFhdcLp3x5Pg5Qr4@paquier.xyz>
<CAFiTN-uKc46MGgkCB9Dim14_Xq23NQznZXSLRdZ-hgjxVBGRYA@mail.gmail.com>
<ZFltg5dFMqG92UeV@paquier.xyz>
<486434.1683583463@sss.pgh.pa.us>
On Mon, May 08, 2023 at 06:04:23PM -0400, Tom Lane wrote:
> Andres seems to think it's a problem with aborting a DROP DATABASE.
> Adding more data might serve to make the window wider, perhaps.
And the odds get indeed much better once I use these two toys:
CREATE OR REPLACE FUNCTION create_tables(num_tables int)
RETURNS VOID AS
$func$
BEGIN
FOR i IN 1..num_tables LOOP
EXECUTE format('
CREATE TABLE IF NOT EXISTS %I (id int)', 't_' || i);
END LOOP;
END
$func$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION drop_tables(num_tables int)
RETURNS VOID AS
$func$
BEGIN
FOR i IN 1..num_tables LOOP
EXECUTE format('
DROP TABLE IF EXISTS %I', 't_' || i);
END LOOP;
END
$func$ LANGUAGE plpgsql;
And then use this loop with the others I have mentioned upthread (just
create origindb and the functions in them):
while true;
do psql -c 'select create_tables(1000)' origindb > /dev/null 2>&1 ;
psql testdb -c "select 1" > /dev/null 2>&1 ;
psql -c 'select drop_tables(1000)' origindb > /dev/null 2>&1 ;
psql testdb -c "select 1" > /dev/null 2>&1 ;
done;
On top of that, I have also been able to reproduce the issue on HEAD,
and luckily some pg_class file remain around, full of zeros:
$ hexdump ./base/199634/1259
0000000 0000 0000 0000 0000 0000 0000 0000 0000
The contents of 2662, though, looked OK.
Echoing Alvaro.. Could we, err, revisit the choice of making WAL_LOG
the default strategy even for this set of minor releases? FWIW, I've
mentioned that this choice was too aggressive in the thread of
8a86618..
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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-general@postgresql.org
Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, dilipbalaut@gmail.com, thomas.munro@gmail.com, postgresql3@realityexists.net
Subject: Re: "PANIC: could not open critical system index 2662" - twice
In-Reply-To: <ZFl90XRIOcDZd8j7@paquier.xyz>
References: <CA+hUKGK7A42wpGvW3HouYAy+ud9c_8=5=jsaByR2-oxnbFkpZA@mail.gmail.com> <01020187f07f341f-d1593cf8-4fc7-4186-b70c-0c8862a2aa32-000000@eu-west-1.amazonses.com> <CA+hUKGJ-yWVQGJQiK5XHpD+97Qc533mNr1L=-sOQmCqDYoMB-w@mail.gmail.com> <CA+hUKGJDfBEfqatSsV16XosCkr=3k2vb6X1mcbL_kdod_wHQwQ@mail.gmail.com> <4029098.1683422490@sss.pgh.pa.us> <CA+hUKGJ5zz8a6-D5ZQcoftZbAeBDs_h_3NL87TndKhW_2_aw1Q@mail.gmail.com> <ZFhdcLp3x5Pg5Qr4@paquier.xyz> <CAFiTN-uKc46MGgkCB9Dim14_Xq23NQznZXSLRdZ-hgjxVBGRYA@mail.gmail.com> <ZFltg5dFMqG92UeV@paquier.xyz> <486434.1683583463@sss.pgh.pa.us> <ZFl90XRIOcDZd8j7@paquier.xyz>
* 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