Skip to content

[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
choubenson:specialCompaction0.13
Apr 7, 2023
Merged

[To rel/0.13][IOTDB-5726]Select the last sealed seq file for nonOverlap unseq files to compact in cross compaction#9495
xingtanzjr merged 3 commits intoapache:rel/0.13from
choubenson:specialCompaction0.13

Conversation

@choubenson
Copy link
Copy Markdown
Contributor

@choubenson choubenson commented Mar 31, 2023

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.

selectOverlappedSeqFiles(unseqFile);
}
if (!hasFoundSeqFiles(unseqFile)) {
tmpSelectedSeqFiles.clear();
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.

This line is unnecessary

return true;
}
// the current unseq file does not overlap with any seq files
logger.info("Unseq file {} does not overlap with seq files.", unseqFile);
Copy link
Copy Markdown
Contributor

@xingtanzjr xingtanzjr Apr 4, 2023

Choose a reason for hiding this comment

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

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;
}

@xingtanzjr xingtanzjr merged commit 66ba374 into apache:rel/0.13 Apr 7, 2023
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