wchevreuil commented on code in PR #7084:
URL: https://github.com/apache/hbase/pull/7084#discussion_r2137592020


##########
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureSuspendedException.java:
##########
@@ -35,5 +38,21 @@ public ProcedureSuspendedException() {
    */
   public ProcedureSuspendedException(String s) {
     super(s);
+    shouldForceLockRelease = false;
+  }
+
+  /**
+   * Constructor
+   * @param s                      message
+   * @param shouldForceLockRelease if true, the procedure will release the 
lock regardless of
+   *                               {@link Procedure#holdLock(Object)}
+   */
+  public ProcedureSuspendedException(String s, boolean shouldForceLockRelease) 
{
+    super(s);
+    this.shouldForceLockRelease = shouldForceLockRelease;
+  }
+
+  public boolean shouldForceLockRelease() {

Review Comment:
   Shouldn't we just modify the SnapshotProcedure.holdLock() behaviour? 
Afterall, this is contrary to what we say in that method comment:
   
   `  protected boolean holdLock(MasterProcedureEnv env) {
       // In order to avoid enabling/disabling/modifying/deleting table during 
snapshot,
       // we don't release lock during suspend
       return true;
     }
   `
   And you are already modifying SnapshotProcedure execution logic to reflect 
the special condition when the lock should be released, so better keep this 
there and avoid changing ProcedureSuspendedException?



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

Reply via email to