asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject asterixdb git commit: [NO ISSUE][OTH] Log flush requests coming from checkpoint thread
Date Mon, 30 Oct 2017 16:37:15 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 0aae183c2 -> 9523e0ab8


[NO ISSUE][OTH] Log flush requests coming from checkpoint thread

- user model changes: no
- storage format changes: no
- interface changes: no

Change-Id: I18dde75dfc6ce8483e6494158990fcb88b3e048a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2110
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Xikui Wang <xkkwww@gmail.com>


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

Branch: refs/heads/master
Commit: 9523e0ab84cdb332ddff1e72194ce3b17d152e0c
Parents: 0aae183
Author: Abdullah Alamoudi <bamousaa@gmail.com>
Authored: Sun Oct 29 15:26:32 2017 -0700
Committer: abdullah alamoudi <bamousaa@gmail.com>
Committed: Mon Oct 30 09:36:48 2017 -0700

----------------------------------------------------------------------
 .../common/context/DatasetLifecycleManager.java    | 17 +++++++++++------
 .../service/recovery/CheckpointThread.java         |  2 +-
 2 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/9523e0ab/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
index cdb7bb3..545382a 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
@@ -25,6 +25,8 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.apache.asterix.common.api.IDatasetLifecycleManager;
 import org.apache.asterix.common.config.StorageProperties;
@@ -49,6 +51,7 @@ import org.apache.hyracks.storage.common.ILocalResourceRepository;
 import org.apache.hyracks.storage.common.LocalResource;
 
 public class DatasetLifecycleManager implements IDatasetLifecycleManager, ILifeCycleComponent
{
+    private static final Logger LOGGER = Logger.getLogger(DatasetLifecycleManager.class.getName());
     private final Map<Integer, DatasetResource> datasets = new ConcurrentHashMap<>();
     private final StorageProperties storageProperties;
     private final ILocalResourceRepository resourceRepository;
@@ -133,10 +136,9 @@ public class DatasetLifecycleManager implements IDatasetLifecycleManager,
ILifeC
 
         PrimaryIndexOperationTracker opTracker = dsr.getOpTracker();
         if (iInfo.getReferenceCount() != 0 || (opTracker != null && opTracker.getNumActiveOperations()
!= 0)) {
-            throw new HyracksDataException(
-                    "Cannot remove index while it is open. (Dataset reference count = " +
iInfo.getReferenceCount()
-                            + ", Operation tracker number of active operations = " + opTracker.getNumActiveOperations()
-                            + ")");
+            throw new HyracksDataException("Cannot remove index while it is open. (Dataset
reference count = "
+                    + iInfo.getReferenceCount() + ", Operation tracker number of active operations
= "
+                    + opTracker.getNumActiveOperations() + ")");
         }
 
         // TODO: use fine-grained counters, one for each index instead of a single counter
per dataset.
@@ -149,8 +151,8 @@ public class DatasetLifecycleManager implements IDatasetLifecycleManager,
ILifeC
             }
         }
         dsInfo.getIndexes().remove(resourceID);
-        if (dsInfo.getReferenceCount() == 0 && dsInfo.isOpen() && dsInfo.getIndexes().isEmpty()
&& !dsInfo
-                .isExternal()) {
+        if (dsInfo.getReferenceCount() == 0 && dsInfo.isOpen() && dsInfo.getIndexes().isEmpty()
+                && !dsInfo.isExternal()) {
             removeDatasetFromCache(dsInfo.getDatasetID());
         }
     }
@@ -353,6 +355,9 @@ public class DatasetLifecycleManager implements IDatasetLifecycleManager,
ILifeC
                             || opTracker.isFlushOnExit())) {
                         long firstLSN = ioCallback.getFirstLSN();
                         if (firstLSN < targetLSN) {
+                            if (LOGGER.isLoggable(Level.INFO)) {
+                                LOGGER.info("Checkpoint flush dataset " + dsr.getDatasetID());
+                            }
                             opTracker.setFlushOnExit(true);
                             if (opTracker.getNumActiveOperations() == 0) {
                                 // No Modify operations currently, we need to trigger the
flush and we can do so safely

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/9523e0ab/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/recovery/CheckpointThread.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/recovery/CheckpointThread.java
b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/recovery/CheckpointThread.java
index 39c7c98..5de76d3 100644
--- a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/recovery/CheckpointThread.java
+++ b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/recovery/CheckpointThread.java
@@ -51,7 +51,7 @@ public class CheckpointThread extends Thread {
 
     @Override
     public void run() {
-        Thread.currentThread().setName("Checkpoint Thread");
+        Thread.currentThread().setName("Checkpoint Thread (" + Thread.currentThread().getId()
+ ")");
         long currentCheckpointAttemptMinLSN;
         long lastCheckpointLSN = -1;
         long currentLogLSN;


Mime
View raw message