added debug info
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
index 8aba12a..418e0a6 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
@@ -1506,6 +1506,8 @@
private void abort(Exception rootE, Exception parentE, MetadataTransactionContext mdTxnCtx) {
try {
+ //TODO: remove stacktrace
+ rootE.printStackTrace();
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
} catch (Exception e2) {
parentE.addSuppressed(e2);
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
index ca5e56c..3602974 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
@@ -190,6 +190,8 @@
MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
} catch (Exception e) {
try {
+ //TODO: remove stacktrace
+ e.printStackTrace();
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
} catch (Exception e2) {
e.addSuppressed(e2);
@@ -432,6 +434,8 @@
}
} catch (Exception e) {
try {
+ //TODO: remove stacktrace
+ e.printStackTrace();
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
} catch (Exception e2) {
e.addSuppressed(e2);
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogPage.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogPage.java
index 04200a7..f5c1264 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogPage.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogPage.java
@@ -19,6 +19,7 @@
import java.nio.channels.FileChannel;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.Logger;
import edu.uci.ics.asterix.common.exceptions.ACIDException;
import edu.uci.ics.asterix.common.transactions.ILogPage;
@@ -27,6 +28,9 @@
import edu.uci.ics.asterix.transaction.management.service.locking.LockManager;
public class LogPage implements ILogPage {
+
+ public static final boolean IS_DEBUG_MODE = true;//true
+ private static final Logger LOGGER = Logger.getLogger(LogPage.class.getName());
private final LockManager lockMgr;
private final LogPageReader logPageReader;
private final int logPageSize;
@@ -69,6 +73,9 @@
}
synchronized (this) {
appendOffset += logRecord.getLogSize();
+ if (IS_DEBUG_MODE) {
+ LOGGER.info("append()| appendOffset: " + appendOffset);
+ }
if (logRecord.getLogType() == LogType.JOB_COMMIT) {
logRecord.isFlushed(false);
syncCommitQ.offer(logRecord);
@@ -127,6 +134,10 @@
synchronized (this) {
if (appendOffset - flushOffset == 0 && !full.get()) {
try {
+ if (IS_DEBUG_MODE) {
+ LOGGER.info("flush()| appendOffset: " + appendOffset + ", flushOffset: " + flushOffset
+ + ", full: " + full.get());
+ }
this.wait();
if (stop) {
fileChannel.close();
@@ -160,6 +171,9 @@
flushLSN.set(flushLSN.get() + (endOffset - beginOffset));
flushLSN.notifyAll(); //notify to LogReaders if any
}
+ if (IS_DEBUG_MODE) {
+ LOGGER.info("internalFlush()| flushOffset: " + flushOffset + ", flushLSN: " + flushLSN.get());
+ }
batchUnlock(beginOffset, endOffset);
}
} catch (Exception e) {
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java
index 70ae711..8c4f2ae 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java
@@ -17,6 +17,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
+import java.util.logging.Logger;
import edu.uci.ics.asterix.common.exceptions.ACIDException;
import edu.uci.ics.asterix.common.transactions.ILogReader;
@@ -25,6 +26,8 @@
public class LogReader implements ILogReader {
+ public static final boolean IS_DEBUG_MODE = true;//true
+ private static final Logger LOGGER = Logger.getLogger(LogReader.class.getName());
private final LogManager logMgr;
private final long logFileSize;
private final int logPageSize;
@@ -56,6 +59,9 @@
return;
}
try {
+ if (IS_DEBUG_MODE) {
+ LOGGER.info("initializeScan()| flushLSN: " + flushLSN.get() + ", readLSN: " + readLSN);
+ }
flushLSN.wait();
} catch (InterruptedException e) {
//ignore.
@@ -75,6 +81,9 @@
return null;
}
try {
+ if (IS_DEBUG_MODE) {
+ LOGGER.info("next()| flushLSN: " + flushLSN.get() + ", readLSN: " + readLSN);
+ }
flushLSN.wait();
} catch (InterruptedException e) {
//ignore