Re: confusing checkpoint_flush_after / bgwriter_flush_after

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: confusing checkpoint_flush_after / bgwriter_flush_after
Date: 2016-11-25 12:44:04
Message-ID: f25a3f42-38f8-ed9d-3ed3-cb875d2139e5@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/25/2016 01:20 PM, Fabien COELHO wrote:
>
> Hello Tomas,
>
>> #checkpoint_flush_after = 0 # 0 disables,
>> # default is 256kB on linux, 0 otherwise
>
>> I find this pretty confusing, because for all other GUCs in the file,
>> the commented-out value is the default one. In this case that would
>> mean "0", disabling the flushing.
>>
>> But in practice we use platform-dependent defaults - 256/512K on
>> Linux, 0 otherwise. There are other GUCs where the default is
>> platform-specific, but none of them suggests "disabled" is the default
>> state.
>>
>> While the 9.6 cat is out of the bag, I think we can fix this quite
>> easily - use "-1" to specify the default value should be used, and use
>> that in the sample file. This won't break any user configuration.
>
> Although I understand the issue, I'm not sure about -1 as a special
> value to mean the default.
>

Why? We use wal_buffers=-1 to use the default (depending on the size of
shared_buffers), for example.

>> If that's considered not acceptable, perhaps we should at least
>> improve the comments, so make this clearer.
>
> Yep, what about not putting a value and inverting/adapting the comments,
> maybe something like:
>
> #checkpoint_flush_after = ... # default is 256kB on linux, 0 otherwise
> # where 0 disables flushing
>

Yeah, something like that.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2016-11-25 12:48:56 Re: Dynamic shared memory areas
Previous Message Fabien COELHO 2016-11-25 12:20:00 Re: confusing checkpoint_flush_after / bgwriter_flush_after