1
0
Fork 0

ignore primary and edge indexes during cluster restore

This commit is contained in:
Jan Steemann 2016-07-12 10:18:12 +02:00
parent 3705a1d2f9
commit 233453bb42
2 changed files with 7 additions and 4 deletions

View File

@ -1947,6 +1947,12 @@ int RestReplicationHandler::processRestoreIndexesCoordinator(
int res = TRI_ERROR_NO_ERROR;
for (VPackSlice const& idxDef : VPackArrayIterator(indexes)) {
VPackSlice type = idxDef.get("type");
if (type.isString() && (type.copyString() == "primary" || type.copyString() == "edge")) {
// must ignore these types of indexes during restore
continue;
}
VPackBuilder tmp;
res = ci->ensureIndexCoordinator(dbName, col->id_as_string(), idxDef, true,
arangodb::Index::Compare, tmp, errorMsg,

View File

@ -1189,12 +1189,9 @@ void TRI_vocbase_col_t::toVelocyPackIndexes(VPackBuilder& builder,
for (auto const& file : files) {
if (StringUtils::isPrefix(file, "index-") &&
StringUtils::isSuffix(file, ".json")) {
// TODO: fix memleak
char* fqn = TRI_Concatenate2File(_path.c_str(), file.c_str());
std::string path = std::string(fqn, strlen(fqn));
std::string path = basics::FileUtils::buildFilename(_path, file);
std::shared_ptr<VPackBuilder> indexVPack =
arangodb::basics::VelocyPackHelper::velocyPackFromFile(path);
TRI_FreeString(TRI_CORE_MEM_ZONE, fqn);
VPackSlice const indexSlice = indexVPack->slice();
VPackSlice const id = indexSlice.get("id");