Skip to content

searcher: TMPDIR on CACHE_DIR

Warren Gifford requested to merge k/diskcache-cache-size into main

Created by: keegancsmith

Structural search writes to $TMPDIR, leading to evictions since that is just the normal ephemeral storage on a pod (not tuned). We move TMPDIR to CACHE_DIR and update diskcache to evict based on all file sizes, not just zips. Structural writes zips, and it should be safe to evict those files even if comby is reading them due to it having an open file descriptor.

Kubernetes evicts searchers if they go too far over the cache size. This means we need to maintain our cache size for all files, not just zip files. We can only safely remove zip files, so we still only remove those. But when making eviction decisions, it is now based on the total size of the cache dir, not just the size of zip files within.

Test Plan: added a unit test. It was useful since info.Size() works on a directory but we want to ignore that.

Fixes #34828 (closed)

Merge request reports

Loading