Re: [PATCH] Btree BackwardScan race condition on Standby during VACUUM

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Btree BackwardScan race condition on Standby during VACUUM
Date: 2020-03-22 10:34:38
Message-ID: 399CA39C-E0E0-47C7-A7CE-F13DE5DE16D2@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 18 марта 2020 г., в 00:37, Peter Geoghegan <pg(at)bowt(dot)ie> написал(а):
>
> On Mon, Mar 16, 2020 at 10:20 PM Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>> It seems to me that it's exactly the same check that I was trying to verify in amcheck patch [0].
>> But there it was verified inside amcheck, but here it is verified by index scan.
>
> Maybe we can accept your patch after fixing this bug. My objection to
> the patch was that it couples locks in a way that's not compatible
> with btree_xlog_unlink_page(). But the problem now seems to have been
> btree_xlog_unlink_page() itself. It's possible that there are problems
> elsewhere, but my recollection is that btree_xlog_unlink_page() was
> the problem.

The problem was that btree_xlog_split() and btree_xlog_unlink_page() do not couple locks during fixing left links.
Probably, patch in this thread should fix this in btree_xlog_split() too?

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Floris Van Nee 2020-03-22 12:55:29 RE: Index Skip Scan
Previous Message Pavel Stehule 2020-03-22 09:32:58 Re: optimisation? collation "C" sorting for GroupAggregate for all deterministic collations