Re: brin index vacuum versus transaction snapshots

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: brin index vacuum versus transaction snapshots
Date: 2015-08-04 22:00:17
Message-ID: 20150804220017.GX2441@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:

> Thankfully I found
> another way to solve it, which is to forgo usage of MVCC here and
> instead use SnapshotAny. There's already a mode in
> IndexBuildHeapRangeScan that uses SnapshotAny, but it needs some tweaks
> to do what we need. I'm going to propose a patch along those lines
> shortly.

Here's the promised patch. Includes a new isolation test (which fails
with the old code in two ways: first when using VACUUM it causes the
error message Kevin didn't like to be raised; second when using
brin_summarize_new_values it causes the inserted tuple to not be part of
the summary, which is wrong). This test leaves the pageinspect
extension installed in the isolationtest database, but that seems fine
to me. (No other isolation test installs an extension.)

The error message Kevin complained about is gone, as is some related
commentary. This is replaced by tweaks in IndexBuildHeapRangeScan that
know to do a SnapshotAny scan without being noisy about in progress
insertions/deletions.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
brin-snapshot-2.patch text/x-diff 10.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-08-04 22:13:00 Re: max_worker_processes on the standby
Previous Message Ewan Higgs 2015-08-04 21:55:53 Re: [sqlsmith] Failed assertion in joinrels.c