Re: Allow processes to reset procArrayGroupNext themselves instead of leader resetting for all the followers

From: Andres Freund <andres(at)anarazel(dot)de>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow processes to reset procArrayGroupNext themselves instead of leader resetting for all the followers
Date: 2022-11-26 21:18:13
Message-ID: 20221126211813.ywof2tod34fkfs55@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-11-24 10:43:46 +0530, Bharath Rupireddy wrote:
> While working on something else, I noticed that the proc array group
> XID clearing leader resets procArrayGroupNext of all the followers
> atomically along with procArrayGroupMember. ISTM that it's enough for
> the followers to exit the wait loop and continue if the leader resets
> just procArrayGroupMember, the followers can reset procArrayGroupNext
> by themselves. This relieves the leader a bit, especially when there
> are many followers, as it avoids a bunch of atomic writes and
> pg_write_barrier() for the leader .

I doubt this is a useful change - the leader already has to modify the
relevant cacheline (for procArrayGroupMember). That makes it pretty much free
to modify another field in the same cacheline.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-11-26 21:25:29 Re: MSVC vs Perl
Previous Message Andres Freund 2022-11-26 21:13:36 Re: Decouple last important WAL record LSN from WAL insert locks