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/10 02:57:09 UTC

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

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


##########
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:
   I use ReentrantReadWriteLock in AuthorizerManager to fix this problem.



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