Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Alvaro Herrera
On 2023-Feb-22, Tomas Vondra wrote: > > ... and in there, I wrote that we would first write the brin tuple in > > the regular page, unlock that, and then lock the revmap for the update, > > without holding lock on the data page. I don't remember why we do it > > differently now, but maybe the

Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Tomas Vondra
On 2/22/23 12:35, Alvaro Herrera wrote: > On 2023-Feb-22, Tomas Vondra wrote: > >> But instead of I almost immediately ran into a LWLock deadlock :-( > > Ouch. > >> I've managed to reproduce this on PG13+, but I believe it's there since >> the brinRevmapDesummarizeRange was introduced in

Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Alvaro Herrera
On 2023-Feb-22, Tomas Vondra wrote: > But instead of I almost immediately ran into a LWLock deadlock :-( Ouch. > I've managed to reproduce this on PG13+, but I believe it's there since > the brinRevmapDesummarizeRange was introduced in PG10. I just haven't > tried on pre-13 releases. Hmm, I

LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Tomas Vondra
Hi, While finalizing some fixes in BRIN, I decided to stress-test the relevant part of the code to check if I missed something. Imagine a simple script that builds BRIN indexes on random data, does random changes and cross-checks the results with/without the index. But instead of I almost