mirror of https://github.com/mongodb/mongo
Co-authored-by: auto-revert-processor <devprod-si-team@mongodb.com> GitOrigin-RevId: bc20b36c7eb19edb7556791b3000462cced15aa0
This commit is contained in:
parent
b5e3d1c2f6
commit
2dec5f5579
|
|
@ -578,6 +578,7 @@ data_movement:
|
||||||
- src/mongo/s/commands/*move_chunk*
|
- src/mongo/s/commands/*move_chunk*
|
||||||
- src/mongo/s/request_types/auto_split_vector.idl
|
- src/mongo/s/request_types/auto_split_vector.idl
|
||||||
- src/mongo/s/request_types/migration_secondary_throttle*
|
- src/mongo/s/request_types/migration_secondary_throttle*
|
||||||
|
- src/mongo/s/request_types/repair_sharded_collection_chunks_history.idl
|
||||||
- src/mongo/s/request_types/cleanup_orphaned.idl
|
- src/mongo/s/request_types/cleanup_orphaned.idl
|
||||||
- src/mongo/s/migration_blocking_operation/migration_blocking_operation*
|
- src/mongo/s/migration_blocking_operation/migration_blocking_operation*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -421,15 +421,6 @@ idl_generator(
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
idl_generator(
|
|
||||||
name = "repair_sharded_collection_chunks_history_gen",
|
|
||||||
src = "repair_sharded_collection_chunks_history.idl",
|
|
||||||
deps = [
|
|
||||||
"//src/mongo/db:basic_types_gen",
|
|
||||||
"//src/mongo/idl:generic_argument_gen",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
idl_generator(
|
idl_generator(
|
||||||
name = "list_shards_gen",
|
name = "list_shards_gen",
|
||||||
src = "list_shards.idl",
|
src = "list_shards.idl",
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,13 @@
|
||||||
#include "mongo/db/auth/resource_pattern.h"
|
#include "mongo/db/auth/resource_pattern.h"
|
||||||
#include "mongo/db/commands.h"
|
#include "mongo/db/commands.h"
|
||||||
#include "mongo/db/database_name.h"
|
#include "mongo/db/database_name.h"
|
||||||
#include "mongo/db/global_catalog/ddl/repair_sharded_collection_chunks_history_gen.h"
|
|
||||||
#include "mongo/db/namespace_string.h"
|
#include "mongo/db/namespace_string.h"
|
||||||
#include "mongo/db/operation_context.h"
|
#include "mongo/db/operation_context.h"
|
||||||
#include "mongo/db/service_context.h"
|
#include "mongo/db/service_context.h"
|
||||||
#include "mongo/db/sharding_environment/client/shard.h"
|
#include "mongo/db/sharding_environment/client/shard.h"
|
||||||
#include "mongo/db/sharding_environment/grid.h"
|
#include "mongo/db/sharding_environment/grid.h"
|
||||||
#include "mongo/db/topology/shard_registry.h"
|
#include "mongo/db/topology/shard_registry.h"
|
||||||
|
#include "mongo/s/request_types/repair_sharded_collection_chunks_history_gen.h"
|
||||||
#include "mongo/util/assert_util.h"
|
#include "mongo/util/assert_util.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@
|
||||||
#include "mongo/db/database_name.h"
|
#include "mongo/db/database_name.h"
|
||||||
#include "mongo/db/global_catalog/catalog_cache/catalog_cache.h"
|
#include "mongo/db/global_catalog/catalog_cache/catalog_cache.h"
|
||||||
#include "mongo/db/global_catalog/catalog_cache/routing_information_cache.h"
|
#include "mongo/db/global_catalog/catalog_cache/routing_information_cache.h"
|
||||||
#include "mongo/db/global_catalog/ddl/repair_sharded_collection_chunks_history_gen.h"
|
|
||||||
#include "mongo/db/global_catalog/ddl/sharding_catalog_manager.h"
|
#include "mongo/db/global_catalog/ddl/sharding_catalog_manager.h"
|
||||||
#include "mongo/db/logical_time.h"
|
#include "mongo/db/logical_time.h"
|
||||||
#include "mongo/db/namespace_string.h"
|
#include "mongo/db/namespace_string.h"
|
||||||
|
|
@ -52,6 +51,7 @@
|
||||||
#include "mongo/db/service_context.h"
|
#include "mongo/db/service_context.h"
|
||||||
#include "mongo/db/topology/cluster_role.h"
|
#include "mongo/db/topology/cluster_role.h"
|
||||||
#include "mongo/db/vector_clock/vector_clock.h"
|
#include "mongo/db/vector_clock/vector_clock.h"
|
||||||
|
#include "mongo/s/request_types/repair_sharded_collection_chunks_history_gen.h"
|
||||||
#include "mongo/util/assert_util.h"
|
#include "mongo/util/assert_util.h"
|
||||||
#include "mongo/util/namespace_string_util.h"
|
#include "mongo/util/namespace_string_util.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,3 @@ commands:
|
||||||
api_version: ""
|
api_version: ""
|
||||||
type: namespacestring
|
type: namespacestring
|
||||||
strict: false
|
strict: false
|
||||||
mod_visibility: public
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
#include "mongo/db/namespace_string.h"
|
#include "mongo/db/namespace_string.h"
|
||||||
#include "mongo/db/operation_context.h"
|
#include "mongo/db/operation_context.h"
|
||||||
#include "mongo/util/assert_util.h"
|
#include "mongo/util/assert_util.h"
|
||||||
#include "mongo/util/modules.h"
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
#include "mongo/stdx/mutex.h"
|
#include "mongo/stdx/mutex.h"
|
||||||
#include "mongo/stdx/unordered_map.h"
|
#include "mongo/stdx/unordered_map.h"
|
||||||
#include "mongo/util/concurrency/thread_pool.h"
|
#include "mongo/util/concurrency/thread_pool.h"
|
||||||
#include "mongo/util/modules.h"
|
|
||||||
#include "mongo/util/uuid.h"
|
#include "mongo/util/uuid.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -54,8 +53,7 @@ namespace mongo {
|
||||||
* and terminated on stepDown.
|
* and terminated on stepDown.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class MONGO_MOD_NEEDS_REPLACEMENT BalancerStatsRegistry
|
class BalancerStatsRegistry : public ReplicaSetAwareServiceShardSvr<BalancerStatsRegistry> {
|
||||||
: public ReplicaSetAwareServiceShardSvr<BalancerStatsRegistry> {
|
|
||||||
|
|
||||||
BalancerStatsRegistry(const BalancerStatsRegistry&) = delete;
|
BalancerStatsRegistry(const BalancerStatsRegistry&) = delete;
|
||||||
BalancerStatsRegistry& operator=(const BalancerStatsRegistry&) = delete;
|
BalancerStatsRegistry& operator=(const BalancerStatsRegistry&) = delete;
|
||||||
|
|
@ -75,11 +73,11 @@ public:
|
||||||
*
|
*
|
||||||
* If the registy is not initialized this function will be a noop.
|
* If the registy is not initialized this function will be a noop.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE void updateOrphansCount(const UUID& collectionUUID, long long delta);
|
void updateOrphansCount(const UUID& collectionUUID, long long delta);
|
||||||
void onRangeDeletionTaskInsertion(const UUID& collectionUUID, long long numOrphanDocs);
|
void onRangeDeletionTaskInsertion(const UUID& collectionUUID, long long numOrphanDocs);
|
||||||
void onRangeDeletionTaskDeletion(const UUID& collectionUUID, long long numOrphanDocs);
|
void onRangeDeletionTaskDeletion(const UUID& collectionUUID, long long numOrphanDocs);
|
||||||
|
|
||||||
MONGO_MOD_PRIVATE long long getCollNumOrphanDocs(const UUID& collectionUUID) const;
|
long long getCollNumOrphanDocs(const UUID& collectionUUID) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the numOrphanDocs from the balancer stats registry if initialized or runs an
|
* Retrieves the numOrphanDocs from the balancer stats registry if initialized or runs an
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@
|
||||||
#include "mongo/db/sharding_environment/shard_id.h"
|
#include "mongo/db/sharding_environment/shard_id.h"
|
||||||
#include "mongo/db/versioning_protocol/chunk_version.h"
|
#include "mongo/db/versioning_protocol/chunk_version.h"
|
||||||
#include "mongo/s/resharding/common_types_gen.h"
|
#include "mongo/s/resharding/common_types_gen.h"
|
||||||
#include "mongo/util/modules.h"
|
|
||||||
#include "mongo/util/string_map.h"
|
#include "mongo/util/string_map.h"
|
||||||
#include "mongo/util/uuid.h"
|
#include "mongo/util/uuid.h"
|
||||||
|
|
||||||
|
|
@ -66,7 +65,7 @@ struct SplitPolicyParams {
|
||||||
ShardId primaryShardId;
|
ShardId primaryShardId;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MONGO_MOD_PUBLIC InitialSplitPolicy {
|
class InitialSplitPolicy {
|
||||||
public:
|
public:
|
||||||
virtual ~InitialSplitPolicy() {}
|
virtual ~InitialSplitPolicy() {}
|
||||||
|
|
||||||
|
|
@ -124,7 +123,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Default optimization strategy where we create a single chunk on the primary shard.
|
* Default optimization strategy where we create a single chunk on the primary shard.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC SingleChunkOnPrimarySplitPolicy : public InitialSplitPolicy {
|
class SingleChunkOnPrimarySplitPolicy : public InitialSplitPolicy {
|
||||||
public:
|
public:
|
||||||
ShardCollectionConfig createFirstChunks(OperationContext* opCtx,
|
ShardCollectionConfig createFirstChunks(OperationContext* opCtx,
|
||||||
const ShardKeyPattern& shardKeyPattern,
|
const ShardKeyPattern& shardKeyPattern,
|
||||||
|
|
@ -134,7 +133,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Create a single chunk on a specified shard.
|
* Create a single chunk on a specified shard.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC SingleChunkOnShardSplitPolicy : public InitialSplitPolicy {
|
class SingleChunkOnShardSplitPolicy : public InitialSplitPolicy {
|
||||||
public:
|
public:
|
||||||
SingleChunkOnShardSplitPolicy(OperationContext* opCtx, ShardId dataShard);
|
SingleChunkOnShardSplitPolicy(OperationContext* opCtx, ShardId dataShard);
|
||||||
|
|
||||||
|
|
@ -150,7 +149,7 @@ private:
|
||||||
* Split point building strategy to be used when the appropriate splitpoints can be trivially
|
* Split point building strategy to be used when the appropriate splitpoints can be trivially
|
||||||
* deduced from the shard key.
|
* deduced from the shard key.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC SplitPointsBasedSplitPolicy : public InitialSplitPolicy {
|
class SplitPointsBasedSplitPolicy : public InitialSplitPolicy {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor used when generating split points for a hashed-prefix shard key.
|
* Constructor used when generating split points for a hashed-prefix shard key.
|
||||||
|
|
@ -217,7 +216,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* In this strategy we directly generate a single chunk for each tag range.
|
* In this strategy we directly generate a single chunk for each tag range.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC SingleChunkPerTagSplitPolicy : public AbstractTagsBasedSplitPolicy {
|
class SingleChunkPerTagSplitPolicy : public AbstractTagsBasedSplitPolicy {
|
||||||
public:
|
public:
|
||||||
SingleChunkPerTagSplitPolicy(
|
SingleChunkPerTagSplitPolicy(
|
||||||
OperationContext* opCtx,
|
OperationContext* opCtx,
|
||||||
|
|
@ -237,7 +236,7 @@ private:
|
||||||
* case, we generate one chunk per tag range and then further split each of these using the hashed
|
* case, we generate one chunk per tag range and then further split each of these using the hashed
|
||||||
* field of the shard key.
|
* field of the shard key.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC PresplitHashedZonesSplitPolicy : public AbstractTagsBasedSplitPolicy {
|
class PresplitHashedZonesSplitPolicy : public AbstractTagsBasedSplitPolicy {
|
||||||
public:
|
public:
|
||||||
PresplitHashedZonesSplitPolicy(
|
PresplitHashedZonesSplitPolicy(
|
||||||
OperationContext* opCtx,
|
OperationContext* opCtx,
|
||||||
|
|
@ -259,7 +258,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* Split point building strategy for resharding.
|
* Split point building strategy for resharding.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC SamplingBasedSplitPolicy : public InitialSplitPolicy {
|
class SamplingBasedSplitPolicy : public InitialSplitPolicy {
|
||||||
public:
|
public:
|
||||||
using SampleDocumentPipeline = std::unique_ptr<Pipeline>;
|
using SampleDocumentPipeline = std::unique_ptr<Pipeline>;
|
||||||
|
|
||||||
|
|
@ -320,14 +319,13 @@ public:
|
||||||
|
|
||||||
static constexpr int kDefaultSamplesPerChunk = 10;
|
static constexpr int kDefaultSamplesPerChunk = 10;
|
||||||
|
|
||||||
// TODO This should ideally be file_private.
|
static std::unique_ptr<SampleDocumentSource> makePipelineDocumentSource_forTest(
|
||||||
MONGO_MOD_NEEDS_REPLACEMENT static std::unique_ptr<SampleDocumentSource>
|
OperationContext* opCtx,
|
||||||
makePipelineDocumentSource_forTest(OperationContext* opCtx,
|
boost::intrusive_ptr<DocumentSource> initialSource,
|
||||||
boost::intrusive_ptr<DocumentSource> initialSource,
|
const NamespaceString& ns,
|
||||||
const NamespaceString& ns,
|
const ShardKeyPattern& shardKey,
|
||||||
const ShardKeyPattern& shardKey,
|
int numInitialChunks,
|
||||||
int numInitialChunks,
|
int samplesPerChunk);
|
||||||
int samplesPerChunk);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::unique_ptr<SampleDocumentSource> _makePipelineDocumentSource(
|
static std::unique_ptr<SampleDocumentSource> _makePipelineDocumentSource(
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
#include "mongo/bson/bsonobj.h"
|
#include "mongo/bson/bsonobj.h"
|
||||||
#include "mongo/db/local_catalog/shard_role_api/shard_role.h"
|
#include "mongo/db/local_catalog/shard_role_api/shard_role.h"
|
||||||
#include "mongo/util/modules.h"
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -383,7 +383,6 @@ mongo_cc_library(
|
||||||
"//src/mongo/db/global_catalog/ddl:move_primary_gen",
|
"//src/mongo/db/global_catalog/ddl:move_primary_gen",
|
||||||
"//src/mongo/db/global_catalog/ddl:placement_history_commands_gen",
|
"//src/mongo/db/global_catalog/ddl:placement_history_commands_gen",
|
||||||
"//src/mongo/db/global_catalog/ddl:remove_shard_from_zone_request_type.cpp",
|
"//src/mongo/db/global_catalog/ddl:remove_shard_from_zone_request_type.cpp",
|
||||||
"//src/mongo/db/global_catalog/ddl:repair_sharded_collection_chunks_history_gen",
|
|
||||||
"//src/mongo/db/global_catalog/ddl:set_allow_migrations_gen",
|
"//src/mongo/db/global_catalog/ddl:set_allow_migrations_gen",
|
||||||
"//src/mongo/db/global_catalog/ddl:sharded_ddl_commands_gen",
|
"//src/mongo/db/global_catalog/ddl:sharded_ddl_commands_gen",
|
||||||
"//src/mongo/db/global_catalog/ddl:shardsvr_join_ddl_coordinators_request_gen",
|
"//src/mongo/db/global_catalog/ddl:shardsvr_join_ddl_coordinators_request_gen",
|
||||||
|
|
@ -414,6 +413,7 @@ mongo_cc_library(
|
||||||
"//src/mongo/s/request_types:get_stats_for_balancing_gen",
|
"//src/mongo/s/request_types:get_stats_for_balancing_gen",
|
||||||
"//src/mongo/s/request_types:migration_secondary_throttle_options.cpp",
|
"//src/mongo/s/request_types:migration_secondary_throttle_options.cpp",
|
||||||
"//src/mongo/s/request_types:move_range_request_gen",
|
"//src/mongo/s/request_types:move_range_request_gen",
|
||||||
|
"//src/mongo/s/request_types:repair_sharded_collection_chunks_history_gen",
|
||||||
"//src/mongo/s/request_types:reshard_collection_gen",
|
"//src/mongo/s/request_types:reshard_collection_gen",
|
||||||
"//src/mongo/s/request_types:resharding_operation_time_gen",
|
"//src/mongo/s/request_types:resharding_operation_time_gen",
|
||||||
"//src/mongo/s/request_types:transition_from_dedicated_config_server_gen",
|
"//src/mongo/s/request_types:transition_from_dedicated_config_server_gen",
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
#include "mongo/s/balancer_configuration_gen.h"
|
#include "mongo/s/balancer_configuration_gen.h"
|
||||||
#include "mongo/s/request_types/migration_secondary_throttle_options.h"
|
#include "mongo/s/request_types/migration_secondary_throttle_options.h"
|
||||||
#include "mongo/stdx/mutex.h"
|
#include "mongo/stdx/mutex.h"
|
||||||
#include "mongo/util/modules.h"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
|
@ -75,7 +74,7 @@ class StatusWith;
|
||||||
* TODO SERVER-107399 Remove this class once done, as users should no longer directly update this
|
* TODO SERVER-107399 Remove this class once done, as users should no longer directly update this
|
||||||
* document.
|
* document.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC BalancerSettingsType {
|
class BalancerSettingsType {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Part of schema to enforce on config.settings document relating to documents with _id:
|
* Part of schema to enforce on config.settings document relating to documents with _id:
|
||||||
|
|
@ -105,7 +104,7 @@ private:
|
||||||
*
|
*
|
||||||
* chunksize: { value: <value in MB between 1 and 1024> }
|
* chunksize: { value: <value in MB between 1 and 1024> }
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC ChunkSizeSettingsType {
|
class ChunkSizeSettingsType {
|
||||||
public:
|
public:
|
||||||
// The key under which this setting is stored on the config server
|
// The key under which this setting is stored on the config server
|
||||||
static const char kKey[];
|
static const char kKey[];
|
||||||
|
|
@ -160,7 +159,7 @@ private:
|
||||||
*
|
*
|
||||||
* automerge: { enabled: <true|false> }
|
* automerge: { enabled: <true|false> }
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC AutoMergeSettingsType {
|
class AutoMergeSettingsType {
|
||||||
public:
|
public:
|
||||||
// The key under which this setting is stored on the config server
|
// The key under which this setting is stored on the config server
|
||||||
static const char kKey[];
|
static const char kKey[];
|
||||||
|
|
@ -191,7 +190,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* Contains settings, which control the behaviour of the balancer.
|
* Contains settings, which control the behaviour of the balancer.
|
||||||
*/
|
*/
|
||||||
class MONGO_MOD_PUBLIC BalancerConfiguration {
|
class BalancerConfiguration {
|
||||||
BalancerConfiguration(const BalancerConfiguration&) = delete;
|
BalancerConfiguration(const BalancerConfiguration&) = delete;
|
||||||
BalancerConfiguration& operator=(const BalancerConfiguration&) = delete;
|
BalancerConfiguration& operator=(const BalancerConfiguration&) = delete;
|
||||||
|
|
||||||
|
|
@ -209,37 +208,37 @@ public:
|
||||||
* Non-blocking method, which checks whether the balancer is enabled (without checking for the
|
* Non-blocking method, which checks whether the balancer is enabled (without checking for the
|
||||||
* balancing window).
|
* balancing window).
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE mongo::BalancerModeEnum getBalancerMode() const;
|
mongo::BalancerModeEnum getBalancerMode() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Synchronous method, which writes the balancer mode to the configuration data.
|
* Synchronous method, which writes the balancer mode to the configuration data.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE Status setBalancerMode(OperationContext* opCtx, mongo::BalancerModeEnum mode);
|
Status setBalancerMode(OperationContext* opCtx, mongo::BalancerModeEnum mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether balancing is allowed based on both the enabled state of the balancer and the
|
* Returns whether balancing is allowed based on both the enabled state of the balancer and the
|
||||||
* balancing window.
|
* balancing window.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE bool shouldBalance(OperationContext* opCtx) const;
|
bool shouldBalance(OperationContext* opCtx) const;
|
||||||
MONGO_MOD_PRIVATE bool shouldBalanceForAutoMerge(OperationContext* opCtx) const;
|
bool shouldBalanceForAutoMerge(OperationContext* opCtx) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the secondary throttle options for the balancer.
|
* Returns the secondary throttle options for the balancer.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE MigrationSecondaryThrottleOptions getSecondaryThrottle() const;
|
MigrationSecondaryThrottleOptions getSecondaryThrottle() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the balancer should wait for deletion of orphaned chunk data at the end of
|
* Returns whether the balancer should wait for deletion of orphaned chunk data at the end of
|
||||||
* each migration.
|
* each migration.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE bool waitForDelete() const;
|
bool waitForDelete() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the balancer should attempt to schedule migrations of 'large' chunks. If
|
* Returns whether the balancer should attempt to schedule migrations of 'large' chunks. If
|
||||||
* false, the balancer will instead mark these chunks as 'jumbo', meaning they will not be
|
* false, the balancer will instead mark these chunks as 'jumbo', meaning they will not be
|
||||||
* scheduled for any split or move in the future.
|
* scheduled for any split or move in the future.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE bool attemptToBalanceJumboChunks() const;
|
bool attemptToBalanceJumboChunks() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the max chunk size after which a chunk would be considered jumbo.
|
* Returns the max chunk size after which a chunk would be considered jumbo.
|
||||||
|
|
@ -251,9 +250,9 @@ public:
|
||||||
/**
|
/**
|
||||||
* Change the cluster wide auto merge settings.
|
* Change the cluster wide auto merge settings.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE Status changeAutoMergeSettings(OperationContext* opCtx, bool enable);
|
Status changeAutoMergeSettings(OperationContext* opCtx, bool enable);
|
||||||
|
|
||||||
MONGO_MOD_PRIVATE bool shouldAutoMerge() const {
|
bool shouldAutoMerge() const {
|
||||||
return _shouldAutoMerge.loadRelaxed();
|
return _shouldAutoMerge.loadRelaxed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -266,31 +265,30 @@ public:
|
||||||
* This method is thread-safe but it doesn't make sense to be called from more than one thread
|
* This method is thread-safe but it doesn't make sense to be called from more than one thread
|
||||||
* at a time.
|
* at a time.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_NEEDS_REPLACEMENT Status refreshAndCheck(OperationContext* opCtx);
|
Status refreshAndCheck(OperationContext* opCtx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a settings object with the default values. To be used when no balancer settings
|
* Constructs a settings object with the default values. To be used when no balancer settings
|
||||||
* have been specified.
|
* have been specified.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE BalancerSettings createDefaultSettings();
|
BalancerSettings createDefaultSettings();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interprets the BSON content as balancer settings and extracts the respective values.
|
* Interprets the BSON content as balancer settings and extracts the respective values.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE StatusWith<BalancerSettings> getSettingsFromBSON(OperationContext* opCtx,
|
StatusWith<BalancerSettings> getSettingsFromBSON(OperationContext* opCtx, const BSONObj& obj);
|
||||||
const BSONObj& obj);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if either 'now' is in the balancing window or if no balancing window exists.
|
* Returns true if either 'now' is in the balancing window or if no balancing window exists.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE bool isTimeInBalancingWindow(OperationContext* opCtx,
|
bool isTimeInBalancingWindow(OperationContext* opCtx,
|
||||||
const boost::posix_time::ptime& now) const;
|
const boost::posix_time::ptime& now) const;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify the balancer settings directly. This is used for testing purposes only.
|
* Modify the balancer settings directly. This is used for testing purposes only.
|
||||||
*/
|
*/
|
||||||
MONGO_MOD_PRIVATE void setBalancerSettingsForTest(const BalancerSettings& settings) {
|
void setBalancerSettingsForTest(const BalancerSettings& settings) {
|
||||||
stdx::lock_guard<stdx::mutex> lk(_balancerSettingsMutex);
|
stdx::lock_guard<stdx::mutex> lk(_balancerSettingsMutex);
|
||||||
_balancerSettings = settings;
|
_balancerSettings = settings;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@
|
||||||
# it in the license file.
|
# it in the license file.
|
||||||
|
|
||||||
global:
|
global:
|
||||||
mod_visibility: private
|
|
||||||
cpp_namespace: "mongo"
|
cpp_namespace: "mongo"
|
||||||
cpp_includes:
|
cpp_includes:
|
||||||
- "mongo/s/request_types/migration_secondary_throttle_options.h"
|
- "mongo/s/request_types/migration_secondary_throttle_options.h"
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
# Feature flags for balancer functionality.
|
# Feature flags for balancer functionality.
|
||||||
|
|
||||||
global:
|
global:
|
||||||
mod_visibility: private
|
|
||||||
cpp_namespace: "mongo::feature_flags"
|
cpp_namespace: "mongo::feature_flags"
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ types:
|
||||||
structs:
|
structs:
|
||||||
AutoSplitVectorResponse:
|
AutoSplitVectorResponse:
|
||||||
description: "The reply of an autoSplitVector command."
|
description: "The reply of an autoSplitVector command."
|
||||||
mod_visibility: public
|
|
||||||
strict: false
|
strict: false
|
||||||
is_command_reply: true
|
is_command_reply: true
|
||||||
fields:
|
fields:
|
||||||
|
|
@ -65,7 +64,6 @@ commands:
|
||||||
strict: false
|
strict: false
|
||||||
namespace: concatenate_with_db
|
namespace: concatenate_with_db
|
||||||
api_version: ""
|
api_version: ""
|
||||||
mod_visibility: public
|
|
||||||
fields:
|
fields:
|
||||||
keyPattern:
|
keyPattern:
|
||||||
type: object_owned
|
type: object_owned
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
# _configsvrBalancerCollectionStatus and balancerCollectionStatus IDL File
|
# _configsvrBalancerCollectionStatus and balancerCollectionStatus IDL File
|
||||||
|
|
||||||
global:
|
global:
|
||||||
mod_visibility: private
|
|
||||||
cpp_namespace: "mongo"
|
cpp_namespace: "mongo"
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
global:
|
global:
|
||||||
mod_visibility: private
|
|
||||||
cpp_namespace: "mongo"
|
cpp_namespace: "mongo"
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
# _configsvrConfigureCollectionBalancing and configureCollectionBalancing IDL File
|
# _configsvrConfigureCollectionBalancing and configureCollectionBalancing IDL File
|
||||||
|
|
||||||
global:
|
global:
|
||||||
mod_visibility: private
|
|
||||||
cpp_namespace: "mongo"
|
cpp_namespace: "mongo"
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
global:
|
global:
|
||||||
mod_visibility: private
|
|
||||||
cpp_namespace: "mongo"
|
cpp_namespace: "mongo"
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
global:
|
global:
|
||||||
mod_visibility: private
|
|
||||||
cpp_namespace: "mongo"
|
cpp_namespace: "mongo"
|
||||||
cpp_includes:
|
cpp_includes:
|
||||||
- "mongo/s/request_types/update_zone_key_range_serialization.h"
|
- "mongo/s/request_types/update_zone_key_range_serialization.h"
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "mongo/bson/bsonobjbuilder.h"
|
#include "mongo/bson/bsonobjbuilder.h"
|
||||||
#include "mongo/util/modules.h"
|
|
||||||
|
|
||||||
#include <boost/optional/optional.hpp>
|
#include <boost/optional/optional.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ structs:
|
||||||
ResumeTokenOplogTimestamp:
|
ResumeTokenOplogTimestamp:
|
||||||
description: "Token format which facilitates resuming from the most recently-observed timestamp in the oplog"
|
description: "Token format which facilitates resuming from the most recently-observed timestamp in the oplog"
|
||||||
strict: true
|
strict: true
|
||||||
mod_visibility: public
|
|
||||||
fields:
|
fields:
|
||||||
ts:
|
ts:
|
||||||
type: timestamp
|
type: timestamp
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ structs:
|
||||||
# required for resharding because durable state from all resharding operations is cleaned up
|
# required for resharding because durable state from all resharding operations is cleaned up
|
||||||
# before the upgrade or downgrade can complete.
|
# before the upgrade or downgrade can complete.
|
||||||
strict: false
|
strict: false
|
||||||
mod_visibility: public
|
|
||||||
fields:
|
fields:
|
||||||
tempNs:
|
tempNs:
|
||||||
cpp_name: tempReshardingNss
|
cpp_name: tempReshardingNss
|
||||||
|
|
@ -64,7 +63,6 @@ structs:
|
||||||
# required for resharding because durable state from all resharding operations is cleaned up
|
# required for resharding because durable state from all resharding operations is cleaned up
|
||||||
# before the upgrade or downgrade can complete.
|
# before the upgrade or downgrade can complete.
|
||||||
strict: false
|
strict: false
|
||||||
mod_visibility: public
|
|
||||||
fields:
|
fields:
|
||||||
cloneTimestamp:
|
cloneTimestamp:
|
||||||
type: timestamp
|
type: timestamp
|
||||||
|
|
@ -104,7 +102,6 @@ structs:
|
||||||
# required for resharding because durable state from all resharding operations is cleaned up
|
# required for resharding because durable state from all resharding operations is cleaned up
|
||||||
# before the upgrade or downgrade can complete.
|
# before the upgrade or downgrade can complete.
|
||||||
strict: false
|
strict: false
|
||||||
mod_visibility: public
|
|
||||||
fields:
|
fields:
|
||||||
uuid:
|
uuid:
|
||||||
cpp_name: reshardingUUID
|
cpp_name: reshardingUUID
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue