Re: Fix checkpoint skip logic on idle systems by tracking LSN progress

From: David Steele <david(at)pgmasters(dot)net>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix checkpoint skip logic on idle systems by tracking LSN progress
Date: 2016-09-29 15:26:29
Message-ID: 30095aea-3910-dbb7-1790-a579fb93fa5e@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/28/16 10:32 PM, Michael Paquier wrote:
> On Thu, Sep 29, 2016 at 7:45 AM, David Steele <david(at)pgmasters(dot)net> wrote:
>>
>> In general I agree with the other comments that this could end up being
>> a problem. On the other hand, since the additional locks are only taken
>> at checkpoint or archive_timeout it may not be that big a deal.
>
> Yes, I did some tests on my laptop a couple of months back, that has 4
> cores. After reducing NUM_XLOGINSERT_LOCKS from 8 to 4 to increase
> contention and performing a bunch of INSERT using 4 clients on 4
> different relations I could not catch a difference.. Autovacuum was
> disabled to eliminate any noise. I tried checkpoint_segments at 30s to
> see its effects, as well as larger values to see the impact with the
> standby snapshot taken by the bgwriter. Other thoughts are welcome.

I don't have any better ideas than that.

>> +++ b/src/backend/postmaster/checkpointer.c
>> + /* OK, it's time to switch */
>> + elog(LOG, "Request XLog Switch");
>>
>> LOG level seems a bit much here, perhaps DEBUG1?
>
> That's from Horiguchi-san's patch, and those would be definitely
> better as DEBUG1 by looking at it. Now and in order to keep things
> simple I think that we had better discard this patch for now. I was
> planning to come back to this thing anyway once we are done with the
> first problem.

I still see this:

+++ b/src/backend/postmaster/checkpointer.c
/* OK, it's time to switch */
+ elog(LOG, "Request XLog Switch");

> Well for now attached are two patches, that could just be squashed into one.

Yes, I think that makes sense.

More importantly, there is a regression. With your new patch the xlogs
are switching on archive_timeout again even with no changes. The v12
worked fine.

The differences are all in 0002-hs-checkpoints-v12-2.patch and as far as
I can see the patch does not work correctly without these changes. Am I
missing something?

--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-09-29 15:29:09 Re: "Re: Question about grant create on database and pg_dump/pg_dumpall
Previous Message Heikki Linnakangas 2016-09-29 15:10:03 Re: Tuplesort merge pre-reading