Fix TsFileResource endTime error when insert empty tablet and flush#11404
Merged
xingtanzjr merged 2 commits intomasterfrom Oct 28, 2023
Merged
Fix TsFileResource endTime error when insert empty tablet and flush#11404xingtanzjr merged 2 commits intomasterfrom
xingtanzjr merged 2 commits intomasterfrom
Conversation
wangchao316
reviewed
Oct 27, 2023
| try { | ||
| tsFileProcessor.close(); | ||
| if (tsFileProcessor.isEmpty()) { | ||
| if (tsFileProcessor.isEmpty() || tsFileProcessor.getTsFileResource().isEmpty()) { |
Member
There was a problem hiding this comment.
hi , tsfile exsit and resource does not exsit, will delete tsfile?
Contributor
Author
There was a problem hiding this comment.
In this case, tsfile contains no data and resource file exists.
I'll update the PR description later.
|
SonarCloud Quality Gate failed.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11404 +/- ##
============================================
+ Coverage 48.58% 48.59% +0.01%
- Complexity 24434 24454 +20
============================================
Files 2817 2817
Lines 173009 173012 +3
Branches 20662 20663 +1
============================================
+ Hits 84049 84072 +23
+ Misses 88960 88940 -20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
xingtanzjr
approved these changes
Oct 28, 2023
caozj1011
approved these changes
Oct 28, 2023
Sh-Zh-7
pushed a commit
to Sh-Zh-7/iotdb
that referenced
this pull request
Oct 29, 2023
This was referenced Oct 30, 2023
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
When data is written using the insertTablet() interface and both values are null, exactly the data written is flushed. An empty TsFile file will be generated, the space cannot be deleted, and the generated resource file will be incorrect, and the endTime of the device will be Long.MIN_VALUE. This in turn affects query and merge mechanisms.
Based on this, this PR has the following two optimizations:
How to test
Execute the following code.
Then print the TsFileResource file, you will see the endTime is Long.MIN_VALUE.