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/5378~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/5378
Choose a head ref
  • 3 commits
  • 45 files changed
  • 2 contributors

Commits on Jul 7, 2025

  1. Preserve conflict-relevant data during logical replication.

    Logical replication requires reliable conflict detection to maintain data
    consistency across nodes. To achieve this, we must prevent premature
    removal of tuples deleted by other origins and their associated commit_ts
    data by VACUUM, which could otherwise lead to incorrect conflict reporting
    and resolution.
    
    This patch introduces a mechanism to retain deleted tuples on the
    subscriber during the application of concurrent transactions from remote
    nodes. Retaining these tuples allows us to correctly ignore concurrent
    updates to the same tuple. Without this, an UPDATE might be misinterpreted
    as an INSERT during resolutions due to the absence of the original tuple.
    
    Additionally, we ensure that origin metadata is not prematurely removed by
    vacuum freeze, which is essential for detecting update_origin_differs and
    delete_origin_differs conflicts.
    
    To support this, a new replication slot named pg_conflict_detection is
    created and maintained by the launcher on the subscriber. Each apply
    worker tracks its own non-removable transaction ID, which the launcher
    aggregates to determine the appropriate xmin for the slot, thereby
    retaining necessary tuples.
    
    Conflict information retention (deleted tuples and commit_ts) can be
    enabled per subscription via the retain_conflict_info option. This is
    disabled by default to avoid unnecessary overhead for configurations that
    do not require conflict resolution or logging.
    
    During upgrades, if any subscription on the old cluster has
    retain_conflict_info enabled, a conflict detection slot will be created to
    protect relevant tuples from deletion when the new cluster starts.
    
    This is a foundational work to correctly detect update_deleted conflict
    which will be done in a follow-up patch.
    
    Bump catalog version
    
    Author: Zhijie Hou <[email protected]>
    Reviewed-by: shveta malik <[email protected]>
    Reviewed-by: Masahiko Sawada <[email protected]>
    Reviewed-by: Dilip Kumar <[email protected]>
    Reviewed-by: Nisha Moond <[email protected]>
    Reviewed-by: Amit Kapila <[email protected]>
    Reviewed-by: Hayato Kuroda <[email protected]>
    Discussion: https://postgr.es/m/OS0PR01MB5716BE80DAEB0EE2A6A5D1F5949D2@OS0PR01MB5716.jpnprd01.prod.outlook.com
    Hou Zhijie authored and Commitfest Bot committed Jul 7, 2025
    Configuration menu
    Copy the full SHA
    ab120fc View commit details
    Browse the repository at this point in the history
  2. refactor launcher slot creation

    Hou Zhijie authored and Commitfest Bot committed Jul 7, 2025
    Configuration menu
    Copy the full SHA
    fd9abf9 View commit details
    Browse the repository at this point in the history
  3. [CF 5378] v48 - Conflict detection for update_deleted in logical repl…

    …ication
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5378
    
    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/OS0PR01MB5716ECC539008C85E7AB65C5944FA@OS0PR01MB5716.jpnprd01.prod.outlook.com
    Author(s): Zhijie Hou
    Commitfest Bot committed Jul 7, 2025
    Configuration menu
    Copy the full SHA
    b61c30a View commit details
    Browse the repository at this point in the history
Loading