Murtadha Hubail has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/707
Change subject: ASTERIXDB-1338: Prevent Metadata Datasets Eviction
......................................................................
ASTERIXDB-1338: Prevent Metadata Datasets Eviction
- Exclude metadata datasets from eviction policy.
- Fix updating used memory when a dataset is closed.
Change-Id: I56734bfe0eb7d166786cacb8d76f12f8d1a21798
---
M
asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
1 file changed, 7 insertions(+), 5 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/07/707/1
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 @@
}
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 @@
}
assert iInfo.referenceCount == 0;
}
- dsInfo.isOpen = false;
removeDatasetFromCache(dsInfo.datasetID);
+ dsInfo.isOpen = false;
}
@Override
--
To view, visit https://asterix-gerrit.ics.uci.edu/707
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I56734bfe0eb7d166786cacb8d76f12f8d1a21798
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Murtadha Hubail <[email protected]>