jt2594838 commented on code in PR #14712:
URL: https://github.com/apache/iotdb/pull/14712#discussion_r1921718689
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/repair/RepairDataFileScanUtil.java:
##########
@@ -283,10 +282,27 @@ private void checkNonAlignedDeviceSeries(
if (!checkTsFileResource || actualDeviceStartTime > actualDeviceEndTime) {
return;
}
- TimeRange actualDeviceTimeRange = new TimeRange(actualDeviceStartTime,
actualDeviceEndTime);
- if (!actualDeviceTimeRange.equals(deviceTimeRangeInResource)) {
- throw new CompactionStatisticsCheckFailedException(
- device, deviceTimeRangeInResource, actualDeviceTimeRange);
+ compareDeviceTimeRange(
+ device,
+ deviceTimeRangeInResource,
+ new TimeRange(actualDeviceStartTime, actualDeviceEndTime));
+ }
+
+ private void compareDeviceTimeRange(
+ IDeviceID device, TimeRange deviceTimeRangeInResource, TimeRange
actualDeviceTimeRange) {
+ long innerCompactionCount =
resource.getTsFileID().getInnerCompactionCount();
+ if (innerCompactionCount == 0) {
+ // for the files generate by flush with deletions, the statistics may be
larger than the
+ // actual
+ if (!deviceTimeRangeInResource.contains(actualDeviceTimeRange)) {
+ throw new CompactionStatisticsCheckFailedException(
+ device, deviceTimeRangeInResource, actualDeviceTimeRange);
+ }
+ } else {
+ if (!actualDeviceTimeRange.equals(deviceTimeRangeInResource)) {
+ throw new CompactionStatisticsCheckFailedException(
+ device, deviceTimeRangeInResource, actualDeviceTimeRange);
+ }
Review Comment:
The two exceptions seem identical. Is the upper level or the log able to
distinguish them (the missing of a device or the mismatch of time range)?
--
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]