Better documentation for mmap backed caches#69100
Open
dwoz wants to merge 2 commits intosaltstack:3008.xfrom
Open
Better documentation for mmap backed caches#69100dwoz wants to merge 2 commits intosaltstack:3008.xfrom
dwoz wants to merge 2 commits intosaltstack:3008.xfrom
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?