diff --git a/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_legacy_timeseries_no_rawdata.yml b/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_legacy_timeseries_no_rawdata.yml index 94c3060dcbe..198e4549138 100644 --- a/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_legacy_timeseries_no_rawdata.yml +++ b/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_legacy_timeseries_no_rawdata.yml @@ -20,6 +20,7 @@ matrix_suite: true selector: roots: - 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 test_kind: js_test diff --git a/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_viewless_timeseries.yml b/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_viewless_timeseries.yml index 7d32ddd2d54..05a4383e241 100644 --- a/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_viewless_timeseries.yml +++ b/buildscripts/resmokeconfig/matrix_suites/generated_suites/sharding_viewless_timeseries.yml @@ -27,6 +27,7 @@ selector: roots: - jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.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/query/sample_timeseries.js - jstests/sharding/resharding_timeseries/move_timeseries.js diff --git a/buildscripts/resmokeconfig/matrix_suites/overrides/viewless_timeseries.yml b/buildscripts/resmokeconfig/matrix_suites/overrides/viewless_timeseries.yml index 583313436a0..42eac2103c9 100644 --- a/buildscripts/resmokeconfig/matrix_suites/overrides/viewless_timeseries.yml +++ b/buildscripts/resmokeconfig/matrix_suites/overrides/viewless_timeseries.yml @@ -57,6 +57,7 @@ exclude_files: null roots: - 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 - name: only_validated_sharding_timeseries_tests_selector @@ -66,6 +67,7 @@ roots: - jstests/sharding/analyze_shard_key/analyze_shard_key_cmd_validation.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/query/sample_timeseries.js - jstests/sharding/resharding_timeseries/move_timeseries.js diff --git a/jstests/sharding/balancer_should_return_random_migrations_failpoint.js b/jstests/sharding/balancer_should_return_random_migrations_failpoint.js index 11d11815c1d..3b45e9eab68 100644 --- a/jstests/sharding/balancer_should_return_random_migrations_failpoint.js +++ b/jstests/sharding/balancer_should_return_random_migrations_failpoint.js @@ -9,6 +9,7 @@ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.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 TestData.skipCheckShardFilteringMetadata = true; @@ -108,7 +109,8 @@ let initialPlacements = {}; let trackableCollections = ["unsharded", "sharded"]; 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) { diff --git a/src/mongo/db/s/balancer/move_unsharded_policy.cpp b/src/mongo/db/s/balancer/move_unsharded_policy.cpp index eb9ed56dd16..8790fa87e27 100644 --- a/src/mongo/db/s/balancer/move_unsharded_policy.cpp +++ b/src/mongo/db/s/balancer/move_unsharded_policy.cpp @@ -104,8 +104,15 @@ std::map getCollectionsFromShard( for (auto&& replyItemBson : listCollResponse.docs) { auto replyItem = ListCollectionsReplyItem::parse(replyItemBson, IDLParserContext("ListCollectionReply")); - if (replyItem.getType() != "collection") { - // This entry is not a collection (e.g. view) + if (replyItem.getType() == "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; } auto nss = NamespaceStringUtil::deserialize(dbName, replyItem.getName());