[manager] bound P2P host cache queries - #284
Draft
charpty wants to merge 12 commits into
Draft
Conversation
charpty
force-pushed
the
agent/pr277-review-fixes
branch
2 times, most recently
from
August 11, 2026 07:59
fb02386 to
dbe8064
Compare
charpty
force-pushed
the
codex/mu-main
branch
3 times, most recently
from
August 11, 2026 08:08
46ce54f to
9083822
Compare
charpty
force-pushed
the
agent/pr277-review-fixes
branch
from
August 11, 2026 11:28
dbe8064 to
b8aeeb2
Compare
charpty
force-pushed
the
agent/pr277-review-fixes
branch
4 times, most recently
from
August 11, 2026 15:16
f03c1d5 to
7ac5de5
Compare
…host-state queries Consolidate ReportEvent snapshot semantics and fused local RMW with the GetHostCacheState compact streaming, cancellation, LRU batching, jemalloc startup preload, tests, benchmarks, and maintenance documentation.
Flatten ReportEvent aggregation, reduce URI/copy and local-lock overhead, and preserve validation, ordering, and capacity semantics. Harden EventReportBackend shutdown synchronization and expand correctness, sanitizer, and performance coverage and documentation.
Optimize the pure-local ReportEvent pipeline end to end: parse large HTTP bodies in request-owned buffers, use SIMD ASCII and NUL scans, flatten and intern request mutations, canonicalize versioned URIs without repeated parsing, inline the dominant one-spec task shape, and remove redundant temporary allocations. Fuse exact single-location local RMW while preserving capacity, key-count, lifecycle, partial-failure and non-local backend semantics. Reuse LRU handles and bounded scratch, align metadata and local-LRU shard hashing, retire immutable values outside locks, and retain strict validation for every generic caller. Accelerate GetHostCacheState with a bounded 4096-key probe and 16384-key parallel suffix, monotonic cancellation, ordinary and Mamba bitsets, request-scoped visibility parsing, serving-only filtering and strict non-NOENT error propagation. Preserve full materialization for P2P semantics and fail closed for malformed recovered EventReport URIs. Add parser, URI, backend, capacity, lifecycle, concurrency, randomized differential, cancellation and ordered-error coverage. Document performance results, design invariants and rollback boundaries. Preserve the latest mu-main ReportEvent metrics commit unchanged. Release validation on the merged mu-main tree passes 106 executable Bazel tests with one GPU-only skip. Pure-local measurements include about 106.32ms p50 for a 1M-key all-hit query with 4 workers, 84.38ms with 8 workers, and about 0.46ms for first-window cancellation; shared-host results are regression data, not an online SLA.
Include the requested instance_id when a per-instance service metrics collector cannot be resolved. Keep the diagnostic concise and avoid logging additional request context.
Keep reporter-owned locations out of generic physical deletion without granting false predicted-key credit when ordinary and EventReport locations coexist. Document that EventReport bytes remain in the group-wide capacity watermark while being excluded from per-storage-type watermarks. Add regression coverage ensuring reporter locations cannot satisfy migration cold-tier spec coverage.
charpty
force-pushed
the
agent/pr277-review-fixes
branch
from
August 12, 2026 12:42
7ac5de5 to
ac22c67
Compare
charpty
force-pushed
the
agent/pr277-review-fixes
branch
from
August 12, 2026 13:57
ac22c67 to
5420d75
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.
Summary
Standalone follow-up to #277, rebased onto the latest
codex/mu-mainatce7a6c1f.This PR contains only the remaining P2P query scalability and correctness work. It does not add protobuf/API compatibility code and does not include the previously explored storage availability, unavailable-backend event filtering, or service-metrics fallback changes.
Why this change is needed
With
p2p_host_count > 0, both ordinary and Mamba queries still materialized two request-widekey -> host -> set<spec>graphs. At one million keys this creates an object graph proportional tokey * host * spec, dominating both RSS and latency. Caching around the old reducer would not remove that asymptotic cost, so the two P2P reducers are replaced rather than patched locally.Implementation
MetaIndexer::PrefixVisitOrder::ORDERED: backend chunks are read in bounded parallel windows, while stateful visitors consume callbacks in absolute key order. Existing callers keep the concurrent default.F*full-group peer planning plusL*state-coverage voting, and final validation/projection only when an actual peer plan is selected.p2p_1_fetchremains exact; repeated block-key values are de-duplicated.The production diff is concentrated in
meta_searcher.cc(the two old reducers are replaced) andmeta_indexer.{h,cc}(the ordered visitor). Most of the remaining added lines are the independent oracle, edge tests, and manual benchmark.Preserved semantics and edge coverage
F*/L*group classification from currentmu-main, with no legacy-name fallbackA deterministic materialized
map/setoracle compares every output field for ordinary and Mamba queries over 6000 keys, 7 hosts, three medium filters, Eagle on/off, and top-N 0/1/3/7.Performance evidence
Strict same-machine A/B on
mu-main@16809002, Release/O2, four query workers, pure-local metadata, one million keys, and a peer-covered local gap at key 1024:After rebasing to
ce7a6c1f, the final manual smoke benchmark passed and measured 176.30 ms ordinary / 407.05 ms Mamba on the shared development machine. These values are regression evidence, not an online SLA.Validation
--config=vcns, including Vcns/TairMempool/Pace tests: 113 passed, 1 repository-configured skip, 0 failedlocal,p2p_1_fetch, andp2p_1_total_matchDeliberate trade-offs
map/setgraphs.key * host * specstate is removed.The branch contains one commit and remains Draft for review.