Skip to content

Better documentation for mmap backed caches#69100

Open
dwoz wants to merge 2 commits intosaltstack:3008.xfrom
dwoz:mmapcache
Open

Better documentation for mmap backed caches#69100
dwoz wants to merge 2 commits intosaltstack:3008.xfrom
dwoz:mmapcache

Conversation

@dwoz
Copy link
Copy Markdown
Contributor

@dwoz dwoz commented May 9, 2026

What does this PR do?

  • Removes pki index since we have a nattily backup mmap cache now.
  • Improves docs for mmap backed cache and cache runner

@dwoz dwoz requested a review from a team as a code owner May 9, 2026 04:28
…backends

The v1 PKI mmap index (``salt.utils.pki.PkiIndex`` plus the
``pki_index_enabled`` master opt) was an acceleration sidecar that lived
alongside the file-based PKI tree.  After the v2 work landed
(``salt.cache.mmap_key``), the index and the value store are the same
backend, so the sidecar is dead weight: it opened a second mmap file
covering the same minion IDs and was driven by a single caller in
``salt/key.py``.

Lift the speed it provided into the cache backends themselves so it's
available naturally to any consumer of ``salt.cache.Cache``:

- Add ``list_all(bank, include_data=False)`` to ``salt.cache.mmap_cache``
  and ``salt.cache.mmap_key``.  Single O(occupied) ``MmapCache.list_items``
  pass; one mmap traversal instead of N hash probes.
- Switch ``salt.key.Key.list_keys`` to prefer ``cache.list_all("keys")``
  with the legacy ``list`` + per-key ``fetch`` loop kept only as a fallback
  for drivers that don't implement the contract.
- Delete ``salt/utils/pki.py``, the four ``pki_index_*`` master opts, and
  the ``doc/topics/performance/pki_index.rst`` page.

Document the gain.  The performance page now explicitly enumerates
``mmap_cache`` as a ``cache:`` driver value with the orders-of-magnitude
callout, both ``salt.cache.mmap_*`` module pages link to the perf page,
and the changelog fragment is rewritten to match the new shape (no more
``pki_index_enabled`` reference, mention of ``cache.migrate`` and
``pki.migrate_to_mmap``).

Smoke suite: 269 passed, 3 pre-existing skips.
The performance-characteristics table in
doc/topics/performance/mmap_cache.rst used the simple-table format with
column underlines that were too narrow for one row's contents
("O(N) ``listdir`` + N stat" is wider than the 13-char underline).
Sphinx is invoked with -W on CI so the resulting "Malformed table"
warning failed the man-pages build (PR saltstack#69100, run 25591997372).

Convert the table to a list-table so column widths are computed at
render time and don't depend on hand-counted underlines.
@dwoz dwoz added the test:full Run the full test suite label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant