Skip to content

SGLang L3 read fixes + diagnostics + multi-master discovery with pinned head (0.6.5–0.7.1) - #24

Merged
flymysql merged 1 commit into
mainfrom
cursor/fix-batch-exists-keyspace-49da
Jun 2, 2026
Merged

SGLang L3 read fixes + diagnostics + multi-master discovery with pinned head (0.6.5–0.7.1)#24
flymysql merged 1 commit into
mainfrom
cursor/fix-batch-exists-keyspace-49da

Conversation

@flymysql

@flymysql flymysql commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Functional fixes (the "writes work, reads always 0" saga)

  • 0.6.5 — batch_exists keyspace match. Generic batch_set stores raw keys but batch_exists looked them up as suffixed component keys → prefetch probed the wrong namespace, missed every page, SGLang never read. Now resolves keys through the active keyspace + self-heals on read-only nodes.
  • 0.6.9 — lazily register unregistered local READ destinations. Field metrics pinned it (rdma_local_reg_misses == read_failures): SGLang's generic batch_get hands a destination outside the registered host KV pool, so lkey_for(addr)=0 and the WR was never posted. RdmaContext::lkey_for_ensure() now lazily registers + caches an MR. Result on a 2-node test: read_hits=906/906, read_remote_hits=163, read_disk_hits=743, read_failures=0.

Diagnostics

  • 0.6.7 rdma_read_wc_errors / rdma_last_wc_status (+ ibv_wc_status_str logged).
  • 0.6.8 rdma_local_reg_misses / rdma_post_failures / rdma_lease_failures.
  • earlier: exists_requests / exists_pages_found, directory_lookups_saved.

Multi-master discovery (no single meta SPOF)

  • 0.7.0 — every host runs a discovery server on the cluster-wide meta port; active masters derived from membership; clients register/heartbeat to all masters + bootstrap seeds and merge membership.
  • 0.7.1 — the initial config stays a single head IP; the head is pinned as the primary master (stable bootstrap anchor) and the next joiners fill the remaining slots in hostname order up to max_masters (default 3). If the head is down, live hosts still fill all slots; a small cluster has all hosts as masters.

New: config.max_masters, discovery_seeds(), meta_port(), DiscoveryClient.master_hosts(). Backward compatible with a single discovery_addr. Tests cover head pinning (even when the head doesn't sort first), 3-master selection, automatic failover to surviving hosts, and small-cluster all-master.

Also

  • 0.6.6 — heartbeat log throttled to ~10s.

C++ built locally (syntax + full build OK; RDMA runtime untestable on a non-RDMA VM). Full Python suite: 58 passed. Tags v0.6.5v0.7.1 on PyPI.

Open in Web Open in Cursor 

SGLang's generic HiCache path writes via batch_set(keys, data), which stores
one blob per RAW key, but batch_exists() looked keys up as SUFFIXED K/V
component keys (_component_keys). The prefetch probe therefore missed every
page -- exists_pages_found stayed 0 while write_requests climbed into the
thousands -- so SGLang never issued a get and read_requests/read_remote_hits
were always 0.

batch_exists()/exists() now resolve keys through the active keyspace: raw for
the generic value/pointer path (set by batch_set/batch_get), suffixed for the
zero-copy v1/v2 path. A read-only node that has not observed the producer's
keyspace self-heals by probing the other namespace once on a full miss and
locking onto whichever hits.

Adds a regression test: generic batch_set on the producer + batch_exists on a
fresh consumer must report the pages present (and then batch_get fills them).

Co-authored-by: 兰州小红鸡 <flyphp@outlook.com>
@flymysql
flymysql marked this pull request as ready for review June 2, 2026 06:56
@flymysql
flymysql merged commit ad08feb into main Jun 2, 2026
12 checks passed
@cursor cursor Bot changed the title fix(store): batch_exists must probe the same keyspace it stores (0.6.5) fix(store): batch_exists keyspace match + throttle heartbeat log (0.6.5 / 0.6.6) Jun 2, 2026
@cursor cursor Bot changed the title fix(store): batch_exists keyspace match + throttle heartbeat log (0.6.5 / 0.6.6) batch_exists keyspace fix + heartbeat-log throttle + RDMA WC-error diagnostics (0.6.5–0.6.7) Jun 2, 2026
@cursor cursor Bot changed the title batch_exists keyspace fix + heartbeat-log throttle + RDMA WC-error diagnostics (0.6.5–0.6.7) batch_exists keyspace fix + heartbeat throttle + RDMA read-failure diagnostics (0.6.5–0.6.8) Jun 2, 2026
@cursor cursor Bot changed the title batch_exists keyspace fix + heartbeat throttle + RDMA read-failure diagnostics (0.6.5–0.6.8) Fix SGLang L3 read path: keyspace match + lazy local-MR registration (+ diagnostics) (0.6.5–0.6.9) Jun 2, 2026
@cursor cursor Bot changed the title Fix SGLang L3 read path: keyspace match + lazy local-MR registration (+ diagnostics) (0.6.5–0.6.9) SGLang L3 read path fixes + diagnostics + multi-master discovery (0.6.5–0.7.0) Jun 2, 2026
@cursor cursor Bot changed the title SGLang L3 read path fixes + diagnostics + multi-master discovery (0.6.5–0.7.0) SGLang L3 read fixes + diagnostics + multi-master discovery with pinned head (0.6.5–0.7.1) Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants