All of pgRDF's shared state is statically allocated at postmaster start:
pg_shmem_init! over PgLwLock / PgAtomic in src/storage/shmem_cache.rs,
with the dictionary cache a fixed [DictCacheSlot; SLOTS]. Two consequences:
pgrdf must be in shared_preload_libraries or the shared surface is inert
(src/lib.rs:50 gates on
process_shared_preload_libraries_in_progress; src/storage/stats.rs:39
notes the counters read zero without it).
- The allocation cannot shrink. It exists for the life of the postmaster.
Why this blocks #21 specifically
#21 (C4 · park / unpark graph — seal lifecycle) promises "free + reload
RAM/CPU/disk." Under the current model, parking a graph cannot return the
dictionary-cache RAM — the slots are sized once, at start, and stay. #21's
headline promise is not reachable as specced without a dynamic allocation
mechanism.
pgrx has carried storage/dsm_*.h bindings since 0.17.0. Dynamic shared memory
would let the dict cache and the staged-loader job control allocate and release
per-graph, which both makes #21's "free" real and removes the
shared_preload_libraries requirement as a hard precondition.
Scope — this is a spike, not an implementation
Output is a written finding on this issue, not a merged design.
Why P2
#21 is P4. The spike only needs to precede #21's implementation, not this run.
Relates
Blocks the "free" half of #21. styk-tv/pgCK#20 §3 records the same
shared_preload_libraries coupling on that side, where it is satisfied today but
becomes load-bearing as the identity and presence work lands.
All of pgRDF's shared state is statically allocated at postmaster start:
pg_shmem_init!overPgLwLock/PgAtomicinsrc/storage/shmem_cache.rs,with the dictionary cache a fixed
[DictCacheSlot; SLOTS]. Two consequences:pgrdfmust be inshared_preload_librariesor the shared surface is inert(
src/lib.rs:50gates onprocess_shared_preload_libraries_in_progress;src/storage/stats.rs:39notes the counters read zero without it).
Why this blocks #21 specifically
#21 (C4 · park / unpark graph — seal lifecycle) promises "free + reload
RAM/CPU/disk." Under the current model, parking a graph cannot return the
dictionary-cache RAM — the slots are sized once, at start, and stay. #21's
headline promise is not reachable as specced without a dynamic allocation
mechanism.
pgrx has carried
storage/dsm_*.hbindings since 0.17.0. Dynamic shared memorywould let the dict cache and the staged-loader job control allocate and release
per-graph, which both makes #21's "free" real and removes the
shared_preload_librariesrequirement as a hard precondition.Scope — this is a spike, not an implementation
dsm_registrycan back the dict cache andstaged/jobctlwithout regressing the hit rate or the concurrency model.Output is a written finding on this issue, not a merged design.
Why P2
#21 is P4. The spike only needs to precede #21's implementation, not this run.
Relates
Blocks the "free" half of #21.
styk-tv/pgCK#20§3 records the sameshared_preload_librariescoupling on that side, where it is satisfied today butbecomes load-bearing as the identity and presence work lands.