Skip to content

squid-19.2.7: Backport/617 - #34

Merged
uw-sc merged 23 commits into
squid-19.2.7-cobaltcore-storagefrom
backport/617
Oct 16, 2026
Merged

uw-sc merged 23 commits into
squid-19.2.7-cobaltcore-storagefrom
backport/617

Conversation

@uw-sc

@uw-sc uw-sc commented Oct 16, 2026

Copy link
Copy Markdown

Closes cobaltcore-dev/cloud-storage#617

Backport file

  • release-management/backports/<uuid>.md added (or updated) by this PR
  • id in frontmatter matches the filename stem
  • provenance.upstream_prs set (or provenance.type: other with an other: block)

Stage-B risk (filled per release-management/backports/RISK-RUBRIC.md)

  • blast — cosmetic / availability / data-loss
  • conflict — clean / trivial / substantive
  • coverage — strong / partial / weak
  • Risk-notes paragraph in the prose section (required for high band)

Merge

Land this via just merge-backport PR=<N> — do not click the green merge button.
The just recipe constructs the merge commit's Backport-Id trailer.

cbodley and others added 23 commits October 16, 2026 10:12
if async_wait() can race with complete() across threads, the
yield_waiter's handler_state needs to be protected by a mutex. add
an async_wait() overload for unique_lock that behaves like
condition_variable::wait(): the lock is released immediately before
suspending, and reacquired immediately before calling its completion
handler

Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit 604fad5)
(cherry picked from commit 5df34f7)
Signed-off-by: Uwe Schwaeke <[email protected]>
also adds an empty() function so it's easier to specify its precondition

Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit 165f2ec)
(cherry picked from commit 6accd16)
Signed-off-by: Uwe Schwaeke <[email protected]>
modeled after std::call_once() to guarantee that racing callers wait for
the initial caller to finish. the main differences here are

* support for coroutine callers to suspend instead of blocking while
  waiting for the initial caller, and
* the wrapped function must return a value, which is cached and returned
  to all callers

Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit 3cd3c11)
(cherry picked from commit 29f2aed)
Signed-off-by: Uwe Schwaeke <[email protected]>
A cache data structure for values that need to be retrieved form
outside systems (e.g Key Management Systems).

Features:
- Thread safe, optimized for concurrent lookups and cache hits
- Entry TTL expiration
- Cache replacement strategy tuned to "web" workloads (SIEVE)
- Performance Counters on hit, miss, expire, size, capacity, clears

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 9618827)

Conflicts:
    src/test/common/test_web_cache.cc:
- squid does not have select_labeled_t; use true instead

(cherry picked from commit e5bd2be)
Signed-off-by: Uwe Schwaeke <[email protected]>
Add Google benchmark [0] based micro benchmarks for Cache/LRU
implementations in the Ceph code base.

[0] https://github.com/google/benchmark

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 8354a97)
(cherry picked from commit 319c82c)
Signed-off-by: Uwe Schwaeke <[email protected]>
Benchmark:
- Linux Kernel Key Retention Service (kernel keystore) [0]
- memfd_secret(2)
- plain memory

Tests:
- Random reads
- (keystore) Write, Read, Remove

[0] https://docs.kernel.org/security/keys/core.html

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit a4b8d7d)
(cherry picked from commit 133884d)
Signed-off-by: Uwe Schwaeke <[email protected]>
Add RAII wrapper around the Linux Key Retention Service
add_key(2), keyctl_read(3), keyctl_invalidate(3)

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 0307119)
(cherry picked from commit 8cdbe6a)
Signed-off-by: Uwe Schwaeke <[email protected]>
To allow RGW threads to share possession over process keyring keys the
keyring must be created before a child thread adds keys.

Since we only use the process keyring for KMS cache secrets, only
initialize the keyring if it is enabled on startup.

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 0000467)
(cherry picked from commit 6190858)
Signed-off-by: Uwe Schwaeke <[email protected]>
Add caching section to the RGW Encryption docs. Add cache
settings to the RGW configuration reference.

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit a88f029)
(cherry picked from commit 3c2fa9c)
Signed-off-by: Uwe Schwaeke <[email protected]>
Goal: Support multiple backends and faking / mocking for testing.

Add abstract classes Keyring (factory) and KeyringSecret. Add
"Unsupported" implementation for non-Linux platforms. Add a get_best
factory function that currently returns the LinuxKeyring impl on Linux
or Unsupported elsewhere.

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 35f2bb4)
(cherry picked from commit 5e66ba6)
Signed-off-by: Uwe Schwaeke <[email protected]>
Add SSE Key Management System secrets cache to RGW.

It is common to have secrets shared by many if not all objects in a
bucket. Without RGW-side caching every PUT/GET will cause a request to
an external KSM. This not only adds load to the KSM, but also slows
down read and writes.

Combine WebCache, ceph::async::call_once and LinuxKeyringSecret into
KMSCache. WebCache stores async::once_result to wrap results of a KMS
secret fetch to mitigate cache stampedes (concurrent cache requests to
the same key coalesce into one). The retrieved secrets are stored in
the Linux kernel key retention service (LinuxKeyringSecret) for safe
keeping and retrial by subsequent requests. KMSCache adds a TTL reaper
and life cycle.

Cache values and error handling: The cache stores positive
fetch results, permanent errors (e.g key does not exists) and
transient errors (e.g fetch timeout). Each with a different TTL.

Unit tests to cover cached / uncached KMS retrieve and runtime cache
disable via config.

Add perf counter `kms_fetch_lat` to track KMS fetch request latency
and error counters to track permanent, transient and key store
errors.

Signed-off-by: Marcel Lauhoff <[email protected]>
Fixes: https://tracker.ceph.com/issues/68524
On-behalf-of: SAP [email protected]
(cherry picked from commit b6186fc)

Conflicts:
    src/test/rgw/test_rgw_kms_cache.cc
- squid does not have c826e15; use previous get_tavg_ns() return tuple order
- squid does not have select_labeled_t; use true instead
- squid does not have fmt::println; use fmt::print instead

(cherry picked from commit 77d4cb9)
Signed-off-by: Uwe Schwaeke <[email protected]>
Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit aa4ead3)
(cherry picked from commit b1e0847)
Signed-off-by: Uwe Schwaeke <[email protected]>
Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit fb5bbc7)
(cherry picked from commit 2307947)
Signed-off-by: Uwe Schwaeke <[email protected]>
KMS backends Barbican, Vault KV, and KMIP have a static key per
key_id. However, with Vault Transit, each object has a unique DEK
wrapped by the transit key.

Keying th cache with key_id in Transit mode results in only the first
DEK to be cached for all subsequent objects.

Fix this by appending a hash of the wrapped DEK to the cache key.

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 4d7c556)
(cherry picked from commit 0b14a34)
Signed-off-by: Uwe Schwaeke <[email protected]>
Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 78f2ec3)
(cherry picked from commit c326b1a)
Signed-off-by: Uwe Schwaeke <[email protected]>
Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 898cd5b)
(cherry picked from commit 2138ffb)
Signed-off-by: Uwe Schwaeke <[email protected]>
sieve_expire_erase_unmutexed did not update the sieve hand passed as
advertised. Make it return the updated hand and use that to
update the global _sieve_hand in expire_erase

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 3518aaf)
(cherry picked from commit be99801)
Signed-off-by: Uwe Schwaeke <[email protected]>
Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit f96f7a6)
(cherry picked from commit 1f5398c)
Signed-off-by: Uwe Schwaeke <[email protected]>
Reset reaper state to monostate in the async and threaded case.
Fixes a possible use after free in the async reaper case.

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit e104372)
(cherry picked from commit 12c9b13)
Signed-off-by: Uwe Schwaeke <[email protected]>
1. Don't delete the KMS cache before draining/joining the frontend
coroutine threads. They may still depend on the KMS cache.
2. Stop the TTL reaper early to get it off the coroutine pool.

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 62ba03f)
(cherry picked from commit e05e133)
Signed-off-by: Uwe Schwaeke <[email protected]>
The testing backend uses a 'keysel' attribute to derive a per object
key from the KEK in the config. A single key_id with distinct keysel
has different keys and need to be cached as such.

Add the keysel to the cache key id to handle these collisions.

Signed-off-by: Marcel Lauhoff <[email protected]>
On-behalf-of: SAP [email protected]
(cherry picked from commit 12de72b)
(cherry picked from commit e49723e)
Signed-off-by: Uwe Schwaeke <[email protected]>
new dout macros use fmt::print() to write output directly to the
underlying ostream. this enables libfmt's printf-style formatting syntax
for ceph log output, without the string allocation overhead of:

    dout(10) << fmt::format("str={} count={}", str, count) << dendl;

which becomes:

    dout_fmt(10, "str={} count={}", str, count);

Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit a58d07a)
(cherry picked from commit 436d06c)
Signed-off-by: Uwe Schwaeke <[email protected]>
@uw-sc
uw-sc merged commit 23af29e into squid-19.2.7-cobaltcore-storage Oct 16, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants