Thread

  1. Re: Improve LWLock tranche name visibility across backends

    Rahila Syed <rahilasyed90@gmail.com> — 2025-07-15T07:29:04Z

    Hi,
    
    
    >
    > Since DSM is not available during postmaster, if we were to create a DSA
    > segment in place, similar to what's done in StatsShmemInit(), we would also
    > need to ensure that the initial shared memory is sized appropriately. This
    > is
    > because it would need to be large enough to accommodate all user-defined
    > tranches registered during postmaster, without having to rely on new
    > dsm segments.
    > From my experimentation, this sizing is not as straightforward as simply
    > calculating # of tranches * size of a tranche entry.
    >
    > I still think we should create the dsa during postmaster, as we do with
    > StatsShmemInit, but it would be better if postmaster keeps its hands off
    > this
    > dshash and only normal backends can use them.
    >
    > Thoughts?
    >
    >
    Since creating a DSA segment in place during Postmaster startup still
    requires calculating the size of
    the tranche names table including the user-defined tranches, why not use
    static shared memory to
    pre-allocate a fixed sized table and arrays of size NAMEDATALEN to store
    the names?
    
    If a dshash table is used to store tranche names and IDs, where would the
    tranche name for this table
    be registered?
    
    Thank you,
    Rahila Syed