Skip to content

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

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/schema-query-leader-stepdown-retry
Open

[Query] Retry schema queries after transient internal write failures#18296
Caideyipi wants to merge 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

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.

1 participant