Repository navigation
[To dev/1.3] Fix schema file I/O failure handling and short writes - #19214
Merged
Merged
Conversation
Backport the requested schema-file I/O fix to the 1.3 branch, preserving its failure cleanup, complete writes and regression coverage. (cherry picked from commit e3b6002)
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.
Description
Backport #19190 (
e3b60020bbb34b60e1272dbad4f291635309a6f6) todev/1.3, based onf1e915ae2b80513857b5c40f73aff85fbe20ffe2.Schema-file initialization, shutdown, and writes can leave incomplete data or open resources after an I/O failure. This change completes short header and page writes, persists a valid initial header immediately, and attempts every cleanup step while retaining the first exception and suppressing later cleanup failures.
For example, when a page write consumes three bytes and the next write returns zero or throws an
IOException, the operation now fails and the page remains dirty. A later flush retries the entire page from its original file offset. If initialization fails, resources are closed and the partial new file is truncated before a retry.Compatibility adaptations
node-commonslocale source selection and the required English/Chinese message class. Port the existing schema-version error constant into the DataNode locale classes.FileChannel.writecalls.Validation
mvn spotless:apply -P with-integration-tests -pl iotdb-core/datanode,iotdb-core/node-commonspassed.git diff --checkpassed; source-path coverage, locale-key parity, message hash, and source architecture test were checked.common, but its clean TsFile install exceeded the 20-minute verification budget during dependency/plugin resolution. IoTDB regression tests and Chinese-locale compilation were not run.This PR has:
Key changed classes
IOUtils,SchemaFile,SchemaPage,PageIOChannel,PageManager