mirror of https://gitee.com/bigwinds/arangodb
ignore primary and edge indexes during cluster restore
This commit is contained in:
parent
3705a1d2f9
commit
233453bb42
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue