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 2021/09/28 12:41:11 UTC

[GitHub] [iotdb] jamber001 opened a new pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

jamber001 opened a new pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054


   [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery


-- 
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] coveralls edited a comment on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-929208916


   
   [![Coverage Status](https://coveralls.io/builds/43122048/badge)](https://coveralls.io/builds/43122048)
   
   Coverage increased (+0.03%) to 67.486% when pulling **489df313c9ccac2e3093ca06edc0a7bacd2f3d46 on jamber001:IOTDB-1758** into **1e12e6581b03b40956184a610063c2198466afbd on apache:master**.
   


-- 
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] coveralls commented on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-929208916


   
   [![Coverage Status](https://coveralls.io/builds/43121169/badge)](https://coveralls.io/builds/43121169)
   
   Coverage increased (+0.02%) to 67.479% when pulling **489df313c9ccac2e3093ca06edc0a7bacd2f3d46 on jamber001:IOTDB-1758** into **1e12e6581b03b40956184a610063c2198466afbd on apache:master**.
   


-- 
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] jamber001 commented on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
jamber001 commented on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-939201013


   @HTHou  Could you help merg this PR?


-- 
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] jamber001 commented on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
jamber001 commented on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-938441652


   > LGTM
   
   Thank you.   ^-^


-- 
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] coveralls edited a comment on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-929208916


   
   [![Coverage Status](https://coveralls.io/builds/43140980/badge)](https://coveralls.io/builds/43140980)
   
   Coverage increased (+0.02%) to 67.763% when pulling **8e942951e6533d500d98719b827c45454b28cff1 on jamber001:IOTDB-1758** into **0163d3aa76d452fe2c1d864790451dcfd3d5cd5e on apache:master**.
   


-- 
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] jamber001 commented on a change in pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
jamber001 commented on a change in pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#discussion_r718252276



##########
File path: server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
##########
@@ -339,27 +339,44 @@ public void confirmIdentity() throws SyncConnectionException {
 
   /** UUID marks the identity of sender for receiver. */
   private String getOrCreateUUID(File uuidFile) throws IOException {
-    String uuid;
     if (!uuidFile.getParentFile().exists()) {
       uuidFile.getParentFile().mkdirs();
     }
-    if (!uuidFile.exists()) {
-      try (FileOutputStream out = new FileOutputStream(uuidFile)) {
-        uuid = generateUUID();
-        out.write(uuid.getBytes());
-      } catch (IOException e) {
-        logger.error("Cannot insert UUID to file {}", uuidFile.getPath());
-        throw new IOException(e);
+
+    boolean hasCreatNewUuidFile = false;
+    for (int i = 0; i < 2; i++) {
+      if (!uuidFile.exists()) {

Review comment:
       @wangchao316   How about new code change?   :-)




-- 
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] coveralls commented on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-929208916


   
   [![Coverage Status](https://coveralls.io/builds/43121169/badge)](https://coveralls.io/builds/43121169)
   
   Coverage increased (+0.02%) to 67.479% when pulling **489df313c9ccac2e3093ca06edc0a7bacd2f3d46 on jamber001:IOTDB-1758** into **1e12e6581b03b40956184a610063c2198466afbd on apache:master**.
   


-- 
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] jamber001 commented on a change in pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
jamber001 commented on a change in pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#discussion_r718138133



##########
File path: server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
##########
@@ -339,27 +339,44 @@ public void confirmIdentity() throws SyncConnectionException {
 
   /** UUID marks the identity of sender for receiver. */
   private String getOrCreateUUID(File uuidFile) throws IOException {
-    String uuid;
     if (!uuidFile.getParentFile().exists()) {
       uuidFile.getParentFile().mkdirs();
     }
-    if (!uuidFile.exists()) {
-      try (FileOutputStream out = new FileOutputStream(uuidFile)) {
-        uuid = generateUUID();
-        out.write(uuid.getBytes());
-      } catch (IOException e) {
-        logger.error("Cannot insert UUID to file {}", uuidFile.getPath());
-        throw new IOException(e);
+
+    boolean hasCreatNewUuidFile = false;
+    for (int i = 0; i < 2; i++) {
+      if (!uuidFile.exists()) {

Review comment:
       Original thought is to read uuid from uuidfile again after create new uuidfile.
   Please read new submit codes, have changed this part.




-- 
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] HTHou merged pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
HTHou merged pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054


   


-- 
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] jamber001 commented on a change in pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
jamber001 commented on a change in pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#discussion_r718138133



##########
File path: server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
##########
@@ -339,27 +339,44 @@ public void confirmIdentity() throws SyncConnectionException {
 
   /** UUID marks the identity of sender for receiver. */
   private String getOrCreateUUID(File uuidFile) throws IOException {
-    String uuid;
     if (!uuidFile.getParentFile().exists()) {
       uuidFile.getParentFile().mkdirs();
     }
-    if (!uuidFile.exists()) {
-      try (FileOutputStream out = new FileOutputStream(uuidFile)) {
-        uuid = generateUUID();
-        out.write(uuid.getBytes());
-      } catch (IOException e) {
-        logger.error("Cannot insert UUID to file {}", uuidFile.getPath());
-        throw new IOException(e);
+
+    boolean hasCreatNewUuidFile = false;
+    for (int i = 0; i < 2; i++) {
+      if (!uuidFile.exists()) {

Review comment:
       Original thought is to read uuid from uuidfile again after create new uuidfile.
   Please read new submit codes, have changed this part.

##########
File path: server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
##########
@@ -339,27 +339,44 @@ public void confirmIdentity() throws SyncConnectionException {
 
   /** UUID marks the identity of sender for receiver. */
   private String getOrCreateUUID(File uuidFile) throws IOException {
-    String uuid;
     if (!uuidFile.getParentFile().exists()) {
       uuidFile.getParentFile().mkdirs();
     }
-    if (!uuidFile.exists()) {
-      try (FileOutputStream out = new FileOutputStream(uuidFile)) {
-        uuid = generateUUID();
-        out.write(uuid.getBytes());
-      } catch (IOException e) {
-        logger.error("Cannot insert UUID to file {}", uuidFile.getPath());
-        throw new IOException(e);
+
+    boolean hasCreatNewUuidFile = false;
+    for (int i = 0; i < 2; i++) {
+      if (!uuidFile.exists()) {

Review comment:
       @wangchao316   How about new code change?   :-)




-- 
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] coveralls edited a comment on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-929208916


   
   [![Coverage Status](https://coveralls.io/builds/43122048/badge)](https://coveralls.io/builds/43122048)
   
   Coverage increased (+0.03%) to 67.486% when pulling **489df313c9ccac2e3093ca06edc0a7bacd2f3d46 on jamber001:IOTDB-1758** into **1e12e6581b03b40956184a610063c2198466afbd on apache:master**.
   


-- 
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] coveralls edited a comment on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-929208916


   
   [![Coverage Status](https://coveralls.io/builds/43140980/badge)](https://coveralls.io/builds/43140980)
   
   Coverage increased (+0.02%) to 67.763% when pulling **8e942951e6533d500d98719b827c45454b28cff1 on jamber001:IOTDB-1758** into **0163d3aa76d452fe2c1d864790451dcfd3d5cd5e on apache:master**.
   


-- 
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] jamber001 commented on pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
jamber001 commented on pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#issuecomment-930679305


   @wangchao316  Could you help review the latest codes?   ^-^


-- 
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] wangchao316 commented on a change in pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
wangchao316 commented on a change in pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#discussion_r718129971



##########
File path: server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
##########
@@ -339,27 +339,44 @@ public void confirmIdentity() throws SyncConnectionException {
 
   /** UUID marks the identity of sender for receiver. */
   private String getOrCreateUUID(File uuidFile) throws IOException {
-    String uuid;
     if (!uuidFile.getParentFile().exists()) {
       uuidFile.getParentFile().mkdirs();
     }
-    if (!uuidFile.exists()) {
-      try (FileOutputStream out = new FileOutputStream(uuidFile)) {
-        uuid = generateUUID();
-        out.write(uuid.getBytes());
-      } catch (IOException e) {
-        logger.error("Cannot insert UUID to file {}", uuidFile.getPath());
-        throw new IOException(e);
+
+    boolean hasCreatNewUuidFile = false;
+    for (int i = 0; i < 2; i++) {
+      if (!uuidFile.exists()) {

Review comment:
       hi , why use for 2 twice?
   




-- 
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] wangchao316 commented on a change in pull request #4054: [IOTDB-1758] sync-tool, empty uuid file cause tool can not auto-recovery

Posted by GitBox <gi...@apache.org>.
wangchao316 commented on a change in pull request #4054:
URL: https://github.com/apache/iotdb/pull/4054#discussion_r718129971



##########
File path: server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
##########
@@ -339,27 +339,44 @@ public void confirmIdentity() throws SyncConnectionException {
 
   /** UUID marks the identity of sender for receiver. */
   private String getOrCreateUUID(File uuidFile) throws IOException {
-    String uuid;
     if (!uuidFile.getParentFile().exists()) {
       uuidFile.getParentFile().mkdirs();
     }
-    if (!uuidFile.exists()) {
-      try (FileOutputStream out = new FileOutputStream(uuidFile)) {
-        uuid = generateUUID();
-        out.write(uuid.getBytes());
-      } catch (IOException e) {
-        logger.error("Cannot insert UUID to file {}", uuidFile.getPath());
-        throw new IOException(e);
+
+    boolean hasCreatNewUuidFile = false;
+    for (int i = 0; i < 2; i++) {
+      if (!uuidFile.exists()) {

Review comment:
       hi , why use for 2 twice?
   




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