THUMarkLau commented on a change in pull request #4549:
URL: https://github.com/apache/iotdb/pull/4549#discussion_r766303638
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/sizetiered/SizeTieredCompactionRecoverTask.java
##########
@@ -93,33 +103,76 @@ public void doCompaction() {
logAnalyzer.analyze();
List<TsFileIdentifier> sourceFileIdentifiers =
logAnalyzer.getSourceFileInfos();
TsFileIdentifier targetFileIdentifier =
logAnalyzer.getTargetFileInfo();
+
+ // compaction log file is incomplete
if (targetFileIdentifier == null || sourceFileIdentifiers.isEmpty()) {
LOGGER.info(
"{}-{} [Compaction][Recover] incomplete log file, abort recover",
logicalStorageGroupName,
virtualStorageGroup);
return;
}
- File targetFile = targetFileIdentifier.getFileFromDataDirs();
- if (targetFile == null) {
- // cannot find target file from data dirs
- LOGGER.info(
- "{}-{} [Compaction][Recover] cannot find target file {} from
data dirs, abort recover",
- logicalStorageGroupName,
- virtualStorageGroup,
- targetFileIdentifier);
- return;
+ // xxx.target
+ File tmpTargetFile = targetFileIdentifier.getFileFromDataDirs();
+ // xxx.tsfile
+ File targetFile =
+ new File(
+ targetFileIdentifier
+ .getFilePath()
+ .replace(
+ TsFileNameGenerator.COMPACTION_TMP_FILE_SUFFIX,
+ TsFileConstant.TSFILE_SUFFIX));
+ // xxx.target.resource
+ File tmpTargetResourceFile =
+ new File(targetFileIdentifier.getFilePath() +
TsFileResource.RESOURCE_SUFFIX);
+ // xxx.tsfile.resource
+ File targetResourceFile = new File(targetFile.getPath() +
TsFileResource.RESOURCE_SUFFIX);
+
+ if (tmpTargetFile != null) {
+ // xxx.target exists, then remove it to xxx.tsfile
Review comment:
move it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]