Re: [HACKERS] Restricting maximum keep segments by repslots
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: jgdr@dalibo.com
Cc: 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: 2019-07-31T07:56:16Z
Lists: pgsql-hackers
Attachments
- v16-0001-Add-WAL-relief-vent-for-replication-slots.patch (text/x-patch)
At Tue, 30 Jul 2019 21:30:45 +0900 (Tokyo Standard Time), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in <20190730.213045.221405075.horikyota.ntt@gmail.com>
> I attach the revised patch. I'll repost the polished version
> sooner.
This is the revised patch.
- Status criteria has been changed.
"streaming" : restart_lsn is within max_wal_size. (and kept)
"keeping" : restart_lsn is behind max_wal_size but still kept
by max_slot_wal_keep_size or wal_keep_segments.
"losing" : The segment for restart_lsn is being lost or has
been lost, but active walsender (or session) using the
slot is still running. If the walsender caught up before
stopped, the state will transfer to "keeping" or
"streaming" again.
"lost" : The segment for restart_lsn has been lost and the
active session on the slot is gone. The standby cannot
continue replication using this slot.
null : restart_lsn is null (never activated).
- remain is null if restart_lsn is null (never activated) or
wal_status is "losing" or "lost".
- catalogs.sgml is updated.
- Refactored GetLsnAvailability and GetOldestKeepSegment and
pg_get_replication_slots.
- TAP test is fied. But test for "losing" state cannot be done
since it needs interactive session. (I think using isolation
tester is too much)..
reards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
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