1
0
Fork 0

dont fail when restoring a cluster dump into a single server (#7596)

This commit is contained in:
Jan 2018-12-03 16:18:27 +01:00 committed by GitHub
parent bab3c5eeed
commit 574d9c2d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -213,8 +213,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("type");
// 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;