mirror of https://gitee.com/bigwinds/arangodb
distributeShardsLike is not ignored when prototype does not exist
This commit is contained in:
parent
278fad9185
commit
e778604cef
|
@ -2284,7 +2284,7 @@ ClusterMethods::persistCollectionInAgency(
|
|||
std::string distributeShardsLike = col->distributeShardsLike();
|
||||
std::vector<std::string> dbServers;
|
||||
std::vector<std::string> avoid = col->avoidServers();
|
||||
|
||||
|
||||
ClusterInfo* ci = ClusterInfo::instance();
|
||||
if (!distributeShardsLike.empty()) {
|
||||
CollectionNameResolver resolver(col->vocbase());
|
||||
|
|
|
@ -258,8 +258,8 @@ class ClusterMethods {
|
|||
static std::unique_ptr<LogicalCollection> createCollectionOnCoordinator(
|
||||
TRI_col_type_e collectionType, TRI_vocbase_t* vocbase,
|
||||
arangodb::velocypack::Slice parameters,
|
||||
bool ignoreDistributeShardsLikeErrors,
|
||||
bool waitForSyncReplication);
|
||||
bool ignoreDistributeShardsLikeErrors = true,
|
||||
bool waitForSyncReplication = true);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -268,7 +268,8 @@ class ClusterMethods {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static std::unique_ptr<LogicalCollection> persistCollectionInAgency(
|
||||
LogicalCollection* col, bool ignoreDistributeShardsLikeErrors, bool waitForSyncReplication);
|
||||
LogicalCollection* col, bool ignoreDistributeShardsLikeErrors = true,
|
||||
bool waitForSyncReplication = true);
|
||||
};
|
||||
|
||||
} // namespace arangodb
|
||||
|
|
|
@ -734,8 +734,9 @@ static void CreateVocBase(v8::FunctionCallbackInfo<v8::Value> const& args,
|
|||
}
|
||||
|
||||
std::unique_ptr<LogicalCollection> col =
|
||||
ClusterMethods::createCollectionOnCoordinator(collectionType, vocbase,
|
||||
infoSlice, true, createWaitsForSyncReplication);
|
||||
ClusterMethods::createCollectionOnCoordinator(
|
||||
collectionType, vocbase, infoSlice, false,
|
||||
createWaitsForSyncReplication);
|
||||
TRI_V8_RETURN(WrapCollection(isolate, col.release()));
|
||||
}
|
||||
|
||||
|
|
|
@ -499,15 +499,7 @@ std::string LogicalCollection::name() const {
|
|||
}
|
||||
|
||||
std::string const LogicalCollection::distributeShardsLike() const {
|
||||
if (!_distributeShardsLike.empty()) {
|
||||
CollectionNameResolver resolver(_vocbase);
|
||||
TRI_voc_cid_t shardLike =
|
||||
resolver.getCollectionIdCluster(_distributeShardsLike);
|
||||
if (shardLike != 0) {
|
||||
return basics::StringUtils::itoa(shardLike);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
return _distributeShardsLike;
|
||||
}
|
||||
|
||||
void LogicalCollection::distributeShardsLike(std::string const& cid) {
|
||||
|
|
Loading…
Reference in New Issue