Categorize generic INVALID_STATE telemetry into specific error codes#1447
Draft
samikshya-db wants to merge 1 commit into
Draft
Categorize generic INVALID_STATE telemetry into specific error codes#1447samikshya-db wants to merge 1 commit into
samikshya-db wants to merge 1 commit into
Conversation
Replace the generic INVALID_STATE driver error code at ~30 call sites with more specific DatabricksDriverErrorCode values so telemetry buckets are actionable. INVALID_STATE remains as a fallback for genuinely unknown states. New codes (1045-1052): - CURSOR_INVALID_POSITION result-set cursor before-first / out-of-batch - COLUMN_INDEX_OUT_OF_BOUNDS column index exceeds column count - ROW_INDEX_OUT_OF_BOUNDS row index out of bounds (ColumnarRowView) - THRIFT_RPC_ERROR TException wrapping in DatabricksThriftAccessor - THRIFT_RESPONSE_MISMATCH chunk start row offset mismatch - INVALID_RESPONSE_FORMAT empty/unknown response format in manifest - THREAD_POOL_EXECUTION_ERROR ExecutionException in parallel work - STREAM_READ_ERROR IOException / byte-count mismatch on InputStream Existing-code reuse: - INPUT_VALIDATION_ERROR (1015) for null-arg / parameter-validation sites in DatabricksMetadataQueryClient, DatabricksDatabaseMetaData, DatabricksPreparedStatement, PreparedStatementBatchExecutor - VOLUME_OPERATION_INVALID_STATE (1028) for DBFSVolumeClient state errors - NOT_IMPLEMENTED_OPERATION for DatabricksThriftServiceClient getResultChunksData not-implemented branch Updated LazyThriftInlineArrowResultTest assertions to match the new codes. Co-authored-by: Isaac Signed-off-by: samikshya-chand_data <samikshya.chand@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
INVALID_STATEdriver error code at ~30 call sites with more specificDatabricksDriverErrorCodevalues so telemetry error-name buckets are actionable.INVALID_STATEremains as a fallback only for genuinely unknown states (~6 sites).CURSOR_INVALID_POSITION,COLUMN_INDEX_OUT_OF_BOUNDS,ROW_INDEX_OUT_OF_BOUNDS,THRIFT_RPC_ERROR,THRIFT_RESPONSE_MISMATCH,INVALID_RESPONSE_FORMAT,THREAD_POOL_EXECUTION_ERROR,STREAM_READ_ERROR.INPUT_VALIDATION_ERROR(1015) for null-arg/parameter-validation sites andVOLUME_OPERATION_INVALID_STATE(1028) forDBFSVolumeClientstate errors.Why
INVALID_STATEwas being used as a catch-all across very different failure paths — result-set cursor navigation, Thrift RPC failures, null-arg validation, thread-pool failures, stream I/O, response-format errors. Telemetry buckets keyed on the error name were mixing unrelated failures, making it hard to tell whether a spike represented an application bug (cursor misuse), a Thrift server issue, or stream-read trouble.Behavior change
Applications that catch
DatabricksSQLExceptionand key ongetSQLState() == "INVALID_STATE"for result-set navigation, Thrift RPC, or stream-read failures will now see the new state names. Documented inNEXT_CHANGELOG.md.Test plan
mvn spotless:apply(done locally)mvn test— particularly the result-set, Thrift, and prepared-statement suites;LazyThriftInlineArrowResultTestassertions were updated to the new codesThis pull request and its description were written by Isaac.