Skip to content

Fix version release - #670

Merged
samikshya-db merged 3 commits into
mainfrom
samikshya-chand_data/main
Feb 3, 2025
Merged

samikshya-db merged 3 commits into
mainfrom
samikshya-chand_data/main

Conversation

@samikshya-db

Copy link
Copy Markdown
Collaborator

Description

Testing

Additional Notes to the Reviewer

@samikshya-db
samikshya-db merged commit 6980f03 into databricks:main Feb 3, 2025
@samikshya-db
samikshya-db deleted the samikshya-chand_data/main branch February 3, 2025 09:13
diegofanesi pushed a commit to diegofanesi/databricks-jdbc that referenced this pull request Sep 17, 2026
## What

Transparently auto-recover the Reyden onboarding case for JDBC: when a
**default-Thrift**
connection to a Real-Time (Reyden) SQL warehouse is rejected by the
gateway with SQLSTATE
`KP001` ("Lakehouse/RT is not supported for Thrift protocol"), the
driver re-opens the session
on its SEA path (`DatabricksSdkClient`) and remembers the warehouse so
later connections skip
Thrift — no customer configuration change. This mirrors the same feature
already in the Python
(databricks#948), Go (databricks#479), and Node (databricks#523) drivers; design follows ADBC
databricks#670.

## Changes

- **`ReydenWarehouseCache`** (new): process-wide, thread-safe cache
keyed by
`host_lowercased|warehouse_id`, ~6h TTL, lazy eviction on read plus an
opportunistic sweep on
  write.
- **`DatabricksSession.open`**:
- **Pre-check** — on the default Thrift path, if the warehouse is
already known-Reyden, open
    SEA directly and skip the Thrift round-trip.
- **Reactive catch** — a `KP001` on the Thrift `OpenSession` marks the
cache and (default path
only) retries once on SEA. On a double failure both error chains are
preserved (SEA error as
    cause, original Thrift `KP001` as a suppressed exception).
- Detection (`getSQLState() == "KP001"`) is scoped to the `OpenSession`
`createSession` call
  only — there is no shared status checker that maps `KP001` elsewhere.

## Guardrail

Recovery engages only on the **default** Thrift path
(`isDefaultThriftPath()` = `UseThriftClient`
unset). An explicit `UseThriftClient=1` is honored: `KP001` is surfaced
to the caller, never
auto-switched to SEA.

### Known edge case (documented, not fixed here)

`isDefaultThriftPath()` gates on `UseThriftClient` alone. A user who
sets a Thrift-forcing
metadata param (`UseQueryForMetadata=0` or
`TreatMetadataCatalogNameAsPattern=1`) on a Reyden
warehouse will therefore be auto-recovered to SEA, silently dropping the
native-Thrift-metadata
behavior. This is judged acceptable — the connection would otherwise
hard-fail with `KP001`, and
a Reyden warehouse cannot serve Thrift metadata at all — but flagging it
for reviewer input.

## Testing

- **Unit** (`ReydenThriftAutoRecoveryTest`, 8 tests): reactive fallback
success, cache pre-check,
explicit-Thrift guardrail (2 cases incl. cached-Reyden), double-failure
error chaining,
non-`KP001` propagation, and cache host/warehouse isolation.
`DatabricksSessionTest` (21)
  passes unchanged.
- **End-to-end** against a prod Reyden warehouse:
- Forced Thrift (`UseThriftClient=1`) returns the real
`TStatus(ERROR_STATUS, sqlState:KP001)`
    and the guardrail surfaces it (no fallback).
- Reactive path: connect #1 recovers `KP001` → SEA (10 rows, cache
marked); connect #2
    pre-checks (skips Thrift), opens SEA directly (10 rows).

## Notes

- No new `DatabricksDriverErrorCode` is introduced; the double-failure
exception reuses the
existing `CONNECTION_ERROR` code, so no telemetry-taxonomy change is
required.
- `NEXT_CHANGELOG.md` updated under `### Added`.

This pull request and its description were written by Isaac.

---------

Signed-off-by: Rahul Singhal <[email protected]>
Co-authored-by: Isaac <[email protected]>

This branch was previously deployed

1 inactive deployment
azure-prod — bdd6f6cd Deployed Feb 3, 2025 by samikshya-db
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.

2 participants