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/5985~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/5985
Choose a head ref
  • 1 commit
  • 20 files changed
  • 1 contributor

Commits on Sep 2, 2025

  1. Add max_retention_duration option to subscriptions.

    This commit introduces a new subscription parameter,
    max_retention_duration, aimed at mitigating excessive accumulation of dead
    tuples when retain_dead_tuples is enabled and the apply worker lags behind
    the publisher.
    
    When the time spent advancing a non-removable transaction ID exceeds the
    max_retention_duration threshold, the apply worker will stop retaining
    conflict detection information. In such cases, the conflict slot's xmin
    will be set to InvalidTransactionId, provided that all apply workers
    associated with the subscription (with retain_dead_tuples enabled) confirm
    the retention duration has been exceeded.
    
    To ensure retention status persists across server restarts, a new column
    subretentionactive has been added to the pg_subscription catalog. This
    prevents unnecessary reactivation of retention logic after a restart.
    
    The conflict detection slot will not be automatically re-initialized
    unless a new subscription is created with retain_dead_tuples = true, or
    the user manually re-enables retain_dead_tuples.
    
    A future patch will introduce support for automatic slot re-initialization
    once at least one apply worker confirms that the retention duration is
    within the configured max_retention_duration.
    
    Author: Zhijie Hou <[email protected]>
    Reviewed-by: shveta malik <[email protected]>
    Reviewed-by: Nisha Moond <[email protected]>
    Reviewed-by: Masahiko Sawada <[email protected]>
    Reviewed-by: Dilip Kumar <[email protected]>
    Reviewed-by: Amit Kapila <[email protected]>
    Discussion: https://postgr.es/m/OS0PR01MB5716BE80DAEB0EE2A6A5D1F5949D2@OS0PR01MB5716.jpnprd01.prod.outlook.com
    Amit Kapila committed Sep 2, 2025
    Configuration menu
    Copy the full SHA
    a850be2 View commit details
    Browse the repository at this point in the history
Loading