ashucoek · GitHub

Commits on Aug 6, 2026

  1. Refactor syncrep parsing to represent bare standby lists explicitly

    The syncrep parser currently reduces a simple list form to FIRST 1
    (SYNC_REP_PRIORITY). That is acceptable for synchronous_standby_names,
    but it loses information about whether FIRST was explicitly written.
    Introduce SYNC_REP_DEFAULT to represent the bare list form parsed
    from standby_list. This allows callers to distinguish:
    - explicit priority syntax (FIRST N (...) or N (...))
    - quorum syntax (ANY N (...))
    - simple list syntax without FIRST/ANY
    With this change:
    - syncrep grammar emits SYNC_REP_DEFAULT for bare standby lists
    - check_synchronous_standby_names() maps SYNC_REP_DEFAULT to
      SYNC_REP_PRIORITY, preserving existing synchronous_standby_names
      behavior
    This is a preparatory patch for future synchronized_standby_slots
    changes, where callers can directly interpret SYNC_REP_DEFAULT as
    plain-list semantics, while keeping existing synchronous_standby_names
    semantics intact.
    Per suggestion from Zhijie Hou <houzj.fnst@fujitsu.com>

    authored and Commitfest Bot committed

    Aug 6, 2026
    Configuration menu

    Browse the repository at this point in the history

  2. Add ANY N semantics to synchronized_standby_slots

    Extend synchronized_standby_slots with quorum syntax for logical
    failover slot synchronization:
    - ANY N (slot1, slot2, ...)
    Plain-list semantics are preserved as-is:
    - slot1, slot2 continues to mean all listed slots are required
    Implementation details:
    - Reuse syncrep parser infrastructure in the GUC check hook and
      map parsed output into synchronized_standby_slots semantics.
    - Consume SYNC_REP_DEFAULT from the preparatory parser refactor to
      distinguish plain-list syntax from explicit parser modes.
    - In StandbySlotsHaveCaughtup(), enforce mode-specific behavior for:
      - existing all-listed-slots semantics (plain list)
      - quorum N-of-M behavior (ANY N)
    - Validation rejects configurations where N exceeds the number of
      listed slots.
    - Ignore duplicate synchronized_standby_slots entries, preserving the
      first occurrence and applying semantics to the resulting unique list.
    - Clarify synchronized_standby_slots comments and lagging restart_lsn
      reporting to match the implemented behavior.
    Tests and docs:
    - Add recovery coverage for plain-list behavior and ANY quorum
      behavior, including lagging-slot and validation-error scenarios.
    - Add duplicate-entry recovery coverage for synchronized_standby_slots.
    - Document ANY syntax and clarify plain-list behavior for this GUC.
    - Document that duplicate slot names are ignored and counted only once.
    Author: Satya Narlapuram <satyanarlapuram@gmail.com>
    Author: Ashutosh Sharma <ashu.coek88@gmail.com>
    Reviewed-by: Shveta Malik <shveta.malik@gmail.com>
    Reviewed-by: Ajin Cherian <itsajin@gmail.com>
    Reviewed-by: Hou, Zhijie <houzj.fnst@fujitsu.com>
    Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
    Reviewed-by: Surya Poondla <suryapoondla4@gmail.com>
    Reviewed-by: Japin Li <japinli@hotmail.com>
    Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>

    ashucoek authored and Commitfest Bot committed

    Aug 6, 2026
    Configuration menu

    Browse the repository at this point in the history

  3. Add FIRST N and N (...) priority syntax to synchronized_standby_slots

    Extend synchronized_standby_slots to support explicit priority
    forms aligned with synchronous_standby_names.
    - FIRST N (slot1, slot2, ...)
    - N (slot1, slot2, ...) as shorthand for FIRST N
    Implementation details:
    - Use the SYNC_REP_DEFAULT parser distinction from the earlier
      refactor so plain-list syntax remains separate from priority
      syntax.
    - Extend StandbySlotsHaveCaughtup() priority handling.
    - Select slots in list order.
    - Skip missing, logical, invalidated, and inactive lagging slots.
    - Wait for active lagging higher-priority slots.
    - Clarify duplicate handling for priority syntax in the
      synchronized_standby_slots documentation.
    - Simplify caught-up comments and clarify standby confirmation
      wait comments to match the final control flow.
    Tests and docs:
    - Add coverage for FIRST behavior and shorthand N (...) behavior.
    - Add plain-list disambiguation with first-prefixed slot names.
    - Add FIRST duplicate-entry recovery coverage to show duplicates
      do not create extra priority positions.
    - Update docs for FIRST and shorthand priority syntax semantics.
    - Clarify that duplicate slot names are ignored in priority-based
      forms and preserve first-occurrence order.
    Author: Satya Narlapuram <satyanarlapuram@gmail.com>
    Author: Ashutosh Sharma <ashu.coek88@gmail.com>
    Reviewed-by: Shveta Malik <shveta.malik@gmail.com>
    Reviewed-by: Ajin Cherian <itsajin@gmail.com>
    Reviewed-by: Hou, Zhijie <houzj.fnst@fujitsu.com>
    Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
    Reviewed-by: Surya Poondla <suryapoondla4@gmail.com>
    Reviewed-by: Japin Li <japinli@hotmail.com>
    Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>

    ashucoek authored and Commitfest Bot committed

    Aug 6, 2026
    Configuration menu

    Browse the repository at this point in the history

  4. Configuration menu

    Browse the repository at this point in the history

Read the original on github.com ↗