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/6265~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/6265
Choose a head ref
  • 5 commits
  • 14 files changed
  • 2 contributors

Commits on Dec 11, 2025

  1. Extend xlogwait infrastructure with write and flush wait types

    Add support for waiting on WAL write and flush LSNs in addition to the
    existing replay LSN wait type. This provides the foundation for
    extending the WAIT FOR command with MODE parameter.
    
    Key changes:
    - Add WAIT_LSN_TYPE_WRITE and WAIT_LSN_TYPE_FLUSH_STANDBY to WaitLSNType
    - Add GetCurrentLSNForWaitType() to retrieve current LSN
    - Add new wait events WAIT_EVENT_WAIT_FOR_WAL_WRITE and
      WAIT_EVENT_WAIT_FOR_WAL_FLUSH for pg_stat_activity visibility
    - Update WaitForLSN() to use GetCurrentLSNForWaitType() internally
    alterego655 authored and Commitfest Bot committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    19c33a9 View commit details
    Browse the repository at this point in the history
  2. Add MODE parameter to WAIT FOR LSN command

    Extend the WAIT FOR LSN command with an optional MODE parameter that
    specifies which LSN type to wait for:
    
      WAIT FOR LSN '<lsn>' [MODE { REPLAY | WRITE | FLUSH }] [WITH (...)]
    
    - REPLAY (default): Wait for WAL to be replayed to the specified LSN
    - WRITE: Wait for WAL to be written (received) to the specified LSN
    - FLUSH: Wait for WAL to be flushed to disk at the specified LSN
    
    The default mode is REPLAY, matching the original behavior when MODE
    is not specified. This follows the pattern used by LOCK command where
    the mode parameter is optional with a sensible default.
    
    The WRITE and FLUSH modes are useful for scenarios where applications
    need to ensure WAL has been received or persisted on the standby
    without necessarily waiting for replay to complete.
    
    Also includes:
    - Documentation updates for the new syntax and refactoring
      of existing WAIT FOR command documentation
    - Test coverage for all three modes including mixed concurrent waiters
    - Wakeup logic in walreceiver for WRITE/FLUSH waiters
    alterego655 authored and Commitfest Bot committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    b6ca0f2 View commit details
    Browse the repository at this point in the history
  3. Add tab completion for WAIT FOR LSN MODE parameter

    Update psql tab completion to support the optional MODE parameter in
    WAIT FOR LSN command. After specifying an LSN value, completion now
    offers both MODE and WITH keywords since MODE defaults to REPLAY.
    alterego655 authored and Commitfest Bot committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    488388a View commit details
    Browse the repository at this point in the history
  4. Use WAIT FOR LSN in PostgreSQL::Test::Cluster::wait_for_catchup()

    Replace polling-based catchup waiting with WAIT FOR LSN command when
    running on a standby server. This is more efficient than repeatedly
    querying pg_stat_replication as the WAIT FOR command uses the latch-
    based wakeup mechanism.
    
    The optimization applies when:
    - The node is in recovery (standby server)
    - The mode is 'replay', 'write', or 'flush' (not 'sent')
    
    For 'sent' mode or when running on a primary, the function falls back
    to the original polling approach since WAIT FOR LSN is only available
    during recovery.
    alterego655 authored and Commitfest Bot committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    87ac09a View commit details
    Browse the repository at this point in the history
  5. [CF 6265] v4 - Add MODE parameter to WAIT FOR LSN command

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/6265
    
    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/CABPTF7U2cYN=bMZirqj93Zv-aqBdw4f=wPRwovTzWKP=adYhDg@mail.gmail.com
    Author(s): Xuneng Zhou
    Commitfest Bot committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    ce2a644 View commit details
    Browse the repository at this point in the history
Loading