Luo Chen has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/2153

Change subject: [WIP] Add debug msg for component id error
......................................................................

[WIP] Add debug msg for component id error

Change-Id: Ifc35184c4d431db9af71cab302439e165ee55f54
---
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/AbstractLSMIOOperationCallback.java
3 files changed, 12 insertions(+), 4 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/53/2153/1

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 fe64d3b..8eab12d 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
@@ -362,9 +362,8 @@
                 for (IndexInfo iInfo : dsr.getIndexes().values()) {
                     AbstractLSMIOOperationCallback ioCallback =
                             (AbstractLSMIOOperationCallback) 
iInfo.getIndex().getIOOperationCallback();
-                    if (!(iInfo.getIndex().isCurrentMutableComponentEmpty()
-                            || ioCallback.hasPendingFlush() || 
opTracker.isFlushLogCreated()
-                            || opTracker.isFlushOnExit())) {
+                    if (!(iInfo.getIndex().isCurrentMutableComponentEmpty() || 
ioCallback.hasPendingFlush()
+                            || opTracker.isFlushLogCreated() || 
opTracker.isFlushOnExit())) {
                         long firstLSN = ioCallback.getFirstLSN();
                         if (firstLSN < targetLSN) {
                             if (LOGGER.isLoggable(Level.INFO)) {
@@ -414,6 +413,7 @@
 
         ILSMComponentIdGenerator idGenerator = 
getComponentIdGenerator(dsInfo.getDatasetID());
         idGenerator.refresh();
+        LOGGER.warning("Dataset flush and refresh id generator with new id " + 
idGenerator.getId());
 
         if (asyncFlush) {
             for (IndexInfo iInfo : dsInfo.getIndexes().values()) {
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
index 6f35a3d..b200319 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
@@ -21,6 +21,7 @@
 
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Logger;
 
 import org.apache.asterix.common.exceptions.ACIDException;
 import org.apache.asterix.common.ioopcallbacks.AbstractLSMIOOperationCallback;
@@ -42,7 +43,7 @@
 import org.apache.hyracks.storage.common.ISearchOperationCallback;
 
 public class PrimaryIndexOperationTracker extends BaseOperationTracker {
-
+    private static final Logger LOGGER = 
Logger.getLogger(PrimaryIndexOperationTracker.class.getName());
     // Number of active operations on an ILSMIndex instance.
     private final AtomicInteger numActiveOperations;
     private final ILogManager logManager;
@@ -147,6 +148,8 @@
     //This method is called sequentially by LogPage.notifyFlushTerminator in 
the sequence flushes were scheduled.
     public synchronized void triggerScheduleFlush(LogRecord logRecord) throws 
HyracksDataException {
         idGenerator.refresh();
+        LOGGER.warning("Schedule flush and refresh id generator with new id " 
+ idGenerator.getId());
+
         for (ILSMIndex lsmIndex : dsInfo.getDatasetIndexes()) {
             //get resource
             ILSMIndexAccessor accessor = 
lsmIndex.createAccessor(NoOpIndexAccessParameters.INSTANCE);
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/AbstractLSMIOOperationCallback.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/AbstractLSMIOOperationCallback.java
index e445fe4..fb4bee3 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/AbstractLSMIOOperationCallback.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/AbstractLSMIOOperationCallback.java
@@ -20,6 +20,7 @@
 package org.apache.asterix.common.ioopcallbacks;
 
 import java.util.List;
+import java.util.logging.Logger;
 
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.data.std.primitive.LongPointable;
@@ -39,6 +40,8 @@
 
 // A single LSMIOOperationCallback per LSM index used to perform actions 
around Flush and Merge operations
 public abstract class AbstractLSMIOOperationCallback implements 
ILSMIOOperationCallback {
+    private static final Logger LOGGER = 
Logger.getLogger(AbstractLSMIOOperationCallback.class.getName());
+
     public static final MutableArrayValueReference LSN_KEY = new 
MutableArrayValueReference("LSN".getBytes());
     public static final long INVALID = -1L;
 
@@ -202,11 +205,13 @@
 
     @Override
     public void recycled(ILSMMemoryComponent component) throws 
HyracksDataException {
+        LOGGER.warning("Recycle " + component + " with id " + 
idGenerator.getId());
         component.resetId(idGenerator.getId());
     }
 
     @Override
     public void allocated(ILSMMemoryComponent component) throws 
HyracksDataException {
+        LOGGER.warning("Allocate " + component + " with id " + 
idGenerator.getId());
         component.resetId(idGenerator.getId());
     }
 

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2153
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc35184c4d431db9af71cab302439e165ee55f54
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Luo Chen <[email protected]>

Reply via email to