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

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Btree BackwardScan race condition on Standby during VACUUM
Date: 2020-08-01 18:30:29
Message-ID: CAH2-Wz=1RLqEn-cvGUincCX+ji9Yk-tWzLyB_kmoxJpkS+v-xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 16, 2020 at 7:08 AM Michail Nikolaev
<michail(dot)nikolaev(at)gmail(dot)com> wrote:
> While working on support for index hint bits on standby [1] I have
> started to getting
> "ERROR: could not find left sibling of block XXXX in index XXXX"
> during stress tests.

I reproduced the bug using your steps (including the pg_usleep() hack)
today. It was fairly easy to confirm the problem.

Attached is a revised version of your patch. It renames the buffer
variable names, and changes the precise order in which the locks are
released (for consistency with _bt_unlink_halfdead_page()). It also
changes the comments, and adds a new paragraph to the README. The
existing paragraph was about cross-level differences, this new one is
about same-level differences (plus a second new paragraph to talk
about backwards scans + page deletion).

This revised version is essentially the same as your original patch --
I have only made superficial adjuments. I think that I will be able to
commit this next week, barring objections.

--
Peter Geoghegan

Attachment Content-Type Size
v3-0001-Avoid-backwards-scan-page-deletion-standby-race.patch application/octet-stream 7.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2020-08-01 20:42:32 Re: psql - improve test coverage from 41% to 88%
Previous Message James Coleman 2020-08-01 18:15:36 Re: Comment simplehash/dynahash trade-offs