Skip to content

[Query] Retry schema queries after transient internal write failures - #18296

Merged
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/schema-query-leader-stepdown-retry
Jul 29, 2026
Merged

[Query] Retry schema queries after transient internal write failures#18296
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/schema-query-leader-stepdown-retry

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Problem

A table-model SELECT may execute an internal TableNodeLocationAddNode write before reading a SchemaRegion. When that write exhausts the Ratis-level retry during a transient leader step-down, the retryable write failure was returned directly to the client as a statement execution error.

Fix

  • Reuse the existing write retry policy for this internal schema-query write.
  • Convert retryable internal write failures to DISPATCH_ERROR and set readNeedRetry, allowing the query scheduler to retry the query.
  • Preserve non-retryable failures and their original status.

Test

mvn -pl iotdb-core/datanode -am clean -Dtest=TableSchemaQueryWriteVisitorTest test

This PR has:

  • been self-reviewed.
  • added comments explaining the intent of the retry conversion.
  • added unit tests covering retryable and non-retryable internal write failures.
Key changed/added classes
  • TableSchemaQueryWriteVisitor
  • TableSchemaQueryWriteVisitorTest

@jt2594838
jt2594838 merged commit 2882aa9 into apache:master Jul 29, 2026
40 of 41 checks passed
@jt2594838
jt2594838 deleted the fix/schema-query-leader-stepdown-retry branch July 29, 2026 09:25
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