Skip to content

hub: log LRU registry evictions#634

Merged
tamalsaha merged 1 commit into
masterfrom
fix/pool-eviction-isolation
May 19, 2026
Merged

hub: log LRU registry evictions#634
tamalsaha merged 1 commit into
masterfrom
fix/pool-eviction-isolation

Conversation

@tamalsaha
Copy link
Copy Markdown
Contributor

Summary

  • The cluster Registry pool is a fixed-size LRU (PoolSize=1024). Evictions currently happen silently; an operator has no way to know the pool is undersized for the workload until they notice symptoms (re-discovery storms, lost RegisterGVR state on subsequent access).
  • This PR pairs with hub: stop sharing the embedded descriptor map across registries #632 ("stop sharing the embedded descriptor map"). With each registry owning its own KV map, an evicted registry no longer corrupts shared state — but any work buffered locally (recent RegisterGVR additions, the current cached preferred map, lastRefreshed) is gone, and that's worth surfacing.
  • Switch to lru.NewWithEvict and log at V(2) so the signal is quiet by default, but greppable when investigating "why does this cluster's registry keep cold-starting?"

Note on the more invasive options

Test plan

  • make unit-tests
  • Smoke-test with PoolSize artificially lowered (e.g. 4) and 10+ unique cluster UIDs; verify evicted cluster registry from pool lines appear at -v=2.

🤖 Generated with Claude Code

The cluster Registry pool is a fixed-size LRU (PoolSize=1024). With
the embedded descriptor map now copied per registry (see "hub: stop
sharing the embedded descriptor map across registries"), eviction no
longer corrupts shared state — an evicted registry simply becomes
garbage once goroutines release it. But any work that registry had
buffered locally (recent RegisterGVR additions, the current cached
preferred map, lastRefreshed) is lost, and operators currently have
no way to tell the pool is undersized for the workload.

Switch to lru.NewWithEvict and log evictions at V(2). The signal is
quiet enough to leave on, loud enough to find when grepped.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha merged commit 1e6fbc9 into master May 19, 2026
2 of 6 checks passed
@tamalsaha tamalsaha deleted the fix/pool-eviction-isolation branch May 19, 2026 15:23
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.

1 participant