pgsql: Fix calculation for WAL segment recycling and removal

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix calculation for WAL segment recycling and removal
Date: 2018-07-24 01:41:08
Message-ID: E1fhmK4-0001l7-HH@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix calculation for WAL segment recycling and removal

Commit 4b0d28de06 has removed the prior checkpoint and related
facilities but has left WAL recycling based on the LSN of the prior
checkpoint, which causes incorrect calculations for WAL removal and
recycling for max_wal_size and min_wal_size. This commit changes things
so as the base calculation point is the last checkpoint generated.

Reported-by: Kyotaro Horiguchi
Author: Kyotaro Horiguchi
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/20180723.135748.42558387.horiguchi.kyotaro@lab.ntt.co.jp
Backpatch: 11-, where the prior checkpoint has been removed.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9915735ebbc5c5362f5834f6ad7b86394ded4a85

Modified Files
--------------
src/backend/access/transam/xlog.c | 159 +++++++++++++++++++-------------------
1 file changed, 78 insertions(+), 81 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2018-07-24 02:39:47 pgsql: Refactor cluster_rel() to handle more options
Previous Message Thomas Munro 2018-07-24 01:10:35 pgsql: Use setproctitle_fast() to update the ps status, if available.