1
0
Fork 0

bug fix for jobs looking at distrubuteShardsLike and virtual collections (#4665)

This commit is contained in:
Kaveh Vahedipour 2018-03-05 17:37:07 +01:00 committed by Michael Hackstein
parent 37e2ef461a
commit 3c35cd32dd
2 changed files with 12 additions and 1 deletions

View File

@ -148,6 +148,8 @@ devel
Health did not function for multiple servers at the same time, as
agency transaction was malformed.
* fixed a bug where supervision tried to deal with shards of virtual collections
v3.3.4 (XXXX-XX-XX)
-------------------

View File

@ -294,7 +294,16 @@ std::vector<Job::shard_t> Job::clones(
if (otherCollection != collection &&
col.has("distributeShardsLike") &&
col("distributeShardsLike").slice().copyString() == collection) {
ret.emplace_back(otherCollection, sortedShardList(col("shards"))[steps]);
auto const theirshards = sortedShardList(col("shards"));
if (theirshards.size() > 0) { // do not care about virtual collections
if (theirshards.size() == myshards.size()) {
ret.emplace_back(otherCollection, sortedShardList(col("shards"))[steps]);
} else {
LOG_TOPIC(ERR, Logger::SUPERVISION)
<< "Shard distribution of clone(" << othercollection
<< ") does not match ours (" << collection << ")";
}
}
}
}