Re: [HACKERS] Restricting maximum keep segments by repslots
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: jgdr@dalibo.com, andres@anarazel.de, michael@paquier.xyz, sawada.mshk@gmail.com, peter.eisentraut@2ndquadrant.com, pgsql-hackers@lists.postgresql.org, thomas.munro@enterprisedb.com, sk@zsrv.org, michael.paquier@gmail.com
Date: 2020-03-31T19:59:05Z
Lists: pgsql-hackers
Attachments
- v21-0001-Add-WAL-relief-vent-for-replication-slots.patch (text/x-diff)
On 2020-Mar-31, Alvaro Herrera wrote:
> On 2020-Mar-31, Alvaro Herrera wrote:
>
> > I'm not sure if I explained my proposal clearly. What if
> > XLogGetLastRemovedSegno returning zero means that every segment is
> > valid? We don't need to scan pg_xlog at all.
>
> I mean this:
[v21 does it that way. Your typo fixes are included, but not the
LastRemoved stuff being discussed here. I also edited the shortdesc in
guc.c to better match {min,max}_wal_size.]
Hmm ... but if the user runs pg_resetwal to remove WAL segments, then
this will work badly for a time (until a segment is removed next). I'm
not very worried for that scenario, since surely the user will have to
reclone any standbys anyway. I think your v20 behaves better in that
case. But I'm not sure we should have that code to cater only to that
case ... seems to me that it will go untested 99.999% of the time.
Maybe you're aware of some other cases where lastRemovedSegNo is not
correct for the purposes of this feature?
I pushed the silly test_decoding test adjustment to get it out of the
way.
/me tries to figure out KeepLogSeg next
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Save slot's restart_lsn when invalidated due to size
- 12e52ba5a76e 13.0 landed
- 0188bb82531f 14.0 landed
-
Fix checkpoint signalling
- 1816a1c6ffe4 13.0 landed
-
Check slot->restart_lsn validity in a few more places
- d0abe78d8427 13.0 landed
-
Allow users to limit storage reserved by replication slots
- c6550776394e 13.0 landed
-
Remove header noise from test_decoding test
- 69360b34589b 13.0 landed
-
Rework WAL-reading supporting structs
- 709d003fbd98 13.0 cited
-
Flip argument order in XLogSegNoOffsetToRecPtr
- a22445ff0be2 12.0 cited