zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iv...@apache.org
Subject svn commit: r1589695 - in /zookeeper/bookkeeper/branches/branch-4.2: CHANGES.txt bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
Date Thu, 24 Apr 2014 12:44:50 GMT
Author: ivank
Date: Thu Apr 24 12:44:49 2014
New Revision: 1589695

URL: http://svn.apache.org/r1589695
Log:
BOOKKEEPER-743: Periodic ledger check running too often as doc doesn't match implementation.
(ivank)

Modified:
    zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt
    zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
    zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java

Modified: zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt?rev=1589695&r1=1589694&r2=1589695&view=diff
==============================================================================
--- zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt (original)
+++ zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt Thu Apr 24 12:44:49 2014
@@ -22,6 +22,8 @@ Release 4.2.3 - 2013-12-04
 
         BOOKKEEPER-742: Fix for empty ledgers losing quorum. (ivank)
 
+        BOOKKEEPER-743: Periodic ledger check running too often as doc doesn't match implementation.
(ivank)
+
 Release 4.2.2 - 2013-10-02
 
   Backward compatible changes:

Modified: zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java?rev=1589695&r1=1589694&r2=1589695&view=diff
==============================================================================
--- zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
(original)
+++ zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
Thu Apr 24 12:44:49 2014
@@ -232,7 +232,7 @@ public class Auditor implements BookiesL
                                           +"running periodic check", ue);
                             }
                         }
-                    }, interval, interval, TimeUnit.MILLISECONDS);
+                    }, interval, interval, TimeUnit.SECONDS);
             } else {
                 LOG.info("Periodic checking disabled");
             }

Modified: zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java?rev=1589695&r1=1589694&r2=1589695&view=diff
==============================================================================
--- zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
(original)
+++ zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorPeriodicCheckTest.java
Thu Apr 24 12:44:49 2014
@@ -66,7 +66,7 @@ public class AuditorPeriodicCheckTest ex
     private HashMap<String, AuditorElector> auditorElectors = new HashMap<String,
AuditorElector>();
     private List<ZooKeeper> zkClients = new LinkedList<ZooKeeper>();
 
-    private final static int CHECK_INTERVAL = 1000; // run every second
+    private final static int CHECK_INTERVAL = 1; // run every second
 
     public AuditorPeriodicCheckTest() {
         super(3);
@@ -153,7 +153,7 @@ public class AuditorPeriodicCheckTest ex
             if (underReplicatedLedger != -1) {
                 break;
             }
-            Thread.sleep(CHECK_INTERVAL);
+            Thread.sleep(CHECK_INTERVAL * 1000);
         }
         assertEquals("Ledger should be under replicated", ledgerId, underReplicatedLedger);
         underReplicationManager.close();
@@ -201,7 +201,7 @@ public class AuditorPeriodicCheckTest ex
             if (underReplicatedLedger != -1) {
                 break;
             }
-            Thread.sleep(CHECK_INTERVAL);
+            Thread.sleep(CHECK_INTERVAL * 1000);
         }
         assertEquals("Ledger should be under replicated", ledgerToCorrupt, underReplicatedLedger);
         underReplicationManager.close();
@@ -241,14 +241,14 @@ public class AuditorPeriodicCheckTest ex
         bsConfs.add(conf);
         bs.add(startBookie(conf, deadBookie));
 
-        Thread.sleep(CHECK_INTERVAL * 2);
+        Thread.sleep(CHECK_INTERVAL * 2000);
         assertEquals("Nothing should have tried to read", 0, numReads.get());
         underReplicationManager.enableLedgerReplication();
-        Thread.sleep(CHECK_INTERVAL * 2); // give it time to run
+        Thread.sleep(CHECK_INTERVAL * 2000); // give it time to run
 
         underReplicationManager.disableLedgerReplication();
         // give it time to stop, from this point nothing new should be marked
-        Thread.sleep(CHECK_INTERVAL * 2);
+        Thread.sleep(CHECK_INTERVAL * 2000);
 
         int numUnderreplicated = 0;
         long underReplicatedLedger = -1;
@@ -262,7 +262,7 @@ public class AuditorPeriodicCheckTest ex
             underReplicationManager.markLedgerReplicated(underReplicatedLedger);
         } while (underReplicatedLedger != -1);
 
-        Thread.sleep(CHECK_INTERVAL * 2); // give a chance to run again (it shouldn't, it's
disabled)
+        Thread.sleep(CHECK_INTERVAL * 2000); // give a chance to run again (it shouldn't,
it's disabled)
 
         // ensure that nothing is marked as underreplicated
         underReplicatedLedger = underReplicationManager.pollLedgerToRereplicate();



Mime
View raw message