Skip to content

Commit

Permalink
[BugFix] Reset schema id when restore
Browse files Browse the repository at this point in the history
Why I'm doing:
currently, restore do not reset schema id. If the id is
conflict with one existed schema which has the same id,
restore process will get wrong schema info from the schema cache
and restore will be failed.

What I'm doing:
Reset schema id when restore

Signed-off-by: srlch <[email protected]>
  • Loading branch information
srlch committed Sep 20, 2024
1 parent 7fd1582 commit cb640b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ public void setIndexIdForRestore(long indexId) {
this.indexId = indexId;
}

public void setSchemaIdForRestore(long schemaId) {
this.schemaId = schemaId;
}

public KeysType getKeysType() {
return keysType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ public Status resetIdsForRestore(GlobalStateMgr globalStateMgr, Database db, int
}
indexIdToMeta.put(newIdxId, indexIdToMeta.remove(entry.getKey()));
indexIdToMeta.get(newIdxId).setIndexIdForRestore(newIdxId);
indexIdToMeta.get(newIdxId).setSchemaIdForRestore(newIdxId);
indexNameToId.put(entry.getValue(), newIdxId);
}

Expand Down

0 comments on commit cb640b2

Please sign in to comment.