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/5369~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/5369
Choose a head ref
  • 4 commits
  • 25 files changed
  • 2 contributors

Commits on Mar 23, 2025

  1. initdb: Add --no-sync-data-files.

    This new option instructs initdb to skip synchronizing any files
    in database directories and the database directories themselves,
    i.e., everything in the base/ subdirectory and any other
    tablespace directories.  Other files, such as those in pg_wal/ and
    pg_xact/, will still be synchronized unless --no-sync is also
    specified.  --no-sync-data-files is primarily intended for internal
    use by tools that separately ensure the skipped files are
    synchronized to disk.  A follow-up commit will use this to help
    optimize pg_upgrade's file transfer step.
    
    Reviewed-by: Greg Sabino Mullane <[email protected]>
    Reviewed-by: Bruce Momjian <[email protected]>
    Reviewed-by: Robert Haas <[email protected]>
    Discussion: https://postgr.es/m/Zyvop-LxLXBLrZil%40nathan
    nathan-bossart authored and Commitfest Bot committed Mar 23, 2025
    Configuration menu
    Copy the full SHA
    7152d6d View commit details
    Browse the repository at this point in the history
  2. pg_dump: Add --sequence-data.

    This new option instructs pg_dump to dump sequence data when the
    --no-data, --schema-only, or --statistics-only option is specified.
    This was originally considered for commit a7e5457, but it was
    left out at that time because there was no known use-case.  A
    follow-up commit will use this to optimize pg_upgrade's file
    transfer step.
    
    Reviewed-by: Greg Sabino Mullane <[email protected]>
    Reviewed-by: Bruce Momjian <[email protected]>
    Reviewed-by: Robert Haas <[email protected]>
    Discussion: https://postgr.es/m/Zyvop-LxLXBLrZil%40nathan
    nathan-bossart authored and Commitfest Bot committed Mar 23, 2025
    Configuration menu
    Copy the full SHA
    93bdf66 View commit details
    Browse the repository at this point in the history
  3. pg_upgrade: Add --swap for faster file transfer.

    This new option instructs pg_upgrade to move the data directories
    from the old cluster to the new cluster and then to replace the
    catalog files with those generated for the new cluster.  This mode
    can outperform --link, --clone, --copy, and --copy-file-range,
    especially on clusters with many relations.
    
    However, this mode creates many garbage files in the old cluster,
    which can prolong the file synchronization step.  To handle that,
    we use "initdb --sync-only --no-sync-data-files" for file
    synchronization, and we synchronize the catalog files as they are
    transferred.  We assume that the database files transferred from
    the old cluster were synchronized prior to upgrade.
    
    This mode also complicates reverting to the old cluster, so we
    recommend restoring from backup upon failure during or after file
    transfer.  We did consider teaching pg_upgrade how to generate a
    revert script for such failures, but we decided against it due to
    the rarity of failing during file transfer, the complexity of
    generating the script, and the potential for misusing the script.
    
    The new mode is limited to clusters located in the same file
    system.  With some effort, we could probably support upgrades
    between different file systems, but this mode is unlikely to offer
    much benefit if we have to copy the files across file system
    boundaries.
    
    It is also limited to upgrades from version 10 or newer.  There are
    a few known obstacles for using swap mode to upgrade from older
    versions.  For example, the visibility map format changed in v9.6,
    and the sequence tuple format changed in v10.  In fact, swap mode
    omits the --sequence-data option in its uses of pg_dump and instead
    reuses the old cluster's sequence data files.  While teaching swap
    mode to deal with these kinds of changes is surely possible (and we
    may have to deal with similar problems in the future, anyway), it
    doesn't seem worth the effort to support upgrades from
    long-unsupported versions.
    
    Reviewed-by: Greg Sabino Mullane <[email protected]>
    Reviewed-by: Bruce Momjian <[email protected]>
    Reviewed-by: Robert Haas <[email protected]>
    Discussion: https://postgr.es/m/Zyvop-LxLXBLrZil%40nathan
    nathan-bossart authored and Commitfest Bot committed Mar 23, 2025
    Configuration menu
    Copy the full SHA
    d2729f2 View commit details
    Browse the repository at this point in the history
  4. [CF 5369] v9 - optimize file transfer in pg_upgrade

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5369
    
    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/Z9x5MVjWO7zVwrJ0@nathan
    Author(s): Nathan Bossart
    Commitfest Bot committed Mar 23, 2025
    Configuration menu
    Copy the full SHA
    fb0c90f View commit details
    Browse the repository at this point in the history
Loading