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

Commits on Aug 12, 2025

  1. Implement a DSA for LWLock tranche names

    Previously, only LWLock tranches registered during postmaster startup were
    available to all backends via a tranche name array inherited through fork.
    Other backends that wanted to know about a tranche name had to register it
    using LWLockRegisterTranche. While this design worked as intended, it was
    not ideal because if a backend did not call LWLockRegisterTranche, it would
    show a generic "extension" wait_event name in pg_stat_activity instead of
    the actual tranche name. This caused inconsistencies with other backends
    that registered the tranche name.
    
    Commit fe07100 made dynamic creation of named DSA areas (and dshash)
    much simpler for a backend, so it is anticipated that fewer tranche names
    will be registered during postmaster startup in the future, with more
    registered dynamically. This will make the above issue more common.
    
    To address this, this change introduces a DSA to store LWLock tranche names
    after postmaster startup. When a backend looks up a tranche name by tranche ID,
    it first checks its local cache; if the name is not found locally, it fetches
    it from the DSA and caches it for future lookups.
    
    This also simplifies the API for registering tranche names: all registration
    work is now done via LWLockNewTrancheId, which accepts a tranche name. The
    LWLockRegisterTranche call is no longer required.
    
    Additionally, while users should not pass arbitrary tranche IDs (that is,
    IDs not created via LWLockNewTrancheId) to LWLockInitialize, nothing
    technically prevents them from doing so. Therefore, we must continue to
    handle such cases gracefully by returning a default "extension" tranche name.
    
    Discussion: https://www.postgresql.org/message-id/flat/CAA5RZ0vvED3naph8My8Szv6DL4AxOVK3eTPS0qXsaKi%3DbVdW2A%40mail.gmail.com
    samimseih authored and Commitfest Bot committed Aug 12, 2025
    Configuration menu
    Copy the full SHA
    835d44f View commit details
    Browse the repository at this point in the history
  2. [CF 5940] v6 - Improve LWLock tranche name visibility across backends

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5940
    
    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/CAA5RZ0siw2MrVjf9iPYRpe8sgZW+TJRqmxKfCr=QS9mX+ZF8Lw@mail.gmail.com
    Author(s): Sami Imseih
    Commitfest Bot committed Aug 12, 2025
    Configuration menu
    Copy the full SHA
    1536f5d View commit details
    Browse the repository at this point in the history
Loading