You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "shuwenwei (via GitHub)" <gi...@apache.org> on 2023/06/14 02:35:22 UTC

[GitHub] [iotdb] shuwenwei opened a new pull request, #10146: Validate tsfiles after compaction

shuwenwei opened a new pull request, #10146:
URL: https://github.com/apache/iotdb/pull/10146

   ## Description
   Add configuration item 'compaction_validation_level'.
   ```
   # The level of validation after compaction
   # The details of these three levels are as follows:
   # 1. NONE: the validation after compaction is disabled.
   # 2. OVERLAP_ONLY: the validation after compaction check overlap only.
   # 3. OVERLAP_AND_FILE: the validation after compaction check overlap and file.
   # Datatype: String
   # compaction_validation_level=NONE
   ```


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] xingtanzjr merged pull request #10146: Validate tsfiles after compaction

Posted by "xingtanzjr (via GitHub)" <gi...@apache.org>.
xingtanzjr merged PR #10146:
URL: https://github.com/apache/iotdb/pull/10146


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] xingtanzjr commented on a diff in pull request #10146: Validate tsfiles after compaction

Posted by "xingtanzjr (via GitHub)" <gi...@apache.org>.
xingtanzjr commented on code in PR #10146:
URL: https://github.com/apache/iotdb/pull/10146#discussion_r1228905384


##########
server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/InnerSpaceCompactionTask.java:
##########
@@ -189,9 +189,9 @@ protected boolean doCompaction() {
           compactionLogger.logFile(targetTsFileResource, CompactionLogger.STR_DELETED_TARGET_FILES);
         }
 
-        if (IoTDBDescriptor.getInstance().getConfig().isEnableCompactionValidation()
-            && !CompactionUtils.validateTsFileResources(
-                tsFileManager, storageGroupName, timePartition)) {
+        CompactionValidator validator = CompactionValidator.getInstance();
+        if (!validator.validateCompaction(
+            tsFileManager, targetTsFileList, storageGroupName, timePartition)) {
           LOGGER.error(

Review Comment:
   Add more logs to illustrate why the validation is false. 



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] xingtanzjr commented on a diff in pull request #10146: Validate tsfiles after compaction

Posted by "xingtanzjr (via GitHub)" <gi...@apache.org>.
xingtanzjr commented on code in PR #10146:
URL: https://github.com/apache/iotdb/pull/10146#discussion_r1228906049


##########
server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/utils/validator/NoneCompactionValidator.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.engine.compaction.execute.utils.validator;
+
+import org.apache.iotdb.db.engine.storagegroup.TsFileManager;
+import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
+
+import java.util.List;
+
+public class NoneCompactionValidator implements CompactionValidator {
+
+  private NoneCompactionValidator() {}
+
+  public static NoneCompactionValidator getInstance() {
+    return NoneCompactionValidatorHolder.INSTANCE;
+  }
+
+  @Override
+  public boolean validateCompaction(

Review Comment:
   Maybe this method can return a class such as `ValidationResult` to represent the validation-result and detailed message if the validation is false. So that the invoker can add more error handle logic when validation is not passed such as print detailed logs



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] xingtanzjr commented on a diff in pull request #10146: Validate tsfiles after compaction

Posted by "xingtanzjr (via GitHub)" <gi...@apache.org>.
xingtanzjr commented on code in PR #10146:
URL: https://github.com/apache/iotdb/pull/10146#discussion_r1228907248


##########
server/src/main/java/org/apache/iotdb/db/engine/compaction/constant/CompactionValidationLevel.java:
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.engine.compaction.constant;
+
+public enum CompactionValidationLevel {

Review Comment:
   @qiaojialin Suggest to rename it to `NONE`、`RESOURCE_ONLY`、`RESOURCE_AND_TSFILE`



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org