Fix calculations on WAL recycling.

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Fix calculations on WAL recycling.
Date: 2018-07-23 04:57:48
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I'll register this to the next commitfest.

> While considering this, I found a bug in 4b0d28de06, which
> removed prior checkpoint from control file. It actually trims the
> segments before the last checkpoint's redo segment but recycling
> is still considered based on the *prevous* checkpoint. As the
> result min_wal_size doesn't work as told. Specifically, setting
> min/max_wal_size to 48MB and advance four or more segments then
> two checkpoints leaves just one segment, which is less than
> min_wal_size.
> The attached patch fixes that. One arguable point on this would
> be the removal of the behavior when RemoveXLogFile(name,
> InvalidXLogRecPtr, ..).
> The only place calling the function with the parameter is
> timeline switching. Previously unconditionally 10 segments are
> recycled after switchpoint but the reason for the behavior is we
> didn't have the information on previous checkpoint at hand at the
> time. But now we can use the timeline switch point as the
> approximate of the last checkpoint's redo point and this allows
> us to use min/max_wal_size properly at the time.


Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v2-0001-Fix-calculation-base-of-WAL-recycling.patch text/x-patch 5.4 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-07-23 05:05:29 Re: code of partition split
Previous Message Thomas Munro 2018-07-23 04:56:56 Re: Possible performance regression in version 10.1 with pgbench read-write tests.