vaijosh commented on code in PR #3164:
URL: https://github.com/apache/hugegraph/pull/3164#discussion_r3988513427


##########
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/snapshot/SnapshotHandler.java:
##########
@@ -94,35 +93,41 @@ public void onSnapshotSave(final SnapshotWriter writer) 
throws HgStoreException
         final String snapshotDir = writer.getPath();
         if (partitionEngine != null) {
             Integer groupId = partitionEngine.getGroupId();
-            AtomicInteger state = businessHandler.getState(groupId);
-            if (state != null && state.get() == BusinessHandler.doing) {
-                return;
+            if (!businessHandler.tryLockCompactionRange(groupId)) {
+                throw new 
HgStoreException(HgStoreException.EC_RKDB_SNAPSHOT_SAVE_BUSY_FAIL,

Review Comment:
   Addressed Review comments.



##########
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/snapshot/SnapshotHandler.java:
##########
@@ -169,6 +174,15 @@ private String calculateChecksum(String path) {
     public void onSnapshotLoad(final SnapshotReader reader, long 
committedIndex) throws
                                                                                
  HgStoreException {
         final String snapshotDir = reader.getPath();
+        final String graphSnapshotDir = snapshotDir + File.separator + 
SNAPSHOT_DATA_PATH;
+
+        if (!new File(graphSnapshotDir).isDirectory()) {

Review Comment:
   Addressed Review comments.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to