8000 Bug fix/dont fail when restoring cluster dump into single server (#7598) · surajpatel11/arangodb@7b93b1c · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b93b1c

Browse files
authored
Bug fix/dont fail when restoring cluster dump into single server (arangodb#7598)
1 parent 056363a commit 7b93b1c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arangod/Indexes/IndexFactory.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,13 @@ TRI_idx_iid_t IndexFactory::validateSlice(arangodb::velocypack::Slice info,
228228

229229
if (iid == 0 && !isClusterConstructor) {
230230
// Restore is not allowed to generate an id
231-
TRI_ASSERT(generateKey);
232-
iid = arangodb::Index::generateId();
231+
VPackSlice type = info.get(StaticStrings::IndexType);
232+
// dont generate ids for indexes of type "primary"
233+
// id 0 is expected for primary indexes
234+
if (!type.isString() || !type.isEqualString("primary")) {
235+
TRI_ASSERT(generateKey);
236+
iid = arangodb::Index::generateId();
237+
}
233238
}
234239

235240
return iid;

0 commit comments

Comments
 (0)
0