Skip to content

Commit 8aab888

Browse files
committed
nrt: overreserve: drop custom indexer, use lister
The overreserve cache needs to periodically list all the pods on a node to perform the synchronization check. When the cache was introduced in 0f4ed7a , adding a thin layer over a indexer and manage a map of node -> slice of pod identifiers seemed like simple and nice. Speed was not really a concern at time, even though it was thought it was equal or better than trivial listing. However we quickly found out both in field-testing and in review that there are a bunch of corner cases to handle to manage this "thin layer cache" and the code started to grow complex. Scale testing of the overrserve cache is demonstrating more and more edge cases. The "thin layer cache" is quickly losing appeal as the complexity (projected or implemented) quickly grows. So, we re-evaluate the whole idea and we drop the not-thin-anymore cache and we just use the simplest solution: in the resync code, we just use the battle-tested client-go lister, with trivial filtering over the pod properties to check if we need to consider on a node or not. Performance (granted this is actually a concern, because there's no profiling evidence this was ever a hotspot) is not a concern yet, and the new code is way simpler and easier to reason about, so this is a big improvement for the overreserve cache already. Signed-off-by: Francesco Romani <[email protected]>
1 parent 1631b42 commit 8aab888

File tree

7 files changed

+106
-608
lines changed

7 files changed

+106
-608
lines changed

pkg/noderesourcetopology/cache/indexer.go

Lines changed: 0 additions & 243 deletions
This file was deleted.

0 commit comments

Comments
 (0)