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

Fix for issue #1298

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