Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Date: 2016-02-09 00:07:34
Message-ID: CAB7nPqRjxdQQJcURm_s8BW4g3SnT31ytXMDZ1SbT5KcgkCwskA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, Feb 8, 2016 at 11:24 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Mon, Feb 8, 2016 at 12:28 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
> wrote:
>>
>>
>> >> /*
>> >> + * Fetch the progress position before taking any WAL insert lock.
>> >> This
>> >> + * is normally an operation that does not take long, but leaving
>> >> this
>> >> + * lookup out of the section taken an exclusive lock saves a
>> >> couple
>> >> + * of instructions.
>> >> + */
>> >> + progress_lsn = GetProgressRecPtr();
>> >
>> > too long for my taste. How about:
>> > /* get progress, before acuiring insert locks to shorten locked section
>> > */
>>
>> Check.
>>
>
> What is the need of holding locks one-by-one during checkpoint when
> we anyway are going to take lock on all the insertion slots.

A couple of records can slip in while scanning the progress LSN
through all the locks.

> + * to not rely on taking an exclusive lock an all the WAL insertion locks,
>
> /an all/on all

Nice catch.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2016-02-09 01:32:52 Re: BUG #13917: "upsert" construct doesn't work with partial index
Previous Message xtracoder 2016-02-08 20:29:59 BUG #13937: 'src' -> jsonb_each() -> jsonb_object() -> 'dst' does not recreate 'src' as valid jsonb

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-02-09 00:57:18 Re: 2016-01 Commitfest
Previous Message Andres Freund 2016-02-09 00:00:03 Re: a raft of parallelism-related bug fixes