summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2020-04-24 11:45:51 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-24 20:09:44 +0000
commit3a24badcd090d1f4b69aa9e800625ba67575b421 (patch)
tree3ce2f34ed091e22cc98250d15a83c79152693bad
parent560b266f41b1507ddb09cf6dfd61f26ca60b89b7 (diff)
downloadmongo-3a24badcd090d1f4b69aa9e800625ba67575b421.tar.gz
SERVER-47707 Fix TODOs to reference a more appropriate ticket
-rw-r--r--src/mongo/db/s/op_observer_sharding_impl.cpp5
-rw-r--r--src/mongo/db/s/shard_server_op_observer.cpp10
2 files changed, 9 insertions, 6 deletions
diff --git a/src/mongo/db/s/op_observer_sharding_impl.cpp b/src/mongo/db/s/op_observer_sharding_impl.cpp
index 8ba84469ff8..dcc5d398dc0 100644
--- a/src/mongo/db/s/op_observer_sharding_impl.cpp
+++ b/src/mongo/db/s/op_observer_sharding_impl.cpp
@@ -56,8 +56,9 @@ void assertIntersectingChunkHasNotMoved(OperationContext* opCtx,
if (!atClusterTime)
return;
- // TODO (SERVER-47472): The execution leading to here will guarantee that the metadata is always
- // known, so the !metadata check can be removed
+ // TODO (SERVER-47701): As part of enabling transition from a replica-set to sharded cluster,
+ // without requiring application downtime, these checks need to be revisited. Ideally this code
+ // should not be reached upon direct writes to a shard.
auto metadata = csr->getCurrentMetadataIfKnown();
if (!metadata || !metadata->isSharded())
return;
diff --git a/src/mongo/db/s/shard_server_op_observer.cpp b/src/mongo/db/s/shard_server_op_observer.cpp
index 2b303782a9c..33b9c4339f2 100644
--- a/src/mongo/db/s/shard_server_op_observer.cpp
+++ b/src/mongo/db/s/shard_server_op_observer.cpp
@@ -236,8 +236,9 @@ void ShardServerOpObserver::onInserts(OperationContext* opCtx,
std::vector<InsertStatement>::const_iterator begin,
std::vector<InsertStatement>::const_iterator end,
bool fromMigrate) {
- // TODO (SERVER-47472): The execution leading to here will guarantee that the metadata is always
- // known, so the !metadata check can be removed
+ // TODO (SERVER-47701): As part of enabling transition from a replica-set to sharded cluster,
+ // without requiring application downtime, these checks need to be revisited. Ideally this code
+ // should not be reached upon direct writes to a shard.
const auto metadata = CollectionShardingRuntime::get(opCtx, nss)->getCurrentMetadataIfKnown();
for (auto it = begin; it != end; ++it) {
@@ -392,8 +393,9 @@ void ShardServerOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateE
}
}
- // TODO (SERVER-47472): The execution leading to here will guarantee that the metadata is always
- // known, so the !metadata check can be removed
+ // TODO (SERVER-47701): As part of enabling transition from a replica-set to sharded cluster,
+ // without requiring application downtime, these checks need to be revisited. Ideally this code
+ // should not be reached upon direct writes to a shard.
auto* const csr = CollectionShardingRuntime::get(opCtx, args.nss);
const auto metadata = csr->getCurrentMetadataIfKnown();
if (metadata && metadata->isSharded()) {