提交 5c475c6f authored 作者: Thomas Mueller's avatar Thomas Mueller

Avoid concurrency problems of the freedPages map

上级 01224ebf
...@@ -920,13 +920,6 @@ public class MVStore { ...@@ -920,13 +920,6 @@ public class MVStore {
meta.put("chunk." + c.id, c.asString()); meta.put("chunk." + c.id, c.asString());
if (ASSERT) {
if (freedPages.size() > 0) {
throw DataUtils.newIllegalStateException(
DataUtils.ERROR_INTERNAL, "Temporary freed chunks");
}
}
// this will modify maxLengthLive, but // this will modify maxLengthLive, but
// the correct value is written in the chunk header // the correct value is written in the chunk header
buff = meta.getRoot().writeUnsavedRecursive(c, buff); buff = meta.getRoot().writeUnsavedRecursive(c, buff);
...@@ -1581,12 +1574,14 @@ public class MVStore { ...@@ -1581,12 +1574,14 @@ public class MVStore {
for (MVMap<?, ?> m : maps.values()) { for (MVMap<?, ?> m : maps.values()) {
m.rollbackTo(version); m.rollbackTo(version);
} }
synchronized (freedPages) {
for (long v = currentVersion; v >= version; v--) { for (long v = currentVersion; v >= version; v--) {
if (freedPages.size() == 0) { if (freedPages.size() == 0) {
break; break;
} }
freedPages.remove(v); freedPages.remove(v);
} }
}
meta.rollbackTo(version); meta.rollbackTo(version);
metaChanged = false; metaChanged = false;
boolean loadFromFile = false; boolean loadFromFile = false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论