summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorMatthew Saltz <matthew.saltz@mongodb.com>2018-08-08 16:26:10 -0400
committerMatthew Saltz <matthew.saltz@mongodb.com>2018-08-09 14:30:26 -0400
commitec3d7647e061ef9270c2e40fa22c1c996153e83d (patch)
tree4e7df03658e1424c40fbe48d073ae63d21de2833 /src/mongo/s
parentb225e12c9759f88c7d7d4e30fa4e7c13be1dc95a (diff)
downloadmongo-ec3d7647e061ef9270c2e40fa22c1c996153e83d.tar.gz
SERVER-34448 Remove miscellaneous now-unused autosplitter code from mongos
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/chunk_manager.h16
-rw-r--r--src/mongo/s/commands/cluster_write_cmd.cpp3
-rw-r--r--src/mongo/s/write_ops/chunk_manager_targeter.cpp10
-rw-r--r--src/mongo/s/write_ops/chunk_manager_targeter.h5
-rw-r--r--src/mongo/s/write_ops/cluster_write.cpp4
5 files changed, 5 insertions, 33 deletions
diff --git a/src/mongo/s/chunk_manager.h b/src/mongo/s/chunk_manager.h
index 99b91954791..eafa538442f 100644
--- a/src/mongo/s/chunk_manager.h
+++ b/src/mongo/s/chunk_manager.h
@@ -199,18 +199,6 @@ private:
// Max version across all chunks
const ChunkVersion _collectionVersion;
- // Auto-split throttling state (state mutable by write commands)
- struct AutoSplitThrottle {
- public:
- AutoSplitThrottle() : _splitTickets(maxParallelSplits) {}
-
- TicketHolder _splitTickets;
-
- // Maximum number of parallel threads requesting a split
- static const int maxParallelSplits = 5;
-
- } _autoSplitThrottle;
-
friend class ChunkManager;
};
@@ -407,10 +395,6 @@ public:
return _rt->uuidMatches(uuid);
}
- auto& autoSplitThrottle() const {
- return _rt->_autoSplitThrottle;
- }
-
auto getRoutingHistory() const {
return _rt;
}
diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp
index f4f3f789038..25ad8bcb48e 100644
--- a/src/mongo/s/commands/cluster_write_cmd.cpp
+++ b/src/mongo/s/commands/cluster_write_cmd.cpp
@@ -149,8 +149,7 @@ private:
std::vector<Strategy::CommandResult>* results) {
// Note that this implementation will not handle targeting retries and does not completely
// emulate write behavior
- TargeterStats stats;
- ChunkManagerTargeter targeter(targetingBatchItem.getRequest()->getTargetingNS(), &stats);
+ ChunkManagerTargeter targeter(targetingBatchItem.getRequest()->getTargetingNS());
Status status = targeter.init(opCtx);
if (!status.isOK())
return status;
diff --git a/src/mongo/s/write_ops/chunk_manager_targeter.cpp b/src/mongo/s/write_ops/chunk_manager_targeter.cpp
index 37962c4feef..2551a9b8b4c 100644
--- a/src/mongo/s/write_ops/chunk_manager_targeter.cpp
+++ b/src/mongo/s/write_ops/chunk_manager_targeter.cpp
@@ -315,8 +315,8 @@ bool wasMetadataRefreshed(const std::shared_ptr<ChunkManager>& managerA,
} // namespace
-ChunkManagerTargeter::ChunkManagerTargeter(const NamespaceString& nss, TargeterStats* stats)
- : _nss(nss), _needsTargetingRefresh(false), _stats(stats) {}
+ChunkManagerTargeter::ChunkManagerTargeter(const NamespaceString& nss)
+ : _nss(nss), _needsTargetingRefresh(false) {}
Status ChunkManagerTargeter::init(OperationContext* opCtx) {
@@ -628,12 +628,6 @@ ShardEndpoint ChunkManagerTargeter::_targetShardKey(const BSONObj& shardKey,
long long estDataSize) const {
const auto chunk = _routingInfo->cm()->findIntersectingChunk(shardKey, collation);
- // Track autosplit stats for sharded collections
- // Note: this is only best effort accounting and is not accurate.
- if (estDataSize > 0) {
- _stats->chunkSizeDelta[chunk.getMin()] += estDataSize;
- }
-
return {chunk.getShardId(), _routingInfo->cm()->getVersion(chunk.getShardId())};
}
diff --git a/src/mongo/s/write_ops/chunk_manager_targeter.h b/src/mongo/s/write_ops/chunk_manager_targeter.h
index abeb2735038..1506c9e84f5 100644
--- a/src/mongo/s/write_ops/chunk_manager_targeter.h
+++ b/src/mongo/s/write_ops/chunk_manager_targeter.h
@@ -56,7 +56,7 @@ class ChunkManagerTargeter : public NSTargeter {
public:
enum class UpdateType { kReplacement, kOpStyle, kUnknown };
- ChunkManagerTargeter(const NamespaceString& nss, TargeterStats* stats);
+ ChunkManagerTargeter(const NamespaceString& nss);
/**
* Initializes the ChunkManagerTargeter with the latest targeting information for the
@@ -161,9 +161,6 @@ private:
// Stores whether we need to check the remote server on refresh
bool _needsTargetingRefresh;
- // Represents only the view and not really part of the targeter state. This is not owned here.
- TargeterStats* _stats;
-
// The latest loaded routing cache entry
boost::optional<CachedCollectionRoutingInfo> _routingInfo;
diff --git a/src/mongo/s/write_ops/cluster_write.cpp b/src/mongo/s/write_ops/cluster_write.cpp
index 258f48308dd..421383d99ca 100644
--- a/src/mongo/s/write_ops/cluster_write.cpp
+++ b/src/mongo/s/write_ops/cluster_write.cpp
@@ -74,10 +74,8 @@ void ClusterWriter::write(OperationContext* opCtx,
if (nss.db() == NamespaceString::kAdminDb) {
Grid::get(opCtx)->catalogClient()->writeConfigServerDirect(opCtx, request, response);
} else {
- TargeterStats targeterStats;
-
{
- ChunkManagerTargeter targeter(request.getTargetingNS(), &targeterStats);
+ ChunkManagerTargeter targeter(request.getTargetingNS());
Status targetInitStatus = targeter.init(opCtx);
if (!targetInitStatus.isOK()) {