diff --git a/arangod/Cluster/ClusterInfo.cpp b/arangod/Cluster/ClusterInfo.cpp index 4a2cee6fad..6e90b9deba 100644 --- a/arangod/Cluster/ClusterInfo.cpp +++ b/arangod/Cluster/ClusterInfo.cpp @@ -1547,7 +1547,6 @@ int ClusterInfo::ensureIndexCoordinator( "Plan/Collections/" + databaseName + "/" + collectionID; AgencyCommResult previous = ac.getValues2(key); - bool usePrevious = true; velocypack::Slice collection = previous.slice()[0].get(std::vector( @@ -1676,11 +1675,7 @@ int ClusterInfo::ensureIndexCoordinator( } AgencyCommResult result; - if (usePrevious) { - result = ac.casValue(key, collection, newBuilder.slice(), 0.0, 0.0); - } else { // only when there is no previous value - result = ac.setValue(key, newBuilder.slice(), 0.0); - } + result = ac.casValue(key, collection, newBuilder.slice(), 0.0, 0.0); if (!result.successful()) { return setErrormsg(TRI_ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN, diff --git a/arangod/Cluster/ClusterInfo.h b/arangod/Cluster/ClusterInfo.h index 48d3d43268..924022f3cc 100644 --- a/arangod/Cluster/ClusterInfo.h +++ b/arangod/Cluster/ClusterInfo.h @@ -329,7 +329,7 @@ class CollectionInfo { for (auto const& serverSlice: VPackArrayIterator(shardSlice.value)) { servers.push_back(serverSlice.copyString()); } - (*res).insert(make_pair(shardSlice.key.copyString(), servers)); + (*res).insert(make_pair(shard, servers)); } } }