Re: pg_sequence catalog - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: pg_sequence catalog
Date
Msg-id CAA4eK1KrJYnHrfGDBdeY0AmWtVKZziA_+a4aJyTznBaxsx3yGQ@mail.gmail.com
Whole thread Raw
In response to Re: pg_sequence catalog  (Andres Freund <andres@anarazel.de>)
Responses Re: pg_sequence catalog  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Sun, Sep 11, 2016 at 12:39 AM, Andres Freund <andres@anarazel.de> wrote:
> On 2016-09-10 17:23:21 +0530, Amit Kapila wrote:
>> >
>>
>> I may be missing something here, but why would it contend on a lock,
>> as per locking scheme proposed by Alvaro, access to sequence object
>> will need a share lock on buffer page.
>
> To make checkpointing/bgwriter work correctly we need exclusive locks on
> pages while writing..., or some new lock level preventing the page from
> being written out, while "shared dirtying" locks are being held.
>

Right and I think you have a very valid concern, but if we think that
storing multiple sequences on a same page is a reasonable approach,
then we can invent some locking mechanism as indicated by you such
that two writes on same page won't block each other, but they will be
blocked with bgwriter/checkpointer.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Write Ahead Logging for Hash Indexes
Next
From: Amit Kapila
Date:
Subject: Re: WAL consistency check facility