Skip to content

feat(session): add Fast Path direct routing - #338

Closed
aakash-saravanan-db wants to merge 2 commits into
aakash-saravanan_data/fast-session-modefrom
aakash-saravanan_data/fast-path-direct-routing
Closed

aakash-saravanan-db wants to merge 2 commits into
aakash-saravanan_data/fast-session-modefrom
aakash-saravanan_data/fast-path-direct-routing

Conversation

@aakash-saravanan-db

@aakash-saravanan-db aakash-saravanan-db commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add server-negotiated Fast Path routing for SQL Execution API sessions.

  • Deserialize CreateSessionResponse.direct_routing_enabled and combine it with conservative Databricks OAuth M2M eligibility.
  • Add x-databricks-direct-routing: true to current-session execute, polling, result, cancel, statement-close, and session-close requests.
  • Preserve session attribution through lazy CloudFetch and inline continuation fetches.
  • Keep CreateSession, detached statement operations, PAT, OAuth U2M, Azure service-principal, and OAuth federation flows on the standard route.
  • Drop caller-supplied authentication and routing headers before building requests.

This PR is stacked on #331, which adds FAST session mode and session-version exchange.

Testing

  • cargo +stable fmt --all -- --check
  • cargo +stable clippy --all-targets -- -D warnings
  • cargo +stable test (950 unit tests plus all non-ignored integration and doc tests)
  • git diff --check

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/config.rs
pub(crate) fn is_direct_routing_eligible(&self) -> bool {
matches!(
self,
Self::OAuthM2M { .. } | Self::OAuthM2MPrivateKey { .. }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

@aakash-saravanan-db
aakash-saravanan-db force-pushed the aakash-saravanan_data/fast-session-mode branch 3 times, most recently from f1c85ad to af78ef5 Compare September 17, 2026 03:39
@aakash-saravanan-db
aakash-saravanan-db deleted the aakash-saravanan_data/fast-path-direct-routing branch October 2, 2026 17:10

This branch was previously deployed

1 inactive deployment
azure-prod — cd4a3224 Deployed Sep 14, 2026 by oss-reviewer-bot[bot] via followup #1362
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.

1 participant