pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Peter Geoghegan <pg@bowt.ie>
Subject: Re: Amcheck: do rightlink verification with lock coupling
Date: Sat, 11 Jan 2020 02:45:38 +0100
Message-ID: <20200111014538.y4u6fynjeha2nml6@development> (raw)
In-Reply-To: <20190912131612.GA24926@alvherre.pgsql>
References: <0EB0CFA8-CBD8-4296-8049-A2C0F28FAE8C@yandex-team.ru>
	<20190912131612.GA24926@alvherre.pgsql>

On Thu, Sep 12, 2019 at 10:16:12AM -0300, Alvaro Herrera wrote:
>On 2019-Sep-12, Andrey Borodin wrote:
>
>> This patch violates one of amcheck design principles: current code
>> does not ever take more than one page lock. I do not know: should we
>> hold this rule or should we use more deep check?
>
>The check does seem worthwhile to me.
>
>As far as I know, in btree you can lock the right sibling of a page
>while keeping lock on the page itself, without risk of deadlock.  So I'm
>not sure what's the issue with that.  This is in the README:
>
>  In most cases we release our lock and pin on a page before attempting
>  to acquire pin and lock on the page we are moving to.  In a few places
>  it is necessary to lock the next page before releasing the current one.
>  This is safe when moving right or up, but not when moving left or down
>  (else we'd create the possibility of deadlocks).
>
>I suppose Peter was concerned about being able to run amcheck without
>causing any trouble at all for concurrent operation; maybe we can retain
>that property by making this check optional.
>

Peter, any opinion on this proposed amcheck patch? In the other thread
[1] you seemed to agree this is worth checking, and Alvaro's proposal to
make this check optional seems like a reasonable compromise with respect
to the locking.

[1] https://www.postgresql.org/message-id/flat/DA9B33AC-53CB-4643-96D4-7A0BBC037FA1@yandex-team.ru

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





view thread (21+ messages)  latest in thread

Message-ID: <20200111014538.y4u6fynjeha2nml6@development>
Permalink:  ../20200111014538.y4u6fynjeha2nml6@development/
Also on:    postgresql.org/message-id/20200111014538.y4u6fynjeha2nml6@development

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, alvherre@2ndquadrant.com, x4mmm@yandex-team.ru, pg@bowt.ie
  Subject: Re: Amcheck: do rightlink verification with lock coupling
  In-Reply-To: <20200111014538.y4u6fynjeha2nml6@development>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox