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
  • 6 commits
  • 12 files changed
  • 3 contributors

Commits on May 5, 2025

  1. Add injection points to test replication slot advance

    New injection points:
    
    * 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 a next WAL segment.
    
    Original patch by: Tomas Vondra <tomas@vondra.me>
    Modified by: Vitaly Davydov <v.davydov@postgrespro.ru>
    Discussion: https://www.postgresql.org/message-id/flat/1d12d2-67235980-35-19a406a0%4063439497
    tvondra authored and Commitfest Bot committed May 5, 2025
    Copy the full SHA
    29d8182 View commit details
  2. Add TAP test to check logical repl slot advance during checkpoint

    The test verifies that logical replication slot is still valid after
    immediate restart on checkpoint completion in case when the slot was
    advanced during checkpoint.
    
    Original patch by: Tomas Vondra <tomas@vondra.me>
    Modified by: Vitaly Davydov <v.davydov@postgrespro.ru>
    Discussion: https://www.postgresql.org/message-id/flat/1d12d2-67235980-35-19a406a0%4063439497
    tvondra authored and Commitfest Bot committed May 5, 2025
    Copy the full SHA
    2a712fa View commit details
  3. Add TAP test to check physical repl slot advance during checkpoint

    The test verifies that the physical replication slot is still valid
    after immediate restart on checkpoint completion in case when the slot
    was advanced during checkpoint.
    
    Discussion: https://www.postgresql.org/message-id/flat/1d12d2-67235980-35-19a406a0%4063439497
    Vitaly Davydov authored and Commitfest Bot committed May 5, 2025
    Copy the full SHA
    c5b5cf6 View commit details
  4. Keep WAL segments by slot's flushed restart LSN

    The patch fixes the issue with unexpected removal of old WAL segments
    after checkpoint followed by immediate restart. The issue occurs when a
    slot is advanced after the start of checkpoint and before old WAL
    segments removal at end of 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 oldest LSN for WAL segments removal at the end of
    checkpoint. This idea was proposed by Tomas Vondra in the discussion.
    
    Discussion:
    https://www.postgresql.org/message-id/flat/1d12d2-67235980-35-19a406a0%4063439497
    Vitaly Davydov authored and Commitfest Bot committed May 5, 2025
    Copy the full SHA
    5ee12b0 View commit details
  5. 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.
    Vitaly Davydov authored and Commitfest Bot committed May 5, 2025
    Copy the full SHA
    58bd6a6 View commit details
  6. [CF 5627] Fix oldest LSN calculation for WAL segments removal when sl…

    …ots 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/3ea6a1-68150580-1-7b53be0@80017081
    Author(s): Vitaly Davydov
    Commitfest Bot committed May 5, 2025
    Copy the full SHA
    1c719e3 View commit details
Loading