From: Alexander Lakhin <exclusion@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17372: Altering statistics during concurrent drop can lead to a server crash
Date: Fri, 21 Jan 2022 09:00:00 +0300
Message-ID: <a652653f-b669-cb3a-6116-663e335a5012@gmail.com> (raw)
In-Reply-To: <2615f158-b790-4176-11ad-9711e4fd56c7@enterprisedb.com>
References: <17372-bf3b6e947e35ae77@postgresql.org>
<2615f158-b790-4176-11ad-9711e4fd56c7@enterprisedb.com>
Hello Tomas,
20.01.2022 20:57, Tomas Vondra wrote:
> Thanks for the report - I've reproduced it using your script (I had to
> add a short wait before the syscache lookup). The issue is fairly
> simple, we never check we actually found a tuple in the syscache, i.e.
> there's no HeapTupleIsValid() call. We check the OID earlier, but the
> tuple may have disappeared since then.
>
> IMO the usual "cache lookup failed" error that we throw in other places
> in similar cases is good enough. We already fail with other errors
> (tuple concurrently updated/deleted) here.
Yes, the rough, but simple search:
grep -Porz
'.*=\s*SearchSysCache1.*\n(?!(.*|.*\n.*|.*\n.*\n.*|.*\n.*\n.*\n.*)HeapTupleIsValid)'
./
finds only this place.
Your fix works for me.
Thanks!
Best regards,
Alexander
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: exclusion@gmail.com, tomas.vondra@enterprisedb.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17372: Altering statistics during concurrent drop can lead to a server crash
In-Reply-To: <a652653f-b669-cb3a-6116-663e335a5012@gmail.com>
* 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