Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5627~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5627
Choose a head ref
  • 4 commits
  • 9 files changed
  • 2 contributors

Commits on May 31, 2025

  1. Keep WAL segments by the flushed value of the slot's restart LSN

    The patch fixes the issue with the unexpected removal of old WAL segments
    after checkpoint, followed by an immediate restart. The issue occurs when
    a slot is advanced after the start of the checkpoint and before old WAL
    segments are removed at the end of the checkpoint.
    
    The idea of the patch is to get the minimal restart_lsn at the beginning
    of checkpoint (or restart point) creation and use this value when calculating
    the oldest LSN for WAL segments removal at the end of checkpoint. This idea
    was proposed by Tomas Vondra in the discussion.
    
    Discussion: https://postgr.es/m/flat/1d12d2-67235980-35-19a406a0%4063439497
    Author: Vitaly Davydov <v.davydov@postgrespro.ru>
    Reviewed-by: Tomas Vondra <tomas@vondra.me>
    Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
    Backpatch-through: 13
    akorotkov authored and Commitfest Bot committed May 31, 2025
    Configuration menu
    Copy the full SHA
    ecba2fe View commit details
    Browse the repository at this point in the history
  2. Add TAP tests to check replication slot advance during the checkpoint

    The new tests verify that logical and physical replication slots are still
    valid after an immediate restart on checkpoint completion when the slot was
    advanced during the checkpoint.
    
    This commit introduces two new injection points to make these tests possible:
    
    * checkpoint-before-old-wal-removal - triggered in the checkpointer process
      just before old WAL segments cleanup;
    * logical-replication-slot-advance-segment - triggered in
      LogicalConfirmReceivedLocation() when restart_lsn was changed enough to
      point to the next WAL segment.
    
    Discussion: https://postgr.es/m/flat/1d12d2-67235980-35-19a406a0%4063439497
    Author: Vitaly Davydov <v.davydov@postgrespro.ru>
    Author: Tomas Vondra <tomas@vondra.me>
    Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
    Backpatch-through: 17
    akorotkov authored and Commitfest Bot committed May 31, 2025
    Configuration menu
    Copy the full SHA
    1c8558b View commit details
    Browse the repository at this point in the history
  3. Remove redundant ReplicationSlotsComputeRequiredLSN calls

    The function ReplicationSlotsComputeRequiredLSN is used to calculate the
    oldest slots' required LSN. It is called every time when restart_lsn
    value of any slot is changed (for example, when a slot is advancing).
    The slot's oldest required LSN is used to remote old WAL segments in two
    places - when checkpoint or restart point is created (CreateCheckPoint,
    CreateRestartPoint functions). Old WAL segments seems to be truncated in
    these two functions only.
    
    The idea of the patch is to call ReplicationSlotsComputeRequiredLSN in
    CreateCheckPoint or CreateRestartPoint functions only, before call of
    RemoveOldXlogFiles function where old WAL segments are removed. There
    is no obvious need to recalculate oldest required LSN every time when a
    slot's restart_lsn is changed.
    
    The value of the oldest required lsn can affect on slot invalidation.
    The function InvalidateObsoleteReplicationSlots with non zero second
    parameter (oldestSegno) is called in CreateCheckPoint,
    CreateRestartPoint functions only where slot invalidation occurs with
    reason RS_INVAL_WAL_REMOVED. Once we update the oldest slots' required
    lsn in the beginning of these functions, the proposed patch should not
    break the behaviour of slot invalidation function in this case.
    akorotkov authored and Commitfest Bot committed May 31, 2025
    Configuration menu
    Copy the full SHA
    6f65402 View commit details
    Browse the repository at this point in the history
  4. [CF 5627] v7 - Fix oldest LSN calculation for WAL segments removal wh…

    …en slots are advancing during checkpoint
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5627
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/2c1d-68344100-b7-3411b8c0@256938178
    Author(s): Vitaly Davydov
    Commitfest Bot committed May 31, 2025
    Configuration menu
    Copy the full SHA
    6076b11 View commit details
    Browse the repository at this point in the history
Loading