Re: "ERROR: deadlock detected" when replicating TRUNCATE - Mailing list pgsql-hackers

From Peter Smith
Subject Re: "ERROR: deadlock detected" when replicating TRUNCATE
Date
Msg-id CAHut+Ps-Waj4VBCUtKaPnUOH4un2yfFHhUdBFu9ufmTEQVdk7Q@mail.gmail.com
Whole thread Raw
In response to Re: "ERROR: deadlock detected" when replicating TRUNCATE  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: "ERROR: deadlock detected" when replicating TRUNCATE
List pgsql-hackers
On Mon, May 17, 2021 at 8:13 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Mon, May 17, 2021 at 3:05 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> >
> > On Mon, May 17, 2021 at 12:30 PM Peter Smith <smithpb2250@gmail.com> wrote:
> >
> > > PSA a patch adding a test for this scenario.
> >
> > I am not sure this test case is exactly targeting the problematic
> > behavior because that will depends upon the order of execution of the
> > apply workers right?
> >
>
> Yeah, so we can't guarantee that this test will always reproduce the
> problem but OTOH, I have tried two times and it reproduced both times.
> I guess we don't have a similar test where Truncate will replicate to
> two subscriptions, otherwise, we would have caught such a problem.
> Having said that, I am fine with leaving this test if others feel so
> on the grounds that it won't always lead to the problem reported.
>

If there is any concern that the problem won't always happen then I
think we should just increase the numbers of subscriptions.

Having more simultaneous subscriptions (e.g. I have tried 4). will
make it much more likely for the test to encounter the deadlock, and
it probably would also be quite a useful worker stress test in it's
own right.

~~

Also, should this test be in the 010_truncate,pl, or does it belong in
the 100_bugs.pl?  (I don't know what are the rules for when a test
gets put into 100_bugs.pl)

----------
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_dumpall misses --no-toast-compression
Next
From: Masahiro Ikeda
Date:
Subject: Re: wal stats questions