Re: patch to allow disable of WAL recycling
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: robertmhaas@gmail.com
Cc: peter.eisentraut@2ndquadrant.com, jerry.jelinek@joyent.com,
andres@anarazel.de, pgsql-hackers@postgresql.org
Date: 2018-07-19T03:51:17Z
Lists: pgsql-hackers
Attachments
- v2-0001-Fix-calculation-base-of-WAL-recycling.patch (text/x-patch)
At Thu, 19 Jul 2018 12:37:26 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote in <20180719.123726.00899102.horiguchi.kyotaro@lab.ntt.co.jp> > 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. Fixed a comment in the patch, which was unreadable. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Add wal_recycle and wal_init_zero GUCs.
- 475861b2615d 12.0 landed
-
Add GUC and storage parameter to set the maximum size of GIN pending list.
- a1b395b6a26a 9.5.0 cited