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


##########
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/business/BusinessHandlerImpl.java:
##########
@@ -154,6 +165,18 @@ public class BusinessHandlerImpl implements 
BusinessHandler {
     private final InnerKeyCreator keyCreator;
     private final Semaphore semaphore = new Semaphore(1);
 
+    /* Bounds how long dbCompaction() waits to acquire compactionRangeLock 
when a snapshot
+     save is holding it. saveSnapshot() is a RocksDB Checkpoint (hard-links 
existing SST
+     files, no data copy) plus a partial checksum read, so the lock is 
normally held for
+     well under a second, at most a few seconds under a slow/busy disk. 10s 
gives generous
+     margin over that expected hold time while keeping a stuck snapshot save 
from blocking
+     compaction for long: if the wait is exceeded, dbCompaction just skips 
this pass and
+     relies on the next trigger (PD instruction, REST call, etc.) to retry - 
see the

Review Comment:
   @bitflicker64 
   I think the wording in the comment is correct. It says:
   
   dbCompaction just skips this pass --  Means “If the lock wait is exceeded, 
dbCompaction() gives up on that attempt and skips the current pass.”
   “It relies on the next trigger (PD instruction, REST call, etc.).” -- Means 
that compaction does not spin or schedule an immediate internal retry in that 
code path. If tryLock() times out, the current attempt ends, and a later 
external trigger—such as a PD instruction, REST call, or another compaction 
request—can start a new attempt.
   
   Nowhere do we mention an “internal retry in that code path.” 
   
   Earlier I had removed the line because it looked redundant at that place.



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