Repository navigation
feat(session): add Fast Path direct routing - #338
aakash-saravanan-db wants to merge 2 commits into
Conversation
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
b56084d to
aeb28bb
Compare
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
c098599 to
cd4a322
Compare
There was a problem hiding this comment.
Verdict: 1 Medium
Mostly solid, well-tested plumbing of server-negotiated Fast Path routing (header gating on SessionAttribution::Current + client eligibility, attribution threaded through CloudFetch/inline continuation, reserved-header drop). One medium concern: is_direct_routing_eligible treats federated OAuth M2M (identity_federation_client_id: Some(..)) as eligible, which appears to contradict the PR's "conservative Databricks OAuth M2M / keep federation on standard route" intent and is untested for the Some case.
| pub(crate) fn is_direct_routing_eligible(&self) -> bool { | ||
| matches!( | ||
| self, | ||
| Self::OAuthM2M { .. } | Self::OAuthM2MPrivateKey { .. } |
There was a problem hiding this comment.
🟡 Medium — is_direct_routing_eligible matches OAuthM2M { .. } / OAuthM2MPrivateKey { .. } unconditionally, ignoring identity_federation_client_id. Per the variant docs (src/config.rs:319), an OAuthM2M with identity_federation_client_id: Some(..) is a Workload Identity Federation flow, not standard Databricks M2M. The PR intent is described as "conservative Databricks OAuth M2M eligibility" that keeps "OAuth federation flows on the standard route," but this predicate marks a federated M2M session eligible for direct routing. Only the distinct OAuthFederation variant is excluded; the M2M-with-federation-client-id case slips through.
If federated M2M should stay on the standard route, gate on identity_federation_client_id.is_none() for the M2M arms. If federated M2M is intentionally eligible, the is_limited_to_databricks_oauth_m2m test should add a Some(federation_id) case to lock that decision in — right now the test only exercises None, so the behavior for federated M2M is untested either way.
f1c85ad to
af78ef5
Compare
Summary
Add server-negotiated Fast Path routing for SQL Execution API sessions.
CreateSessionResponse.direct_routing_enabledand combine it with conservative Databricks OAuth M2M eligibility.x-databricks-direct-routing: trueto current-session execute, polling, result, cancel, statement-close, and session-close requests.This PR is stacked on #331, which adds FAST session mode and session-version exchange.
Testing
cargo +stable fmt --all -- --checkcargo +stable clippy --all-targets -- -D warningscargo +stable test(950 unit tests plus all non-ignored integration and doc tests)git diff --check