Separating bgwriter and checkpointer - Mailing list pgsql-hackers

From Simon Riggs
Subject Separating bgwriter and checkpointer
Date
Msg-id CA+U5nMLv2ah-HNHaQ=2rxhp_hDJ9jcf-LL2kW3sE4msfnUw9gA@mail.gmail.com
Whole thread Raw
Responses Re: Separating bgwriter and checkpointer
Re: Separating bgwriter and checkpointer
Re: Separating bgwriter and checkpointer
List pgsql-hackers
As discussed previously...

Currently the bgwriter process performs both background writing,
checkpointing and some other duties. This means that we can't perform
the final checkpoint fsync without stopping background writing, so
there is a negative performance effect from doing both things in one
process.

Additionally, our aim in 9.2 is to replace polling loops with latches
for power reduction. The complexity of the bgwriter loops is high and
it seems unlikely to come up with a clean approach using latches.

This patch splits bgwriter into 2 processes: checkpointer and
bgwriter, seeking to avoid contentious changes. Additional changes are
expected in this release to build upon these changes for both new
processes, though this patch stands on its own as both a performance
vehicle and in some ways a refcatoring to simplify the code.

Checkpointer does the important things, "new bgwriter" just does
background writing and so is much less important than before.

Current patch has a bug at shutdown I've not located yet, but seems
likely is a simple error. That is mainly because for personal reasons
I've not been able to work on the patch recently. I expect to be able
to fix that later in the CF.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: "Andrew Dunstan"
Date:
Subject: Re: psql setenv command
Next
From: Fujii Masao
Date:
Subject: Re: Separating bgwriter and checkpointer