summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/sharding_catalog_client.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-08-07 20:25:23 -0400
committerMathias Stearn <mathias@10gen.com>2017-08-07 20:25:23 -0400
commitd8ba998ea7d5c8304ae71ab17e8ba4f6f6f28db6 (patch)
treedef874be27d96a667ffc030a2e0bd1a3a32c79cb /src/mongo/s/catalog/sharding_catalog_client.h
parentfd62ac35e27f83155cbe3d60bf02c49f45298e54 (diff)
downloadmongo-d8ba998ea7d5c8304ae71ab17e8ba4f6f6f28db6.tar.gz
Revert "SERVER-30324 Move cluster_remove_shard_cmd to mongod"
This reverts commit 580cd9ec9e9c5b52d73491655d970d75a7ec1a9c.
Diffstat (limited to 'src/mongo/s/catalog/sharding_catalog_client.h')
-rw-r--r--src/mongo/s/catalog/sharding_catalog_client.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/mongo/s/catalog/sharding_catalog_client.h b/src/mongo/s/catalog/sharding_catalog_client.h
index f9e7a4c3484..81eb5c0a238 100644
--- a/src/mongo/s/catalog/sharding_catalog_client.h
+++ b/src/mongo/s/catalog/sharding_catalog_client.h
@@ -71,6 +71,16 @@ struct ConnectionPoolStats;
}
/**
+ * Used to indicate to the caller of the removeShard method whether draining of chunks for
+ * a particular shard has started, is ongoing, or has been completed.
+ */
+enum ShardDrainingStatus {
+ STARTED,
+ ONGOING,
+ COMPLETED,
+};
+
+/**
* Abstracts reads of the sharding catalog metadata.
*
* All implementations of this interface should go directly to the persistent backing store
@@ -91,9 +101,6 @@ public:
// Constant to use for configuration data majority writes
static const WriteConcernOptions kMajorityWriteConcern;
- // Constant to use for configuration data local writes
- static const WriteConcernOptions kLocalWriteConcern;
-
virtual ~ShardingCatalogClient() = default;
/**
@@ -109,6 +116,17 @@ public:
virtual void shutDown(OperationContext* opCtx) = 0;
/**
+ * Tries to remove a shard. To completely remove a shard from a sharded cluster,
+ * the data residing in that shard must be moved to the remaining shards in the
+ * cluster by "draining" chunks from that shard.
+ *
+ * Because of the asynchronous nature of the draining mechanism, this method returns
+ * the current draining status. See ShardDrainingStatus enum definition for more details.
+ */
+ virtual StatusWith<ShardDrainingStatus> removeShard(OperationContext* opCtx,
+ const ShardId& name) = 0;
+
+ /**
* Updates or creates the metadata for a given database.
*/
virtual Status updateDatabase(OperationContext* opCtx,