Skip to content

fix(session): remove session conf allowlist - #303

Merged
jay-xiao446 merged 1 commit into
mainfrom
jay/remove-session-conf-allowlist
Aug 27, 2026
Merged

jay-xiao446 merged 1 commit into
mainfrom
jay/remove-session-conf-allowlist

Conversation

@jay-xiao446

Copy link
Copy Markdown
Collaborator

Summary

  • remove the kernel-side session_conf allowlist/filter
  • pass caller-supplied server-bound session_conf entries through unchanged
  • keep client-only result knobs consumed and stripped before the SEA wire
  • update wiremock coverage and connection parameter docs

Testing

  • cargo +stable fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test

@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 Low

Clean, well-scoped change — removes the kernel-side session_conf allowlist and forwards server-bound entries unchanged. Verified no dangling references to the removed filter_session_conf/SESSION_CONF_ALLOWLIST/SESSION_CONF_CASE_SENSITIVE_ALLOWLIST symbols, that docs/spec-v0.md already documents pass-through, and that client-side result-knob stripping (apply_client_result_overrides) is preserved and still tested. One low-severity note on the deliberate loss of the issue-#196 can_cloud_download guard.

Comment thread src/session.rs
defaults.catalog.as_deref(),
defaults.schema.as_deref(),
crate::config::filter_session_conf(config.session_conf.clone()),
config.session_conf.clone(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Low — Removing the allowlist also removes the issue-#196 guard that dropped a caller-supplied can_cloud_download session conf. Per the retired code/tests, SEA accepts this key at CreateSession but then rejects it at the first ExecuteStatement with CONFIG_NOT_AVAILABLE, poisoning every subsequent statement on the session. With this pass-through, a caller who sets can_cloud_download (the natural intuition for "disable CloudFetch") now opens a session that appears healthy but fails on first query, instead of getting a benign no-op.

This appears intentional ("validation belongs to the server"), and the CloudFetch-disable knob is correctly the typed ResultConfig path — so this is a deliberate robustness tradeoff, not a correctness bug. Flagging so it's a conscious decision: the kernel no longer shields callers from a known session-breaking key. If the team wants to keep the #196 protection while dropping the broader allowlist, a targeted drop of just can_cloud_download (with a warn) would preserve it. Otherwise consider a CHANGELOG/docs note since this reverses previously-tested behavior.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

seems okay because ResultConfig::cloudfetch_enabled isn't converted to session conf

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Right — the typed ResultConfig::cloudfetch_enabled path doesn't round-trip through session_conf, so that knob is fine. My concern was narrower: a caller who directly sets can_cloud_download in session_conf (the intuitive-but-wrong way to disable CloudFetch) no longer gets the #196 guard, and the current code at line 375 still forwards session_conf verbatim. Since this is a deliberate tradeoff rather than a bug, I'm leaving it as a low-severity note for the record — a CHANGELOG/docs mention (or a targeted can_cloud_download drop with a warn) would preserve the old protection if the team wants it.

@vuanhphung vuanhphung left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think there's a stale comment about allowlist-filtered in include/databricks_kernel.h line 319

Signed-off-by: Jay Xiao <jay.xiao@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 Low

Clean, well-scoped removal of the kernel-side session_conf allowlist. Client-only result knobs are still consumed and stripped (session.rs:306) before the now-unfiltered map is forwarded (session.rs:375); no dangling references to the removed filter_session_conf/SESSION_CONF_ALLOWLIST symbols remain; docs and wiremock coverage were updated coherently. One low note on doc discoverability for the metric-view conf whose casing behavior subtly changes with this PR.

Comment thread CONNECTION_PARAMETERS.md
| Key | Notes |
|-----|-------|
| `spark.sql.thriftserver.metadata.metricview.enabled` | When `"true"`, `SHOW TABLES` returns `METRIC_VIEW` rows and `getColumns` surfaces `measure` columns. Mirrors JDBC `EnableMetricViewMetadata` (default off). |
for supported SQL parameter names and accepted values.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Low — This doc edit removes the entire table documenting the spark.sql.thriftserver.metadata.metricview.enabled conf and its effect (SHOW TABLES returning METRIC_VIEW rows, getColumns surfacing measure columns). The feature itself is unchanged — the kernel still lists METRIC_VIEW among table types and the server emits those rows only when this conf is set — so the capability now works but is undocumented at the connection-parameter level. Additionally, because the case-insensitive canonicalization is gone, a caller must now supply this key in its exact lowercase-dotted form (Spark conf keys are case-sensitive); any uppercased/mixed-case spelling that previously worked will now be forwarded verbatim and silently ignored server-side. Worth keeping a short note (or a link) so consumers know the exact key and that casing now matters. Not a correctness blocker — the removal is intentional per the PR scope.

@jay-xiao446
jay-xiao446 added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit fbdaa58 Aug 27, 2026
20 checks passed

This branch was previously deployed

1 inactive deployment
azure-prod — 5073a51d Deployed Aug 27, 2026 by oss-reviewer-bot[bot] via followup #1167
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.

3 participants