Repository navigation
perf: route remote HTTP puts to owner - #274
perfloop[bot] wants to merge 7 commits into
Conversation
Greptile SummaryThis PR optimizes HTTP
Confidence Score: 5/5The PR appears safe to merge, with no actionable new correctness, security, or repository-rule violations found. Direct-owner HTTP writes retain the existing routing safeguards and service response contracts, and the changes made since the previous review do not introduce a demonstrated failure. Important Files Changed
Reviews (3): Last reviewed commit: "fix(coordinator): keep the router's per-..." | Re-trigger Greptile |
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Promote direct-owner routing events to Info during validation. Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
The retry line fires on every reconnect attempt and the success line on every connection established; both were raised to info for development. Per-event info logging floods under an outage, so they stay at debug like the rest of the router. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YCoN4Him5ZY4hZovVp37ra Signed-off-by: Ovais Tariq <ot@tigrisdata.com>
877fc10 to
bcd2798
Compare
|
Rebased onto main and demoted the two router log lines this PR had raised to info ( |
|
The HTTP path is not used by production services. |
The HTTP gateway used to send every decoded
PutObjectthrough the gateway node’s local gRPC handler. For nonlocal keys, that added a loopback dispatch before the owner write. This change sends eligible unary bodies to the resolved owner while keeping the existing local and streaming fallbacks.Change
CacheServiceClientand overridePutObjectfor nonlocal bodies up to 4 MiB. Resolve the owner once and use the existing routed peer connection, retry, health, and circuit-breaker path.Verification
make -j1 checkmake lintmake license-checkmake test-server TEST=TestGatewayCacheServiceClientmake test-coordinator TEST=TestRoutermake test-e2e-clusterremains environment-blocked at its pre-operationtimeout 10 ./ocachecli --addr ... listconnectivity gate; target CI can run this check.Workload:
warmed three-node nonlocal HTTP PutObject 100 Bhttp-put-p50-usgateway-putobject-per-requestowner-putobject-per-requestowner-putstream-per-requestWorkload:
warmed three-node nonlocal HTTP PutObject 64 KiBhttp-put-p50-usgateway-putobject-per-requestowner-putobject-per-requestowner-putstream-per-requestWorkload:
warmed three-node nonlocal HTTP PutObject 1 MiBhttp-put-p50-usgateway-putobject-per-requestowner-putobject-per-requestowner-putstream-per-requestGenerated by Perfloop. Measurements and checks.
Note
Medium Risk
Changes cluster write routing and hop/metadata behavior on the HTTP path; fallbacks preserve prior behavior for large payloads and hop limits, but mis-routing or metadata bugs could affect remote puts.
Overview
Eligible HTTP
PutObjectrequests (nonlocal keys, body ≤ 4 MiB, within hop limit) now resolve the owner once and call that node’s unaryPutObjectover the existing router path, instead of always loopbacking through the gateway node’s local handler (which previously forwarded via streaming).The HTTP grpc-gateway registers a wrapping
CacheServiceClientthat overrides onlyPutObject; other RPCs and oversized puts still use the local client and existingOperationsforwarding. Coordinator routing addsResolve/RouteToNodeso ownership lookup and peer client acquisition can be split without re-hashing the key.Forwarding metadata handling is adjusted so
ExtractRequestMetadatareads outgoing context (gateway client path) andAttachForwardingMetadatamerges keys without dropping unrelated outgoing metadata (e.g. auth). Tests cover gateway routing, hop metadata, and routerRouteToNode; a three-node HTTP benchmark script measures latency and RPC dispatch counters.Reviewed by Cursor Bugbot for commit bcd2798. Bugbot is set up for automated code reviews on this repo. Configure here.