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-12-26T09:08:12Z
Lists: pgsql-hackers
At Tue, 24 Dec 2019 21:26:14 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in 
> The attached v17 patch is changed in the follwing points.
> 
> - Rebased to the current master.
> 
> - Change KeepLogSeg not to emit the message "Slot %s lost %ld
>   segment(s)" if the slot list is not changed.
> 
> - Documentation is fixed following  the change of state names.
> 
> - Change GetLsnAvailability returns more correct state for wider
>   situations. It returned a wrong status when max_slot_wal_keep_size
>   is smaller than max_wal_size, or when max_slot_wal_keep_size is
>   increased so that the new value covers the restart_lsn of a slot
>   that have lost required segments in the old setting.
> 
>   Since it is needed by the above change, I revived
>   GetOldestXLogFileSegNo() that was removed in v15 as
>   FindOldestXLogFileSegNo() in a bit different shape.

I'd like to re-enter this patch to the next cf.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



Commits

  1. Save slot's restart_lsn when invalidated due to size

  2. Fix checkpoint signalling

  3. Check slot->restart_lsn validity in a few more places

  4. Allow users to limit storage reserved by replication slots

  5. Remove header noise from test_decoding test

  6. Rework WAL-reading supporting structs

  7. Flip argument order in XLogSegNoOffsetToRecPtr