thomasmueller commented on code in PR #1522:
URL: https://github.com/apache/jackrabbit-oak/pull/1522#discussion_r1639552708


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java:
##########
@@ -1242,6 +1242,62 @@ public String getReferenceCheckpoint() {
             return referenceCp;
         }
 
+        @Override
+        public String forceIndexLaneCatchup(String confirmMessage) throws 
CommitFailedException {
+
+            if (!"CONFIRM".equals(confirmMessage)) {
+                String msg = "Please confirm that you want to force the lane 
catch-up by passing 'CONFIRM' as argument";
+                log.warn(msg);
+                return msg;
+            }
+
+            if (!this.isFailing()) {
+                String msg = "The lane is not failing. This operation should 
only be performed if the lane is failing, it should first be allowed to catch 
up on its own.";
+                log.warn(msg);
+                return msg;
+            }
+
+            try {
+                log.info("Running a forced catch-up for indexing lane [{}]. ", 
name);
+                // First we need to abort and pause the running indexing task
+                this.abortAndPause();

Review Comment:
   I wouldn't mind if this is just an additional preconditions... instead of 
doing it here, just verify it's done. But it's OK, no need to change it now.
   
   (the idea is: We don't want this feature is used a lot, so making it a 
little bit harder to use might help that it is used less often... The "CONFIRM" 
is a great example of that!... Do not make it easy to delete stuff, so that 
it's less likely that stuff is deleted by mistake.)



##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java:
##########
@@ -1242,6 +1242,62 @@ public String getReferenceCheckpoint() {
             return referenceCp;
         }
 
+        @Override
+        public String forceIndexLaneCatchup(String confirmMessage) throws 
CommitFailedException {
+
+            if (!"CONFIRM".equals(confirmMessage)) {
+                String msg = "Please confirm that you want to force the lane 
catch-up by passing 'CONFIRM' as argument";
+                log.warn(msg);
+                return msg;
+            }
+
+            if (!this.isFailing()) {

Review Comment:
   In theory (not now, but maybe later) we could add an additional check: only 
allow if the indexing lane is behind more than 30 minutes, or something like 
that.
   
   But again, not needed right now.



##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java:
##########
@@ -1242,6 +1242,62 @@ public String getReferenceCheckpoint() {
             return referenceCp;
         }
 
+        @Override
+        public String forceIndexLaneCatchup(String confirmMessage) throws 
CommitFailedException {
+
+            if (!"CONFIRM".equals(confirmMessage)) {
+                String msg = "Please confirm that you want to force the lane 
catch-up by passing 'CONFIRM' as argument";
+                log.warn(msg);
+                return msg;
+            }
+
+            if (!this.isFailing()) {
+                String msg = "The lane is not failing. This operation should 
only be performed if the lane is failing, it should first be allowed to catch 
up on its own.";
+                log.warn(msg);
+                return msg;
+            }
+
+            try {
+                log.info("Running a forced catch-up for indexing lane [{}]. ", 
name);
+                // First we need to abort and pause the running indexing task
+                this.abortAndPause();
+                log.info("Aborted and paused async indexing for lane [{}]", 
name);
+                // Release lease for the paused lane
+                this.releaseLeaseForPausedLane();
+                log.info("Released lease for paused lane [{}]", name);
+                String newReferenceCheckpoint = store.checkpoint(lifetime, 
Map.of(

Review Comment:
   Ah, DEFAULT_LIFETIME is 1000 days! could you change that to 100 days please? 
That should still be plenty, but (hopefully) will result in slightly less 
"orphaned checkpoints".



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

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

Reply via email to