You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2021/11/03 07:59:04 UTC

[GitHub] [jackrabbit-oak] thomasmueller commented on a change in pull request #406: OAK-9610: Have a jmx to explicitly expire indexing lease in mongo mk

thomasmueller commented on a change in pull request #406:
URL: https://github.com/apache/jackrabbit-oak/pull/406#discussion_r741681015



##########
File path: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
##########
@@ -488,6 +488,14 @@ public void close() {
 
     private void runWhenPermitted() {
         if (indexStats.isPaused()) {
+            if (indexStats.forcedLeaseRelease){
+                try {
+                    clearLease();
+                } catch (CommitFailedException e) {
+                    log.warn("Unable to release lease, please try again");

Review comment:
       Please log the exception (message and stack trace):
   
       log.warn("Unable to release lease, please try again", e);
   

##########
File path: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
##########
@@ -626,6 +634,22 @@ private void runWhenPermitted() {
         }
     }
 
+    private void clearLease() throws CommitFailedException {
+        NodeState root = store.getRoot();
+        NodeState async = root.getChildNode(ASYNC);
+        String beforeCheckpoint = async.getString(name);
+        if (async.hasProperty(leasify(name))) {
+            NodeBuilder builder = root.builder();
+            builder.child(ASYNC).removeProperty(leasify(name));
+            mergeWithConcurrencyCheck(store, validatorProviders,
+                    builder, beforeCheckpoint, null, name);
+            log.debug("Lease property removed for lane: {}", name);

Review comment:
       I would use log.info in this method (both cases), it is not called that often.

##########
File path: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
##########
@@ -626,6 +634,22 @@ private void runWhenPermitted() {
         }
     }
 
+    private void clearLease() throws CommitFailedException {
+        NodeState root = store.getRoot();
+        NodeState async = root.getChildNode(ASYNC);
+        String beforeCheckpoint = async.getString(name);
+        if (async.hasProperty(leasify(name))) {
+            NodeBuilder builder = root.builder();
+            builder.child(ASYNC).removeProperty(leasify(name));

Review comment:
       I would call leasify(name) only once.




-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org