You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/12/14 08:30:14 UTC

[GitHub] [iotdb] OneSizeFitsQuorum opened a new pull request, #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

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

   see [jira5174](https://issues.apache.org/jira/browse/IOTDB-5174)


-- 
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] OneSizeFitsQuorum commented on a diff in pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048170052


##########
consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java:
##########
@@ -124,6 +135,29 @@ private void persist() {
     }
   }
 
+  private void upgrade() {
+    File directory = new File(storageDir);
+    String oldPrefix = Utils.fromTEndPointToString(peer.getEndpoint()) + "-";
+    Optional.ofNullable(directory.listFiles((dir, name) -> name.startsWith(oldPrefix)))
+        .ifPresent(
+            files ->
+                Arrays.stream(files)
+                    .forEach(
+                        oldFile -> {
+                          long fileVersion = Long.parseLong(oldFile.getName().split("-")[1]);

Review Comment:
   In IoTDB 1.0, IoTConsensus cannot currently be restarted if hostname has -. So my assumption here is that if a real 1.0 user needs to upgrade, hostname will definitely not include `-`.



-- 
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] sonarcloud[bot] commented on pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#issuecomment-1350646580

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_incubator-iotdb&pullRequest=8458)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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 #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
xingtanzjr commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048165153


##########
consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java:
##########
@@ -124,6 +135,29 @@ private void persist() {
     }
   }
 
+  private void upgrade() {
+    File directory = new File(storageDir);
+    String oldPrefix = Utils.fromTEndPointToString(peer.getEndpoint()) + "-";
+    Optional.ofNullable(directory.listFiles((dir, name) -> name.startsWith(oldPrefix)))
+        .ifPresent(
+            files ->
+                Arrays.stream(files)
+                    .forEach(
+                        oldFile -> {
+                          long fileVersion = Long.parseLong(oldFile.getName().split("-")[1]);

Review Comment:
   Suggest to use the last element rather than the second element as the value of `fileVersion` because we already ha s some uses who deployed IoTDB in k8s where peer's endpoint contains `-`



-- 
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] OneSizeFitsQuorum commented on a diff in pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048194169


##########
consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java:
##########
@@ -124,6 +135,29 @@ private void persist() {
     }
   }
 
+  private void upgrade() {
+    File directory = new File(storageDir);
+    String oldPrefix = Utils.fromTEndPointToString(peer.getEndpoint()) + "-";
+    Optional.ofNullable(directory.listFiles((dir, name) -> name.startsWith(oldPrefix)))
+        .ifPresent(
+            files ->
+                Arrays.stream(files)
+                    .forEach(
+                        oldFile -> {
+                          long fileVersion = Long.parseLong(oldFile.getName().split("-")[1]);

Review Comment:
   Fixed



##########
consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java:
##########
@@ -44,16 +48,23 @@ public class IndexController {
   private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
 
   private final String storageDir;
+
+  private final Peer peer;
   private final String prefix;
   private final long initialIndex;
 
   private final long checkpointGap;
 
-  public IndexController(String storageDir, String prefix, long initialIndex, long checkpointGap) {
+  public IndexController(String storageDir, Peer peer, long initialIndex, long checkpointGap) {
     this.storageDir = storageDir;
-    this.prefix = prefix + '-';
+    this.peer = peer;
+    this.prefix = peer.getNodeId() + "-";

Review Comment:
   Fixed



-- 
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 #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
xingtanzjr commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048161543


##########
consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java:
##########
@@ -44,16 +48,23 @@ public class IndexController {
   private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
 
   private final String storageDir;
+
+  private final Peer peer;
   private final String prefix;
   private final long initialIndex;
 
   private final long checkpointGap;
 
-  public IndexController(String storageDir, String prefix, long initialIndex, long checkpointGap) {
+  public IndexController(String storageDir, Peer peer, long initialIndex, long checkpointGap) {
     this.storageDir = storageDir;
-    this.prefix = prefix + '-';
+    this.peer = peer;
+    this.prefix = peer.getNodeId() + "-";

Review Comment:
   Suggest to use a static string variable to represent the spliter `"-"`



-- 
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 #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
xingtanzjr commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048201252


##########
consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java:
##########
@@ -30,12 +32,16 @@
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.Optional;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /** An index controller class to balance the performance degradation of frequent disk I/O. */
 @ThreadSafe
 public class IndexController {
 
+  public static final String separator = "-";

Review Comment:
   uppercase ?



-- 
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] OneSizeFitsQuorum merged pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum merged PR #8458:
URL: https://github.com/apache/iotdb/pull/8458


-- 
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] OneSizeFitsQuorum commented on a diff in pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048193862


##########
consensus/src/test/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexControllerTest.java:
##########
@@ -58,28 +65,42 @@ public void testIncrementIntervalAfterRestart() {
     Assert.assertEquals(CHECK_POINT_GAP - 1, controller.getCurrentIndex());
     Assert.assertEquals(0, controller.getLastFlushedIndex());
 
-    controller = new IndexController(storageDir.getAbsolutePath(), prefix, 0, CHECK_POINT_GAP);
+    controller = new IndexController(storageDir.getAbsolutePath(), peer, 0, CHECK_POINT_GAP);
     Assert.assertEquals(0, controller.getCurrentIndex());
     Assert.assertEquals(0, controller.getLastFlushedIndex());
 
     controller.updateAndGet(CHECK_POINT_GAP + 1);
     Assert.assertEquals(CHECK_POINT_GAP + 1, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
-    controller = new IndexController(storageDir.getAbsolutePath(), prefix, 0, CHECK_POINT_GAP);
+    controller = new IndexController(storageDir.getAbsolutePath(), peer, 0, CHECK_POINT_GAP);
     Assert.assertEquals(CHECK_POINT_GAP, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
     controller.updateAndGet(CHECK_POINT_GAP * 2 - 1);
     Assert.assertEquals(CHECK_POINT_GAP * 2 - 1, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
-    controller = new IndexController(storageDir.getAbsolutePath(), prefix, 0, CHECK_POINT_GAP);
+    controller = new IndexController(storageDir.getAbsolutePath(), peer, 0, CHECK_POINT_GAP);
     Assert.assertEquals(CHECK_POINT_GAP, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
     controller.updateAndGet(CHECK_POINT_GAP * 2 + 1);
     Assert.assertEquals(CHECK_POINT_GAP * 2 + 1, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP * 2, controller.getLastFlushedIndex());
   }
+
+  @Test
+  public void testUpgrade() throws IOException {

Review Comment:
   I have change the default Peer ip from `127.0.0.1` to `datanode-1.datanode-svc`



-- 
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 #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
xingtanzjr commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048167140


##########
consensus/src/test/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexControllerTest.java:
##########
@@ -58,28 +65,42 @@ public void testIncrementIntervalAfterRestart() {
     Assert.assertEquals(CHECK_POINT_GAP - 1, controller.getCurrentIndex());
     Assert.assertEquals(0, controller.getLastFlushedIndex());
 
-    controller = new IndexController(storageDir.getAbsolutePath(), prefix, 0, CHECK_POINT_GAP);
+    controller = new IndexController(storageDir.getAbsolutePath(), peer, 0, CHECK_POINT_GAP);
     Assert.assertEquals(0, controller.getCurrentIndex());
     Assert.assertEquals(0, controller.getLastFlushedIndex());
 
     controller.updateAndGet(CHECK_POINT_GAP + 1);
     Assert.assertEquals(CHECK_POINT_GAP + 1, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
-    controller = new IndexController(storageDir.getAbsolutePath(), prefix, 0, CHECK_POINT_GAP);
+    controller = new IndexController(storageDir.getAbsolutePath(), peer, 0, CHECK_POINT_GAP);
     Assert.assertEquals(CHECK_POINT_GAP, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
     controller.updateAndGet(CHECK_POINT_GAP * 2 - 1);
     Assert.assertEquals(CHECK_POINT_GAP * 2 - 1, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
-    controller = new IndexController(storageDir.getAbsolutePath(), prefix, 0, CHECK_POINT_GAP);
+    controller = new IndexController(storageDir.getAbsolutePath(), peer, 0, CHECK_POINT_GAP);
     Assert.assertEquals(CHECK_POINT_GAP, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP, controller.getLastFlushedIndex());
 
     controller.updateAndGet(CHECK_POINT_GAP * 2 + 1);
     Assert.assertEquals(CHECK_POINT_GAP * 2 + 1, controller.getCurrentIndex());
     Assert.assertEquals(CHECK_POINT_GAP * 2, controller.getLastFlushedIndex());
   }
+
+  @Test
+  public void testUpgrade() throws IOException {

Review Comment:
   Suggest to add another UT to process the upgrade where the peer's endpoint contains `-`. 



-- 
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] sonarcloud[bot] commented on pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#issuecomment-1350727106

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_incubator-iotdb&pullRequest=8458)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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] sonarcloud[bot] commented on pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#issuecomment-1350706307

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_incubator-iotdb&pullRequest=8458)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=8458&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=8458&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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] OneSizeFitsQuorum commented on a diff in pull request #8458: [IOTDB-5174] Use filename format such as NodeID-Index rather than Endpoint-Index to track follower sync progress

Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #8458:
URL: https://github.com/apache/iotdb/pull/8458#discussion_r1048221903


##########
consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java:
##########
@@ -30,12 +32,16 @@
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.Optional;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /** An index controller class to balance the performance degradation of frequent disk I/O. */
 @ThreadSafe
 public class IndexController {
 
+  public static final String separator = "-";

Review Comment:
   I just follow the `File.separator` style. Maybe this is trivial?
   <img width="841" alt="image" src="https://user-images.githubusercontent.com/32640567/207559815-db1038ea-aea0-49f7-a614-50c354836704.png">
   



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