提交 85a1797f authored 作者: Andrei Tokar's avatar Andrei Tokar

Fix for issue #1298

上级 0494963b
...@@ -149,16 +149,9 @@ public class TransactionStore { ...@@ -149,16 +149,9 @@ public class TransactionStore {
if (!init) { if (!init) {
for (String mapName : store.getMapNames()) { for (String mapName : store.getMapNames()) {
if (mapName.startsWith(UNDO_LOG_NAME_PREFIX)) { if (mapName.startsWith(UNDO_LOG_NAME_PREFIX)) {
// The following block will be executed only once // Unexpectedly short name may be encountered upon upgrade from older version
// upon upgrade from older version where // where undo log was persisted as a single map, remove it.
// undo log was persisted as a single map if (mapName.length() > UNDO_LOG_NAME_PREFIX.length()) {
if (mapName.equals(UNDO_LOG_NAME_PREFIX)) {
if (!store.hasData(mapName) && !store.isReadOnly()) {
store.removeMap(mapName);
}
continue;
}
boolean committed = mapName.charAt(UNDO_LOG_NAME_PREFIX.length()) == UNDO_LOG_COMMITTED; boolean committed = mapName.charAt(UNDO_LOG_NAME_PREFIX.length()) == UNDO_LOG_COMMITTED;
if (store.hasData(mapName) || committed) { if (store.hasData(mapName) || committed) {
int transactionId = Integer.parseInt(mapName.substring(UNDO_LOG_NAME_PREFIX.length() + 1)); int transactionId = Integer.parseInt(mapName.substring(UNDO_LOG_NAME_PREFIX.length() + 1));
...@@ -185,7 +178,13 @@ public class TransactionStore { ...@@ -185,7 +178,13 @@ public class TransactionStore {
long logId = lastUndoKey == null ? 0 : getLogId(lastUndoKey) + 1; long logId = lastUndoKey == null ? 0 : getLogId(lastUndoKey) + 1;
registerTransaction(transactionId, status, name, logId, timeoutMillis, 0, registerTransaction(transactionId, status, name, logId, timeoutMillis, 0,
RollbackListener.NONE); RollbackListener.NONE);
continue;
}
}
} }
if (!store.hasData(mapName) && !store.isReadOnly()) {
store.removeMap(mapName);
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论