You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(server,server-client): a streaming cache hit by hash, without re-uploading the file (#3907)
Closes#3901.
`POST /parse/parquet-stream` accepts an optional `sha256` query parameter (the same `ParseQuery` mechanism as `parquet_layout`, so it composes with layout and quality in the cache identity). With no body and a hash, the route validates the shape (400 otherwise), builds the key and delegates to the same `try_cached_replay` the upload path uses, so "the entries a hit needs" is one list; a hash-only miss answers 404 like `GET /cache/check`; a body present ignores the hash entirely, so a client hash can only select entries that already exist. `parseParquetStream` in `@ifc-lite/server-client` hashes locally, probes, and uploads on any answer that is not a replay (a pre-change server's 400 included); `skipCacheProbe` opts out. The SSE reader moved to its own module so probe and upload share one loop, and `ParquetStreamEvent` moved to `stream_event.rs` to keep the route under the ratchet without an allowlist row.
Mutation checks: disabling the probe hit path fails the no-upload test; narrowing the fallback set to 404 fails all five degradation cases; removing the non-404 passthrough fails the 500 test. Not measured against a real server or a 40 MB file; the saving is argued from the code path.
Gates on the head: `cargo test -p ifc-lite-server` 269 pass, clippy -D warnings 0, module_size_ratchet 0, typecheck 0, server-client 91 pass, check-module-size 0, check-changesets 0, docs:check-samples 0, api-surface regenerated. Changesets: `@ifc-lite/server-bin` minor, `@ifc-lite/server-client` minor.
let replay = try_cached_replay(state,&cache_key, query.parquet_layout).await;
93
+
drop(admission_guard);
94
+
replay?
95
+
}else{
96
+
None
97
+
};
98
+
99
+
ifletSome(response) = replay {
100
+
tracing::info!(
101
+
cache_key = %cache_key,
102
+
"Streaming cache HIT by client-supplied hash - no upload"
103
+
);
104
+
returnOk(response);
105
+
}
106
+
tracing::debug!(
107
+
cache_key = %cache_key,
108
+
"Hash-only stream request has nothing cached; asking the client to upload"
109
+
);
110
+
Err(ApiError::NotFound(format!(
111
+
"Nothing cached for sha256 {sha256} under this opening_filter / tessellation_quality / parquet_layout. Resend the request with the multipart file body."
112
+
)))
113
+
}
114
+
35
115
/// Return the geometry slice from a cached combined-Parquet blob, framed as
0 commit comments