Author: reschke
Date: Thu Mar 17 12:14:13 2016
New Revision: 1735406

URL: http://svn.apache.org/viewvc?rev=1735406&view=rev
Log:
OAK-4100: ClusterNodeInfo lease renewal: add DEBUG level logging (ported to 1.4)

add DEBUG-level log of update result plus TRACE-level log of renewLease() 
invocation

Modified:
    jackrabbit/oak/branches/1.4/   (props changed)
    
jackrabbit/oak/branches/1.4/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java

Propchange: jackrabbit/oak/branches/1.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 17 12:14:13 2016
@@ -1,3 +1,3 @@
 /jackrabbit/oak/branches/1.0:1665962
-/jackrabbit/oak/trunk:1733615,1733875,1733913,1734230,1734254,1735052
+/jackrabbit/oak/trunk:1733615,1733875,1733913,1734230,1734254,1735052,1735405
 /jackrabbit/trunk:1345480

Modified: 
jackrabbit/oak/branches/1.4/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.4/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java?rev=1735406&r1=1735405&r2=1735406&view=diff
==============================================================================
--- 
jackrabbit/oak/branches/1.4/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
 (original)
+++ 
jackrabbit/oak/branches/1.4/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
 Thu Mar 17 12:14:13 2016
@@ -715,6 +715,11 @@ public class ClusterNodeInfo {
      */
     public boolean renewLease() {
         long now = getCurrentTime();
+
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("renewLease - leaseEndTime: " + leaseEndTime + ", 
leaseTime: " + leaseTime + ", leaseUpdateInterval: " + leaseUpdateInterval);
+        }
+
         if (now < leaseEndTime - leaseTime + leaseUpdateInterval) {
             // no need to renew the lease - it is still within 
'leaseUpdateInterval'
             return false;
@@ -763,9 +768,12 @@ public class ClusterNodeInfo {
         }
 
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Renewing lease for for cluster id " + id + " with 
UpdateOp " + update);
+            LOG.debug("Renewing lease for cluster id " + id + " with UpdateOp 
" + update);
         }
         ClusterNodeInfoDocument doc = 
store.findAndUpdate(Collection.CLUSTER_NODES, update);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Lease renewal for cluster id " + id + " resulted in: " 
+ doc);
+        }
  
         if (doc == null) { // should not occur when leaseCheckDisabled
             // OAK-3398 : someone else either started recovering or is already 
through with that.


Reply via email to