[To rel/0.13][IOTDB-5726]Select the last sealed seq file for nonOverlap unseq files to compact in cross compaction#9495
Merged
xingtanzjr merged 3 commits intoapache:rel/0.13from Apr 7, 2023
Conversation
xingtanzjr
reviewed
Apr 4, 2023
| selectOverlappedSeqFiles(unseqFile); | ||
| } | ||
| if (!hasFoundSeqFiles(unseqFile)) { | ||
| tmpSelectedSeqFiles.clear(); |
Contributor
There was a problem hiding this comment.
This line is unnecessary
xingtanzjr
reviewed
Apr 4, 2023
| return true; | ||
| } | ||
| // the current unseq file does not overlap with any seq files | ||
| logger.info("Unseq file {} does not overlap with seq files.", unseqFile); |
Contributor
There was a problem hiding this comment.
Suggest to make line 250-257 as a separate method such as trySelectLatestSealedSeqFile(). And then change the judgement above into
if (!hasFoundSeqFiles(unseqFile) && !trySelectLatestSealedSeqFile()) {
break;
}
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
Cross space compaction select one unseq file but none seq file, which causes cross compaction under this time partition can never be performed.
Reason
Unseq file does not overlap with any seq files under this time partition, including two cases: 1. The devices under the unseq files do not exist in the seq files. 2. The device of the unseq file exists in the seq file, but unseqDevice.startTime>seqDevice.endTime. This can happen if the data is deleted and an seq inner space compaction has been performed.
Solution
For nonOverlap unseq files, select the last sealed seq file, if it is valid (status is closed), then select it, otherwise stop the selection.