Repository navigation
fix: bound Nydus cache backfill under ChunkDB contention - #6
Merged
Merged
Conversation
Cap queued and in-flight decompressed chunks across mounts sharing a ChunkDB. Drop expired backfill and pause the worker after MapFull while preserving synchronous GC and retries for explicit batch writes. Cover cross-process reservations, MapFull, and Nydus read and backfill behavior with regression tests.
Collaborator
|
Reviewed Checked the cross-process budget, payload/permit drop ordering, Local verification on Linux x86_64 with Rust 1.85.1:
Non-blocking suggestion: consider keeping that lock-wait expiry scenario as a permanent regression test. The existing The three ignored Nydus/FUSE tests and the ECS stress workload described in the PR were not rerun in this review. |
Hold the LMDB writer lock past the batch deadline. Verify the writer returns TimedOut after acquiring the lock, leaves the cache unchanged, and releases the reservation.
rcyw
approved these changes
Nov 12, 2026
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.
Problem
A Nydus mount could queue up to 4,096 decompressed chunks while its background writer waited for the shared ChunkDB LMDB transaction. At 1 MiB per chunk, that is about 4 GiB of queued payload per mount. If the map filled, backfill also ran synchronous GC and retried, adding pressure to the same writer lock.
Changes
MapFull, preserve previously committed sub-batches, and pause that mount's backfill worker for 5 s. The publicChunkDB::add_chunkspath keeps its synchronous GC and retry behavior.ECS validation
Linux x86_64 with Rust 1.85.0.
cargo fmt --all -- --checkpassed.cargo test --lockedpassed 138 tests, and 3 Nydus/FUSE tests passed separately. Regression coverage includesMapFullrollback and cooldown, expiry, cross-process budget exhaustion, and permit recovery after a process is killed.An isolated release-build stress test ran 72 independent Nydus FUSE mounts against one 512 MiB ChunkDB with per-mount caches, 2.25 GiB of cold reads, real
gc-chunkreclamation, and a controlled 20 s LMDB writer lock.The limit covers pending decompressed backfill payloads. The ECS workload used local RAFS blobs and injected lock contention. Production OSS/Dragonfly traffic and prolonged I/O stalls were outside the test scope.