Skip to content

Enable telemetry by default + prepare to release v1.0.9-oss - #948

Merged
samikshya-db merged 3 commits into
databricks:mainfrom
samikshya-db:samikshya-chand_data/newRelease
Aug 19, 2025
Merged

samikshya-db merged 3 commits into
databricks:mainfrom
samikshya-db:samikshya-chand_data/newRelease

Conversation

@samikshya-db

@samikshya-db samikshya-db commented Aug 18, 2025 •

Copy link
Copy Markdown
Collaborator

Description

Testing

  • The release testing passes

Additional Notes to the Reviewer

@samikshya-db
samikshya-db marked this pull request as ready for review August 18, 2025 19:44

@shivam2680 shivam2680 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.

lgtm! thenks!

@samikshya-db
samikshya-db merged commit ed7483d into databricks:main Aug 19, 2025
@samikshya-db
samikshya-db deleted the samikshya-chand_data/newRelease branch August 19, 2025 09:56
nikhilsuri-db pushed a commit to nikhilsuri-db/databricks-jdbc that referenced this pull request Aug 20, 2025
…ks#948)

- [Release checklist (all tests
pass)](https://docs.google.com/document/d/1t-ZHd8133w6-8v7-NOkvBCJrB5qxLKPqRkNUOpb4yVA/edit?tab=t.0)
- [Telemetry readiness
doc](https://docs.google.com/document/d/1oAu1pTCM9VFrPDCt0I_aWsSIoNGOapmGc_2Zob6QUiA/edit?tab=t.0#heading=h.j2e11ackxml8)

- The release testing passes

<!-- Share any additional context or insights that may help the reviewer
understand the changes better. This could include challenges faced,
limitations, or compromises made during the development process.
Also, mention any areas of the code that you would like the reviewer to
focus on specifically. -->
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]>
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.

4 participants