提交 a6d143e4 authored 作者: Andrei Tokar's avatar Andrei Tokar

add assertion to ensure that possible left-over saved map is not picked up by new index

上级 16caf1d4
......@@ -54,6 +54,7 @@ public class MVPrimaryIndex extends BaseIndex {
ValueDataType keyType = new ValueDataType();
ValueDataType valueType = new ValueDataType(db, sortTypes);
mapName = "table." + getId();
assert db.isStarting() || !db.getStore().getMvStore().getMetaMap().containsKey("name." + mapName);
Transaction t = mvTable.getTransactionBegin();
dataMap = t.openMap(mapName, keyType, valueType);
dataMap.map.setVolatile(!table.isPersistData() || !indexType.isPersistent());
......
......@@ -58,6 +58,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
// even for unique indexes, as some of the index columns could be null
keyColumns = columns.length + 1;
String mapName = "index." + getId();
assert db.isStarting() || !db.getStore().getMvStore().getMetaMap().containsKey("name." + mapName);
int[] sortTypes = new int[keyColumns];
for (int i = 0; i < columns.length; i++) {
sortTypes[i] = columns[i].sortType;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论