Repository navigation
fix(umbp): commit to the backend outside the pool lock - #804
Merged
Merged
Conversation
PeerPool::BatchCommit held operation_mutex_ across backend->BatchCommit, which for an SSD medium is the device write. Every existence check, resolve and allocate on the node takes that lock, so a put landing on SSD stalled lookups and reads of DRAM keys too: in a DRAM+SSD tier, exists went from 0.2 ms to 16-18 ms mean (p99 ~63 ms, one 128 MiB put) while SSD-bound puts ran; DRAM-bound puts caused no stall. Commit now claims its slots under the lock, writes unlocked, and records placements after, the shape BatchResolve and Evict already use. The key stays reserved meanwhile, so a racing put sees it in flight, and lifecycle_mutex_ keeps ClearLocal out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
PeerPool::BatchCommitheldoperation_mutex_acrossbackend->BatchCommit. For an SSD medium that call is the device write. Every exists, resolve and allocate on the node takes the same lock, so while a put was being written to SSD, lookups and reads of DRAM keys waited too.This is what slows the one-process DRAM+SSD weighted tier. About 70% of puts land on SSD by design, and in DEP each lookup is on the scheduler's critical path.
Fix
Commit now:
BatchResolveandEvictalready use this shape. While the write runs the key stays inpending_keys_, so a racing put sees it as in flight.lifecycle_mutex_keepsClearLocalout.Benchmark
Standalone server with a mixed tier (DRAM 8 GB : SSD, weights 423:1000) and 128 MiB puts. The numbers are exists latency on DRAM keys / SSD keys, as the mean of two interleaved runs per server.
2b2671e1c)2b2671e1c+ this fixPut time is unchanged (1.5 ms DRAM, 62–65 ms SSD per 128 MiB).
Tests
PeerPool.SlowCommitDoesNotBlockLookupsOrReadsparks a commit inside the backend. It then checks that contains, resolve and a second put of the same key (which reports in flight) all return while the commit is parked.test_peer_pool: 44/44 pass. The concurrency tests (*Slow*,*Clear*,*Concurrent*) passed 200 repeats with no failures.umbp_pool_client_rangesandtest_transfer_enginepassed 2/2 interleaved runs each, on this branch and onmain8ae8156.🤖 Generated with Claude Code