commit | 8ada4f9b3689097b2304125df8f749cd343ed7da | [log] [tgz] |
---|---|---|
author | zheilbron <zheilbron@eaa15691-b419-025a-1212-ee371bd00084> | Tue Jan 22 22:10:35 2013 +0000 |
committer | zheilbron <zheilbron@eaa15691-b419-025a-1212-ee371bd00084> | Tue Jan 22 22:10:35 2013 +0000 |
tree | d9bdd3fac9b84078bd54527d47323435cad7701e | |
parent | ae5323221761f0ef3977252c9931b3afc23c6a1d [diff] |
fixed bug that might cause the LSN range of an LSM component to be improperly updated -- always take the max git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_lsm_stabilization@1072 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/IndexOperationTracker.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/IndexOperationTracker.java index 447c3d2..0fe7c81 100644 --- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/IndexOperationTracker.java +++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/IndexOperationTracker.java
@@ -30,7 +30,7 @@ // Number of active operations on a ILSMIndex instance. private int numActiveOperations = 0; - private long lastLsn; + private long lastLSN; private final ILSMIndex index; private final ILSMIOOperationCallback ioOpCallback; private ILSMIndexAccessor accessor; @@ -103,10 +103,10 @@ } public long getLastLSN() { - return lastLsn; + return lastLSN; } - public void setLastLSN(long lastLsn) { - this.lastLsn = lastLsn; + public void updateLastLSN(long lastLSN) { + this.lastLSN = Math.max(this.lastLSN, lastLSN); } }
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java index 6df3928..ff4c3cd 100644 --- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java +++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManager.java
@@ -578,7 +578,7 @@ } } - txnContext.setLastLSNToIndexes(logicalLogLocator.getLsn()); + txnContext.updateLastLSNForIndexes(logicalLogLocator.getLsn()); } //1) wake up waiters and remove holder
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java index 67e280a..f351f1d 100644 --- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java +++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java
@@ -90,10 +90,10 @@ } } - public void setLastLSNToIndexes(long lastLSN) { + public void updateLastLSNForIndexes(long lastLSN) { synchronized (indexes) { for (ILSMIndex index : indexes) { - ((IndexOperationTracker) index.getOperationTracker()).setLastLSN(lastLSN); + ((IndexOperationTracker) index.getOperationTracker()).updateLastLSN(lastLSN); } } }