mirror of https://github.com/mongodb/mongo
SERVER-111321 Make random balancer policy move viewless timeseries collections (#41693)
GitOrigin-RevId: 91afadbc463a55c2c88d85939167a7fc68b0504d
This commit is contained in:
parent
b4ceac3b6b
commit
e99215b0fe
|
|
@ -20,6 +20,7 @@ matrix_suite: true
|
||||||
selector:
|
selector:
|
||||||
roots:
|
roots:
|
||||||
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
||||||
|
- jstests/sharding/balancer_should_return_random_migrations_failpoint.js
|
||||||
- jstests/sharding/*timeseries*/*.js
|
- jstests/sharding/*timeseries*/*.js
|
||||||
- jstests/sharding/**/*timeseries*.js
|
- jstests/sharding/**/*timeseries*.js
|
||||||
test_kind: js_test
|
test_kind: js_test
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ selector:
|
||||||
roots:
|
roots:
|
||||||
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
||||||
- jstests/sharding/analyze_shard_key/timeseries.js
|
- jstests/sharding/analyze_shard_key/timeseries.js
|
||||||
|
- jstests/sharding/balancer_should_return_random_migrations_failpoint.js
|
||||||
- jstests/sharding/libs/timeseries_update_multi_util.js
|
- jstests/sharding/libs/timeseries_update_multi_util.js
|
||||||
- jstests/sharding/query/sample_timeseries.js
|
- jstests/sharding/query/sample_timeseries.js
|
||||||
- jstests/sharding/resharding_timeseries/move_timeseries.js
|
- jstests/sharding/resharding_timeseries/move_timeseries.js
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@
|
||||||
exclude_files: null
|
exclude_files: null
|
||||||
roots:
|
roots:
|
||||||
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
||||||
|
- jstests/sharding/balancer_should_return_random_migrations_failpoint.js
|
||||||
- jstests/sharding/*timeseries*/*.js
|
- jstests/sharding/*timeseries*/*.js
|
||||||
- jstests/sharding/**/*timeseries*.js
|
- jstests/sharding/**/*timeseries*.js
|
||||||
- name: only_validated_sharding_timeseries_tests_selector
|
- name: only_validated_sharding_timeseries_tests_selector
|
||||||
|
|
@ -66,6 +67,7 @@
|
||||||
roots:
|
roots:
|
||||||
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
- jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.js
|
||||||
- jstests/sharding/analyze_shard_key/timeseries.js
|
- jstests/sharding/analyze_shard_key/timeseries.js
|
||||||
|
- jstests/sharding/balancer_should_return_random_migrations_failpoint.js
|
||||||
- jstests/sharding/libs/timeseries_update_multi_util.js
|
- jstests/sharding/libs/timeseries_update_multi_util.js
|
||||||
- jstests/sharding/query/sample_timeseries.js
|
- jstests/sharding/query/sample_timeseries.js
|
||||||
- jstests/sharding/resharding_timeseries/move_timeseries.js
|
- jstests/sharding/resharding_timeseries/move_timeseries.js
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js";
|
import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js";
|
||||||
import {ShardingTest} from "jstests/libs/shardingtest.js";
|
import {ShardingTest} from "jstests/libs/shardingtest.js";
|
||||||
import {findChunksUtil} from "jstests/sharding/libs/find_chunks_util.js";
|
import {findChunksUtil} from "jstests/sharding/libs/find_chunks_util.js";
|
||||||
|
import {getTimeseriesCollForDDLOps} from "jstests/core/timeseries/libs/viewless_timeseries_util.js";
|
||||||
|
|
||||||
// TODO SERVER-89399: re-enable the hook once it properly serialize with resharding operations
|
// TODO SERVER-89399: re-enable the hook once it properly serialize with resharding operations
|
||||||
TestData.skipCheckShardFilteringMetadata = true;
|
TestData.skipCheckShardFilteringMetadata = true;
|
||||||
|
|
@ -108,7 +109,8 @@ let initialPlacements = {};
|
||||||
let trackableCollections = ["unsharded", "sharded"];
|
let trackableCollections = ["unsharded", "sharded"];
|
||||||
|
|
||||||
if (isReshardingForTimeseriesEnabled) {
|
if (isReshardingForTimeseriesEnabled) {
|
||||||
trackableCollections.push("system.buckets.timeseries");
|
let db = st.s.getDB(dbNames[0]);
|
||||||
|
trackableCollections.push(getTimeseriesCollForDDLOps(db, db["timeseries"]).getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const dbName of dbNames) {
|
for (const dbName of dbNames) {
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,15 @@ std::map<NamespaceString, ListCollectionsReplyItem> getCollectionsFromShard(
|
||||||
for (auto&& replyItemBson : listCollResponse.docs) {
|
for (auto&& replyItemBson : listCollResponse.docs) {
|
||||||
auto replyItem =
|
auto replyItem =
|
||||||
ListCollectionsReplyItem::parse(replyItemBson, IDLParserContext("ListCollectionReply"));
|
ListCollectionsReplyItem::parse(replyItemBson, IDLParserContext("ListCollectionReply"));
|
||||||
if (replyItem.getType() != "collection") {
|
if (replyItem.getType() == "view") {
|
||||||
// This entry is not a collection (e.g. view)
|
// Do not try to move views
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// TODO SERVER-111320: remove the following condition after 9.0 becomes last LTS.
|
||||||
|
// Only viewless timeseries will exists by then.
|
||||||
|
if (replyItem.getType() == "timeseries" &&
|
||||||
|
!(replyItem.getInfo() && replyItem.getInfo()->getUuid())) {
|
||||||
|
// Do not try to move legacy timeseries view
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto nss = NamespaceStringUtil::deserialize(dbName, replyItem.getName());
|
auto nss = NamespaceStringUtil::deserialize(dbName, replyItem.getName());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue