Skip to content

Preserve write-path causes and return delete failure details - #18933

Merged
jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:codex/write-path-diagnostics
Oct 23, 2026
Merged

jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:codex/write-path-diagnostics

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Failed write-path operations can lose the details needed to diagnose them: several handlers log only the exception message, and DELETE error responses discard the message entirely.

Preserve the original exceptions and nested causes in ConfigNode table-schema lookup, WAL metadata reads and recovery, and file-time-index cache I/O logs. Also correct the WAL recovery warning to report the WAL node directory name.

For tree-model and table-model DELETE failures, return the original exception message alongside the existing WRITE_PROCESS_ERROR (605) status. This lets clients see why deletion failed, including existing localized exception messages, while preserving the status codes and retry behavior.

Keep message-only logging for self-explanatory SemanticException, TableLostRuntimeException, and IllegalPathException failures, while retaining stack traces for I/O failures.

Regression tests cover message-only logging and returned status for batch-insert semantic and table-loss failures, message-only logging for illegal-path DELETE failures, retained I/O failure stack traces, and failure messages for ordinary tree deletes, direct whole-database tree deletes, and table deletes.

Validation

  • mvn -nsu spotless:apply -pl iotdb-core/datanode
  • mvn -nsu test-compile -DskipTests (English; all 53 modules passed)
  • mvn -nsu surefire:test -pl iotdb-core/datanode -am -Dtest=DataExecutionVisitorTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false (English; 6 tests passed)
  • mvn -nsu test-compile -DskipTests -P with-zh-locale (Chinese; all 53 modules passed)
  • mvn -nsu surefire:test -pl iotdb-core/datanode -am -P with-zh-locale -Dtest=DataExecutionVisitorTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false (Chinese; 6 tests passed)

Both full test compilations used a 1 GiB Maven heap.

  • Self-reviewed.
  • Added regression tests for logging behavior and user-visible failure details.

@Caideyipi Caideyipi changed the title Preserve causes in write-path diagnostics Preserve write-path causes and return delete failure details Oct 20, 2026
Comment on lines +236 to +237
} catch (SemanticException | TableLostRuntimeException e) {
LOGGER.error(DataNodeMiscMessages.ERROR_EXECUTING_PLAN_NODE_CAUSED, node, e.getMessage());
LOGGER.error(DataNodeMiscMessages.ERROR_EXECUTING_PLAN_NODE_CAUSED, node, e.getMessage(), e);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two exceptions are generally self-explanatory, no need to record the stack.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in ee51b9b. SemanticException and TableLostRuntimeException now log only the plan node and exception message. The regression tests verify that their original status codes/messages are preserved and no stack trace is logged.

Comment on lines +348 to +350
} catch (IOException | IllegalPathException e) {
LOGGER.error(DataNodeMiscMessages.ERROR_EXECUTING_PLAN_NODE, node, e);
return new TSStatus(TSStatusCode.WRITE_PROCESS_ERROR.getStatusCode());
return RpcUtils.getStatus(TSStatusCode.WRITE_PROCESS_ERROR, e.getMessage());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to record the stack for IllegalPathException.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in ee51b9b. Split the catches so IllegalPathException logs only its message, while IOException still logs the stack trace. The WRITE_PROCESS_ERROR response still includes the original message. Regression tests cover both logging behaviors and write-lock release.

@jt2594838
jt2594838 merged commit 02e675a into apache:master Oct 23, 2026
39 checks passed
@jt2594838
jt2594838 deleted the codex/write-path-diagnostics branch October 23, 2026 01:55
jt2594838 pushed a commit that referenced this pull request Oct 23, 2026
…#18993)

* Preserve causes in write-path diagnostics

* Return delete failure details to clients

* Avoid stack traces for expected write-path errors
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