Repository navigation
Replace a local process cache entry whose outputs are gone - #23749
Merged
Merged
Conversation
jgranstrom
marked this pull request as ready for review
November 3, 2026 20:28
benjyw
approved these changes
Nov 4, 2026
PersistentCache::store wrote with NO_OVERWRITE, so an entry whose outputs garbage collection had deleted was never replaced. A process whose outputs differ per run then re-ran on every later run and its result was dropped. It now writes through ShardedLmdb::overwrite_bytes, which replaces the existing value.
jgranstrom
force-pushed
the
jg/process-cache-overwrite
branch
from
November 5, 2026 19:33
6067bb2 to
54cd7b8
Compare
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.
PersistentCache::storewrites withNO_OVERWRITE. Once GC deletes a cache entry's outputs, the process re-runs, but its result can't replace the old entry. A process whose outputs differ per run (sandbox paths, mtimes) then re-runs on every run. I.e. it re-runs, writes new cached content, but the cache entry is not updated so next time it re-runs again, forever for the same process inputs.PersistentCache::storenow writes through a newShardedLmdb::overwrite_bytes, which replaces the existing value. Content writes (store_bytes,store_bytes_batch) keepNO_OVERWRITE. A cache hit writes nothing, so an entry is only replaced after its process actually re-ran.On a BSP compile of a large Scala project, repeat compiles went from 43 s to 9 s.
Disclosure: Implemented and verified with Claude with human direction