Re: BUG #16595: Reads fail with "lost saved point in index" error after writes

From: Jesse Kinkead <jesse(at)falkon(dot)ai>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16595: Reads fail with "lost saved point in index" error after writes
Date: 2020-08-27 21:50:09
Message-ID: CAGBNkrpMuKD1Q4Jdoyzvex_-MoCq_2Hbk1EXuKzQeDkM7OtcaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Aug 27, 2020 at 1:39 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Jesse Kinkead <jesse(at)falkon(dot)ai> writes:
> > It sounds like this isn't a known problem,
>
> Well, now it is :-). I'm just finishing up testing a patch.

Awesome!

> > and that the only workaround
> > might be just dropping the index. Hmm!
>
> Single-column GIN indexes aren't subject to the issue, so maybe you
> could work around it by replacing the multicolumn index with some
> single-column ones?

This might be an option for us to try out; thank you.

> Also, now that I've studied the code some more, the code path with
> the issue is only hit for queries that use (a) partial match or
> (b) an empty query that forces a full-index scan, similar to
> "arraycol @> '{}'". That might explain how come the bug went
> undetected for so long. I dunno if that info will help you dodge
> the bug, but maybe.

Interestingly, we're not querying on empty values, but we ARE querying
on multiple values at the same time (jsonb_column @> "value1" AND
jsonb_column @> "value2").

> If you can't find any acceptable workaround, another idea is to
> build your own server version with the patch applied, to tide
> you over until there's an official release with the fix. IMO
> one of the main benefits of using open-source code is that that's
> normally not very difficult.

Indeed! And they frequently have very responsive maintainers. :)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2020-08-27 23:22:42 Re: BUG #16594: DROP INDEX CONCURRENTLY fails on partitioned table with a non helpful error message.
Previous Message Tom Lane 2020-08-27 20:39:23 Re: BUG #16595: Reads fail with "lost saved point in index" error after writes