mirror of https://gitee.com/bigwinds/arangodb
Bug fix/dont fail when restoring cluster dump into single server (#7598)
This commit is contained in:
parent
056363a3b3
commit
7b93b1c8f9
|
@ -228,8 +228,13 @@ TRI_idx_iid_t IndexFactory::validateSlice(arangodb::velocypack::Slice info,
|
|||
|
||||
if (iid == 0 && !isClusterConstructor) {
|
||||
// Restore is not allowed to generate an id
|
||||
TRI_ASSERT(generateKey);
|
||||
iid = arangodb::Index::generateId();
|
||||
VPackSlice type = info.get(StaticStrings::IndexType);
|
||||
// dont generate ids for indexes of type "primary"
|
||||
// id 0 is expected for primary indexes
|
||||
if (!type.isString() || !type.isEqualString("primary")) {
|
||||
TRI_ASSERT(generateKey);
|
||||
iid = arangodb::Index::generateId();
|
||||
}
|
||||
}
|
||||
|
||||
return iid;
|
||||
|
|
Loading…
Reference in New Issue