Repository navigation
fix(umbp): SSD tier no longer runs out of fds or misreports parallel-drive reads - #754
Merged
Merged
Conversation
…not open SSDTier keeps every 256 MiB segment file open for the tier's lifetime, so a full 1.5 TB tier holds ~5,900 descriptors. Under docker's default soft RLIMIT_NOFILE of 1,024 the e2e run's standalone server reached 1,022 open fds with 973 segments; the next segment open failed with EMFILE and from then on every write to the tier failed (110k demotions in ten minutes), with nothing in the log but "backend write failed". MakeFileSsdBackend now sizes the descriptors every file tier in the process needs (capacity / segment size, plus each shard's active segment, plus headroom) and raises the soft limit toward the hard one, logging an error when even the hard limit is too small. A failed segment open logs the path and errno (rate-limited) instead of failing silently. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ailed ShardedSsdTier fans a batch out to one worker per drive and each worker wrote its keys' results into the caller's std::vector<bool>. The indices are disjoint, but vector<bool> elements are not separate memory locations: they share words, so two drives finishing together each read-modify-wrote the word holding the other's results and could put back a stale false. A read or write that succeeded came back failed -- 16 and 42 times in two DRAM->SSD demotion e2e runs, always under parallel SSD load, never reproduced below the shard layer (SSDTier's own result paths already use vector<char> for this reason). The linker treats a failed get after a hit as fatal, so each one cost a scheduler. The workers now fill a vector<char> and the bool results are written after they join. The new stress test (4,096 keys over three drives, 200 batch reads) guards the path; it does not reproduce the race, which needs two workers' few-microsecond result loops to overlap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ecks it The previous commit raised the soft RLIMIT_NOFILE inside MakeFileSsdBackend. That is a library call, and in embedded mode it runs inside sglang's scheduler: building a tier quietly changed a process-wide limit the host owns, let other code in that process get fds above 1,024 (where select() corrupts memory), and passed the raised limit to every child it starts. The raise now lives in the executables that host file SSD tiers -- umbp_standalone_server and umbp_tier_bench -- which lift the soft limit to the hard one at the top of main(), as dbus and Go do. MakeFileSsdBackend only checks: it logs an error when the fds already open plus the tier's segment files will not fit under the soft limit, and names the fix (ulimit -n / docker --ulimit nofile, or ssd.segment_size_bytes). The process-wide `planned` counter, which only ever grew, is gone, and the test restores the original limit even when it fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every segment file keeps an fd open for the tier's lifetime, so the 256 MiB default made a 1.5 TB tier need ~5,900 descriptors, far past the usual soft RLIMIT_NOFILE of 1,024; the e2e run's standalone server hit EMFILE at 973 segments. At 4 GiB the same tier needs ~350, which fits under the default soft limit without raising anything (embedded mode included), and under churn, where evicted space is not reclaimed (#755), the fd count grows 16x more slowly. Segments are not preallocated (files grow as records are appended), segment offsets are 64-bit, and the reopen scan reads one record at a time, so nothing else depends on the size. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 10 tasks
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.
Two SSD-tier bugs that make reads or writes fail with nothing in the log that says why. Both were found by running a 300 GB DRAM → 1.5 TB SSD UMBP tier (3 NVMe drives) under the InferenceY agentic workload. Both apply to any file-backed SSD tier, with or without eviction demotion. This is PR 1 of the split of #753; it applies on
mainalone.1. The SSD tier runs out of file descriptors (
d975d67e7,2424c16c7,ee0686af3)Bug.
SSDTierkeeps every segment file open for the tier's lifetime. At the old 256 MiB default a 1.5 TB tier needed about 5,600 descriptors, but Docker's default softRLIMIT_NOFILEis 1,024. Once the process reached it, the next segment open failed withEMFILE, and from then on every write to the tier failed: 218k in one run. The log only saidbackend write failed.Fix.
ee0686af3). The same 1.5 TB tier needs about 350 descriptors, which fits under the default soft limit without raising anything. Segments aren't preallocated, segment offsets are 64-bit, and the reopen scan reads one record at a time, so nothing else depends on the size.2424c16c7).umbp_standalone_serverandumbp_tier_benchraise the soft limit to the hard limit at the top ofmain()withRaiseOpenFileLimit()(umbp/common/fd_limit.h), as dbus and Go do. This needs no privileges and never touches the hard limit.MakeFileSsdBackendalso runs inside sglang's scheduler (embedded mode), where changing the process-wide limit would quietly override the host's setting. It would also let other code in that process get fds above 1,024, whereselect()corrupts memory, and pass the raised limit to child processes. So it logs an error when the fds already open plus the tier's segment files won't fit under the soft limit, and names the fix (ulimit -n,docker --ulimit nofile, orssd.segment_size_bytes).d975d67e7first raised the limit inside the library;2424c16c7moves it out.strerror(errno)(rate-limited) and records anIoErrorstatus.Limitation. Capacity bounds the fd count only while nothing is evicted. The tier never reclaims evicted space (#755), so under churn it keeps opening new segments. 4 GiB segments make that 16× slower, but only the #755 fix bounds it.
2. A multi-drive SSD tier reports successful reads as failed (
cb3e2b811)Bug.
ShardedSsdTier::FanOutBatchesruns one worker per drive, and each worker wrote its keys' results into the caller'sstd::vector<bool>. The indices are disjoint, butvector<bool>packs elements into shared words. Two drives finishing together each read-modify-wrote the other's word and could write back a stalefalse. A read that succeeded came back as failed: 16 and 42 times in two runs, always under parallel SSD load. sglang's UMBP linker treats a failed get after a hit as fatal, so each one killed a scheduler.SSDTier's own result paths already usevector<char>for this reason.Fix. Workers fill a
std::vector<char>, and theboolresults are written after they join.Test plan
SsdBackendTest.LeavesTheOpenFileLimitToTheExecutable: lowers the soft limit to 1,024, starts a tier, and checks the limit is unchanged. Then it checks thatRaiseOpenFileLimit()lifts it to the hard limit. The original limit is restored even if the test fails.test_parallel_drives_never_lose_a_result(intest_sharded_ssd_tier), a stress test of 4,096 keys over three drives and 200 batch reads. It guards the path but doesn't reproduce the race, which needs two workers' few-microsecond result loops to overlap.tests/cpp/umbpsuite on this branch (build inrocm/mori-dev, with RDMA): 51/52 underctest -j 8. The one that aborted,umbp_cross_node_smoke, is a pre-existing RDMA-contention flake that also fails onmain. Run one at a time, it and the other known flake,umbp_pool_client_ranges, both passed 3 of 3.umbp_standalone_serverlogsraised RLIMIT_NOFILE soft 1024 -> 524288, and/proc/<pid>/limitsshows it. With both limits forced to 200, the library logs its error naming the fix, and the tier still works.🤖 Generated with Claude Code