You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by st...@apache.org on 2015/08/17 11:14:05 UTC
svn commit: r1696221 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
Author: stefanegli
Date: Mon Aug 17 09:14:05 2015
New Revision: 1696221
URL: http://svn.apache.org/r1696221
Log:
OAK-2739 : added a system property -Doak.documentMK.disableLeaseCheck which can be set to true for development purpose to disable this check
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java?rev=1696221&r1=1696220&r2=1696221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java Mon Aug 17 09:14:05 2015
@@ -196,6 +196,13 @@ public class ClusterNodeInfo {
private volatile boolean systemExitTriggered;
/**
+ * OAK-2739: for development it would be useful to be able to disable the
+ * lease check - hence there's a system property that does that:
+ * oak.documentMK.disableLeaseCheck
+ */
+ private final boolean leaseCheckDisabled;
+
+ /**
* Tracks the fact whether the lease has *ever* been renewed by this instance
* or has just be read from the document store at initialization time.
*/
@@ -231,6 +238,7 @@ public class ClusterNodeInfo {
this.state = state;
this.revRecoveryLock = revRecoveryLock;
this.newEntry = newEntry;
+ this.leaseCheckDisabled = Boolean.valueOf(System.getProperty("oak.documentMK.disableLeaseCheck", "false"));
}
public int getId() {
@@ -370,7 +378,9 @@ public class ClusterNodeInfo {
}
public void performLeaseCheck() {
- if (!renewed) {
+ if (leaseCheckDisabled || !renewed) {
+ // if leaseCheckDisabled is set we never do the check, so return fast
+
// the 'renewed' flag indicates if this instance *ever* renewed the lease after startup
// until that is not set, we cannot do the lease check (otherwise startup wouldn't work)
return;