Bump tsfile to 2.4.1-260806-SNAPSHOT and add COPY_TO_WRITE_ERROR for COPY TO write failures - #18414
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18414 +/- ##
============================================
+ Coverage 43.59% 43.61% +0.01%
Complexity 374 374
============================================
Files 5393 5393
Lines 385604 385978 +374
Branches 50201 50268 +67
============================================
+ Hits 168095 168329 +234
- Misses 217509 217649 +140 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
When the target file write fails during COPY TO (e.g. due to insufficient
disk space), the IOException thrown by the underlying writer used to surface
as a generic EXECUTE_STATEMENT_ERROR with no way for callers to distinguish
it from other failures.
Add a dedicated COPY_TO_WRITE_ERROR(725) status code and translate the write
IOException in TableCopyToOperator into an IoTDBRuntimeException carrying it.
The exception is thrown without a cause chain so the error code survives the
query engine's getRootCause() unwrapping; the original IOException is logged
with its full stack trace at the translation site for debuggability.
Also null out the internal writer in TsFileFormatCopyToWriter on failure so
operator teardown does not double-close and the residual target file is
cleaned up. Messages are kept format-agnostic ("target file") since COPY TO
may support more output formats in the future.
COPY_TO_WRITE_ERROR is a known, expected failure already logged with its full stack trace at the failure source (TableCopyToOperator). Log it at info level without a stack trace in ErrorHandlingUtils.onQueryException to avoid duplicating the stack in the RPC layer, consistent with CANNOT_READ_TSFILE.
|
JackieTien97
approved these changes
Aug 7, 2026
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
Two changes:
tsfile.versionfrom2.3.2-260731-SNAPSHOTto2.4.1-260806-SNAPSHOT.COPY_TO_WRITE_ERRORhandling for COPY TO write failures.What it fixes
The previous tsfile
AbstractTableModelTsFileWriter.close()swallowedIOException, so when the disk ran out of space during the final flush of a small COPY TO export, the statement returned success withrow_count>0,device_count=0,size=0and left a 0-byte.tsfilebehind.2.4.1fixes this by making the writerclose()propagateIOException(fix(tsfile): propagate IOException on writer close instead of swallowing it tsfile#899). With the bump, the failure now surfaces duringseal().IOExceptionused to degrade to a genericEXECUTE_STATEMENT_ERROR, so callers could not tell COPY TO write failures apart from other errors. This PR adds a dedicatedCOPY_TO_WRITE_ERROR(725)status code and translates the writeIOExceptioninTableCopyToOperatorinto anIoTDBRuntimeExceptioncarrying it.getRootCause()unwrapping; the originalIOExceptionis logged with its full stack trace at the translation site for server-side debugging.TsFileFormatCopyToWriternow nulls out its internal writer on failure, so operator teardown does not double-close and the residual 0-byte target file is cleaned up (isFinishedstays false on failure).New files/constants
TSStatusCode.COPY_TO_WRITE_ERROR(725)DataNodeQueryMessages/UtilMessages, plus aStatusUtilsmappingTableCopyToOperator: translate writeIOException→IoTDBRuntimeException(COPY_TO_WRITE_ERROR)TsFileFormatCopyToWriter: null-out writer on failure (seal()/write())