postgres-github.git / summary / log / commit / refs

commit    cb096e6d6981e0a4b25beb46ab0cf9154971123a
Author:   Alexander Korotkov <akorotkov@postgresql.org>
Date:     Sun May 03 13:20:16 2026 +0000

    Improve WAIT FOR LSN test coverage
    
    Add regression coverage for several WAIT FOR LSN edge cases.
    
    First, cover fresh walreceiver shared-memory initialization after a
    standby restart.  Restart the standby while its upstream is down, so
    RequestXLogStreaming() seeds writtenUpto/flushedUpto to the
    segment-aligned receiveStart and the walreceiver cannot immediately
    advance them.  Verify that the seeded flush position is segment-aligned,
    that replay can be ahead of it, and that standby_write/standby_flush
    still succeed for an already-replayed LSN via the replay-position floor
    in GetCurrentLSNForWaitType().
    
    Second, add fencepost checks for the target <= currentLSN predicate.
    With replay paused and walreceiver stopped, verify exact boundaries for
    standby_replay using pg_last_wal_replay_lsn(), and for standby_flush
    using pg_last_wal_receive_lsn().  Also verify that a waiter for
    current + 1 sleeps while replay is paused and wakes with success once
    new WAL is delivered and replay advances.
    
    Finally, add a cascading-standby timeline-switch test.  Start a waiter
    on the downstream standby, promote its upstream, generate WAL on the new
    timeline, and verify that the cascade follows the new timeline and the
    wait completes successfully once replay reaches the target LSN.
    
    Reported-by: Andres Freund <andres@anarazel.de>
    Discussion: https://postgr.es/m/1957514.1775526774%40sss.pgh.pa.us
    Author: Alexander Korotkov <aekorotkov@gmail.com>
    Author: Xuneng Zhou <xunengzhou@gmail.com>

[parent: e7cd592174d9]