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/05/09 10:54:32 UTC

[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #5843: [IOTDB-3117][snapshot] add authInfo snapshot.

MarcosZyk commented on code in PR #5843:
URL: https://github.com/apache/iotdb/pull/5843#discussion_r867885300


##########
confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java:
##########
@@ -331,6 +348,121 @@ public PermissionInfoResp executeListUserPrivileges(AuthorReq plan) throws AuthE
     }
   }
 
+  @Override
+  public boolean processTakeSnapshot(File snapshotDir) throws TException, IOException {
+    SystemFileFactory systemFileFactory = SystemFileFactory.INSTANCE;
+    File userFolder = systemFileFactory.getFile(commonConfig.getUserFolder());
+    File userSnapshotDir = systemFileFactory.getFile(snapshotDir, userSnapshotFileName);
+    File userTmpSnapshotDir =
+        systemFileFactory.getFile(userSnapshotDir.getAbsolutePath() + "-" + UUID.randomUUID());
+    File roleFolder = systemFileFactory.getFile(commonConfig.getRoleFolder());
+    File roleSnapshotDir = systemFileFactory.getFile(snapshotDir, roleSnapshotFileName);
+    File roleTmpSnapshotDir =
+        systemFileFactory.getFile(roleSnapshotDir.getAbsolutePath() + "-" + UUID.randomUUID());
+
+    boolean result = true;
+    synchronized (IAuthorizer.class) {
+      try {

Review Comment:
   If some other authorInfo write operation doesn't synchronize its process, will this synchronize mechanism work?



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