asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: ASTERIXDB-1570 Debugging
Date Mon, 17 Oct 2016 16:03:28 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master afa909a57 -> e17454aed


ASTERIXDB-1570 Debugging

Report how many pins took place on extended pin cycles, in case the
failures are due to unfair queueing

Change-Id: I16a3316d9f6f1d436873c051bd0f260126483ceb
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1282
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/e17454ae
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/e17454ae
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/e17454ae

Branch: refs/heads/master
Commit: e17454aed989ae516fac9d416a88d0b17e453d44
Parents: afa909a
Author: Michael Blow <mblow@apache.org>
Authored: Thu Oct 13 18:32:39 2016 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Mon Oct 17 09:02:34 2016 -0700

----------------------------------------------------------------------
 .../hyracks/storage/common/buffercache/BufferCache.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e17454ae/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
index 28ba981..3be1c46 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
@@ -35,6 +35,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.logging.Level;
@@ -82,6 +83,7 @@ public class BufferCache implements IBufferCacheInternal, ILifeCycleComponent
{
     //!DEBUG
     private IIOReplicationManager ioReplicationManager;
     private final List<ICachedPageInternal> cachedPages = new ArrayList<>();
+    private final AtomicLong masterPinCount = new AtomicLong();
 
     private boolean closed;
 
@@ -1245,6 +1247,7 @@ public class BufferCache implements IBufferCacheInternal, ILifeCycleComponent
{
 
     private ICachedPage getPageLoop(long dpid, int multiplier, boolean confiscate)
             throws HyracksDataException {
+        final long startingPinCount = masterPinCount.get();
         int cycleCount = 0;
         try {
             while (true) {
@@ -1252,6 +1255,7 @@ public class BufferCache implements IBufferCacheInternal, ILifeCycleComponent
{
                 int startCleanedCount = cleanerThread.cleanedCount;
                 ICachedPage page = confiscate ? confiscateInner(dpid, multiplier) : findPageInner(dpid);
                 if (page != null) {
+                    masterPinCount.incrementAndGet();
                     return page;
                 }
                 // no page available to confiscate. try kicking the cleaner thread.
@@ -1286,13 +1290,15 @@ public class BufferCache implements IBufferCacheInternal, ILifeCycleComponent
{
                 if (cycleCount > MAX_PIN_ATTEMPT_CYCLES) {
                     cycleCount = 0; // suppress warning below
                     throw new HyracksDataException("Unable to find free page in buffer cache
after "
-                            + MAX_PIN_ATTEMPT_CYCLES + " cycles (buffer cache undersized?)");
+                            + MAX_PIN_ATTEMPT_CYCLES + " cycles (buffer cache undersized?);
"
+                            + (masterPinCount.get() - startingPinCount) + " successful pins
since start of cycle");
                 }
             }
         } finally {
             if (cycleCount > PIN_ATTEMPT_CYCLES_WARNING_THRESHOLD && LOGGER.isLoggable(Level.WARNING))
{
                 LOGGER.warning("Took " + cycleCount + " cycles to find free page in buffer
cache.  (buffer cache " +
-                        "undersized?)");
+                        "undersized?); " + (masterPinCount.get() - startingPinCount) +
+                        " successful pins since start of cycle");
             }
         }
     }


Mime
View raw message