提交 9cf51ac6 authored 作者: Thomas Mueller's avatar Thomas Mueller

MVStoreTableEngine

上级 9d374024
...@@ -1060,7 +1060,7 @@ public class TransactionStore { ...@@ -1060,7 +1060,7 @@ public class TransactionStore {
private VersionedValue getValue(K key, long maxLog) { private VersionedValue getValue(K key, long maxLog) {
VersionedValue data = map.get(key); VersionedValue data = map.get(key);
while (true) { for (int i = 0; i < 10; i++) {
long tx; long tx;
if (data == null) { if (data == null) {
// doesn't exist or deleted by a committed transaction // doesn't exist or deleted by a committed transaction
...@@ -1082,11 +1082,20 @@ public class TransactionStore { ...@@ -1082,11 +1082,20 @@ public class TransactionStore {
} }
// get the value before the uncommitted transaction // get the value before the uncommitted transaction
long[] x = new long[] { tx, logId }; long[] x = new long[] { tx, logId };
Object[] d;
synchronized (transaction.store.undoLog) { synchronized (transaction.store.undoLog) {
Object[] d = transaction.store.undoLog.get(x); d = transaction.store.undoLog.get(x);
}
if (d == null) {
// committed or rolled back in the meantime
data = map.get(key);
} else {
data = (VersionedValue) d[3]; data = (VersionedValue) d[3];
} }
} }
throw DataUtils.newIllegalStateException(
DataUtils.ERROR_TRANSACTION_CORRUPT,
"The transaction log might be corrupt for key {0}", key);
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论