Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Date: 2015-11-04 07:09:41
Message-ID: CAB7nPqS9rxszkk4MjUoDOzGSvoAfQfQeYo+x=mUg29hDsGkxww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Wed, Nov 4, 2015 at 12:43 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2015-11-03 10:23:35 -0500, Robert Haas wrote:
>> On Mon, Nov 2, 2015 at 12:58 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>> > If a transaction holding locks aborts on an otherwise idle server, perhaps it will take a very long time for a log-shipping standby to realize this. But I have hard time believing that anyone who cares about that would be using log-shipping (rather than streaming) anyway.
>>
>> I'm sure other people here understand this better than me, but I
>> wonder if it wouldn't make more sense to somehow log this data only if
>> something material has changed in the data being logged.
>
> Phew. That doesn't seem easy to measure. I'm doubtful that it's worth
> comparing the snapshot and such, especially in the back
> branches.
>
> We could maybe add something that we only log a snapshot if XXX
> megabytes have been logged or something. But I don't know which number
> to pick here - and if there's other write activity the price of a
> snapshot record really isn't high.

My first guess on the matter is that we would like to have an extra
condition that depends on max_wal_size with at least a minimum number
of segments generated since the last standby snapshot, perhaps
max_wal_size / 16, but this coefficient is clearly a rule of thumb.
With the default configuration of 1GB, that would be waiting for 4
segments to be generated before logging in a standby snapshot.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2015-11-04 07:26:58 Re: BUG #13741: vacuumdb does not accept valid password
Previous Message Michael Paquier 2015-11-04 07:01:28 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2015-11-04 07:25:46 Re: Foreign join pushdown vs EvalPlanQual
Previous Message Michael Paquier 2015-11-04 07:01:28 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby