Re: BUG #17372: Altering statistics during concurrent drop can lead to a server crash

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17372: Altering statistics during concurrent drop can lead to a server crash
Date: 2022-01-21 06:00:00
Message-ID: a652653f-b669-cb3a-6116-663e335a5012@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-01-21 09:22:39 BUG #17376: Adding unique column with a function() default results in "could not read block 0 in file" error
Previous Message Liam Bowen 2022-01-21 05:29:02 Re: Further information on BUG #17299: Exit code 3 when open connections concurrently (PQisthreadsafe() == 1)