Re: Fix CheckpointStartLock starvation - Mailing list pgsql-patches

From Tom Lane
Subject Re: Fix CheckpointStartLock starvation
Date
Msg-id 9715.1175619584@sss.pgh.pa.us
Whole thread Raw
In response to Fix CheckpointStartLock starvation  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: Fix CheckpointStartLock starvation  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-patches
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> On a busy system, checkpoint could be starved while queuing for the
> CheckpointStartLock. To avoid that, get rid of CheckpointStartLock and
> instead set a flag in PGPROC struct when a commit starts. After
> computing the REDO ptr, checkpoint waits for all backends that had that
> flag set to finish their commits. This eliminates the same race
> condition the CheckpointStartLock was there for, without the risk of
> starvation.

Applied with some revisions --- I did not see the point of forcing
checkpoint to wait till the transaction was fully out of its commit;
we only need it to wait till clog is updated.  The procarray code
seemed overly complicated too.

            regards, tom lane

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: COPY-able sql log outputs
Next
From: Heikki Linnakangas
Date:
Subject: Re: Fix CheckpointStartLock starvation