You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mh...@apache.org on 2016/03/11 10:22:53 UTC

incubator-asterixdb git commit: ASTERIXDB-1338: Prevent Metadata Datasets Eviction

Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master 1cc3bd950 -> 6f7efb6d1


ASTERIXDB-1338: Prevent Metadata Datasets Eviction

- Exclude metadata datasets from eviction policy.
- Fix updating used memory when a dataset is closed.

Change-Id: I56734bfe0eb7d166786cacb8d76f12f8d1a21798
Reviewed-on: https://asterix-gerrit.ics.uci.edu/707
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <ba...@gmail.com>


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

Branch: refs/heads/master
Commit: 6f7efb6d12efb865ae1d081679d50842f0498bd6
Parents: 1cc3bd9
Author: Murtadha Hubail <mh...@uci.edu>
Authored: Thu Mar 10 20:47:35 2016 -0800
Committer: Murtadha Hubail <hu...@gmail.com>
Committed: Fri Mar 11 01:17:45 2016 -0800

----------------------------------------------------------------------
 .../asterix/common/context/DatasetLifecycleManager.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/6f7efb6d/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
----------------------------------------------------------------------
diff --git a/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java b/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
index 0cd88d6..eb03015 100644
--- a/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
+++ b/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
@@ -214,16 +214,18 @@ public class DatasetLifecycleManager implements IDatasetLifecycleManager, ILifeC
     }
 
     private boolean evictCandidateDataset() throws HyracksDataException {
-        // We will take a dataset that has no active transactions, it is open (a dataset consuming memory),
-        // that is not being used (refcount == 0) and has been least recently used. The sort order defined
-        // for DatasetInfo maintains this. See DatasetInfo.compareTo().
+        /**
+         * We will take a dataset that has no active transactions, it is open (a dataset consuming memory),
+         * that is not being used (refcount == 0) and has been least recently used, excluding metadata datasets.
+         * The sort order defined for DatasetInfo maintains this. See DatasetInfo.compareTo().
+         */
         List<DatasetInfo> datasetInfosList = new ArrayList<DatasetInfo>(datasetInfos.values());
         Collections.sort(datasetInfosList);
         for (DatasetInfo dsInfo : datasetInfosList) {
             PrimaryIndexOperationTracker opTracker = (PrimaryIndexOperationTracker) datasetOpTrackers
                     .get(dsInfo.datasetID);
             if (opTracker != null && opTracker.getNumActiveOperations() == 0 && dsInfo.referenceCount == 0
-                    && dsInfo.isOpen) {
+                    && dsInfo.isOpen && dsInfo.datasetID >= firstAvilableUserDatasetID) {
                 closeDataset(dsInfo);
                 return true;
             }
@@ -607,8 +609,8 @@ public class DatasetLifecycleManager implements IDatasetLifecycleManager, ILifeC
             }
             assert iInfo.referenceCount == 0;
         }
-        dsInfo.isOpen = false;
         removeDatasetFromCache(dsInfo.datasetID);
+        dsInfo.isOpen = false;
     }
 
     @Override