diff options
Diffstat (limited to 'src/mongo/db/s')
8 files changed, 21 insertions, 28 deletions
diff --git a/src/mongo/db/s/collection_sharding_state.h b/src/mongo/db/s/collection_sharding_state.h index 575ccb85f2f..7684847cfbc 100644 --- a/src/mongo/db/s/collection_sharding_state.h +++ b/src/mongo/db/s/collection_sharding_state.h @@ -98,7 +98,7 @@ public: /** * If the shard currently doesn't know whether the collection is sharded or not, it will throw a - * StaleConfig exception. + * StaleConfig error. * * If the request doesn't have a shard version all collections will be treated as UNSHARDED. * @@ -112,7 +112,7 @@ public: * * If the shard currently doesn't know whether the collection is sharded or not, or if the * expected shard version doesn't match with the one in the OperationShardingState, it will - * throw a StaleConfig exception. + * throw a StaleConfig error. * * If the operation context contains an 'atClusterTime', the returned filtering object will be * tied to a specific point in time. Otherwise, it will reference the latest cluster time @@ -143,7 +143,7 @@ public: /** * Checks whether the shard version in the operation context is compatible with the shard - * version of the collection and if not, throws StaleConfigException populated with the received + * version of the collection and if not, throws StaleConfig error populated with the received * and wanted versions. * * If the request is not versioned all collections will be treated as UNSHARDED. diff --git a/src/mongo/db/s/migration_source_manager.h b/src/mongo/db/s/migration_source_manager.h index d93c701f3d5..a75e68c4474 100644 --- a/src/mongo/db/s/migration_source_manager.h +++ b/src/mongo/db/s/migration_source_manager.h @@ -97,8 +97,8 @@ public: * * May throw any exception. Known exceptions are: * - InvalidOptions if the operation context is missing shard version - * - StaleConfigException if the expected collection version does not match what we find it - * to be after acquiring the distributed lock. + * - StaleConfig if the expected collection version does not match what we find it to be after + * acquiring the distributed lock. */ MigrationSourceManager(OperationContext* opCtx, ShardsvrMoveRange&& request, diff --git a/src/mongo/db/s/move_primary_source_manager.h b/src/mongo/db/s/move_primary_source_manager.h index 45bc26a6b7a..42586f9d102 100644 --- a/src/mongo/db/s/move_primary_source_manager.h +++ b/src/mongo/db/s/move_primary_source_manager.h @@ -70,10 +70,10 @@ public: * Instantiates a new movePrimary source manager. Must be called with the distributed lock * acquired in advance (not asserted). * - * May throw any exception. Known exceptions (TODO) are: + * May throw any exception. Known exceptions are: * - InvalidOptions if the operation context is missing database version - * - StaleConfigException if the expected database version does not match what we find it - * to be after acquiring the distributed lock. + * - StaleConfig if the expected database version does not match what we find it to be after + * acquiring the distributed lock */ MovePrimarySourceManager(OperationContext* opCtx, diff --git a/src/mongo/db/s/resharding/resharding_collection_cloner.cpp b/src/mongo/db/s/resharding/resharding_collection_cloner.cpp index 88ac85eed34..e51d2e2ed1f 100644 --- a/src/mongo/db/s/resharding/resharding_collection_cloner.cpp +++ b/src/mongo/db/s/resharding/resharding_collection_cloner.cpp @@ -29,8 +29,6 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kResharding -#include "mongo/platform/basic.h" - #include "mongo/db/s/resharding/resharding_collection_cloner.h" #include <utility> @@ -276,7 +274,7 @@ bool ReshardingCollectionCloner::doOneBatch(OperationContext* opCtx, Pipeline& p // ReshardingOpObserver depends on the collection metadata being known when processing writes to // the temporary resharding collection. We attach shard version IGNORED to the insert operations - // and retry once on a StaleConfig exception to allow the collection metadata information to be + // and retry once on a StaleConfig error to allow the collection metadata information to be // recovered. ScopedSetShardRole scopedSetShardRole(opCtx, _outputNss, diff --git a/src/mongo/db/s/resharding/resharding_data_copy_util.h b/src/mongo/db/s/resharding/resharding_data_copy_util.h index 0858fa2d0e4..b51cfc250a5 100644 --- a/src/mongo/db/s/resharding/resharding_data_copy_util.h +++ b/src/mongo/db/s/resharding/resharding_data_copy_util.h @@ -149,8 +149,8 @@ void updateSessionRecord(OperationContext* opCtx, /** * Calls and returns the value from the supplied lambda function. * - * If a StaleConfig exception is thrown during its execution, then this function will attempt to - * refresh the collection and invoke the supplied lambda function a second time. + * If a StaleConfig error is thrown during its execution, then this function will attempt to refresh + * the collection and invoke the supplied lambda function a second time. */ template <typename Callable> auto withOneStaleConfigRetry(OperationContext* opCtx, Callable&& callable) { diff --git a/src/mongo/db/s/resharding/resharding_oplog_application.cpp b/src/mongo/db/s/resharding/resharding_oplog_application.cpp index b774095616b..42c5a1543e5 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_application.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_application.cpp @@ -29,8 +29,6 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kResharding -#include "mongo/platform/basic.h" - #include "mongo/db/s/resharding/resharding_oplog_application.h" #include "mongo/db/concurrency/exception_util.h" @@ -79,8 +77,8 @@ void runWithTransaction(OperationContext* opCtx, // ReshardingOpObserver depends on the collection metadata being known when processing writes to // the temporary resharding collection. We attach shard version IGNORED to the write operations - // and leave it to ReshardingOplogBatchApplier::applyBatch() to retry on a StaleConfig exception - // to allow the collection metadata information to be recovered. + // and leave it to ReshardingOplogBatchApplier::applyBatch() to retry on a StaleConfig error to + // allow the collection metadata information to be recovered. ScopedSetShardRole scopedSetShardRole(asr.opCtx(), nss, ChunkVersion::IGNORED() /* shardVersion */, diff --git a/src/mongo/db/s/resharding/resharding_oplog_batch_applier.cpp b/src/mongo/db/s/resharding/resharding_oplog_batch_applier.cpp index 4ff29b42d30..c7efa6d33e4 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_batch_applier.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_batch_applier.cpp @@ -29,12 +29,8 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kResharding -#include "mongo/platform/basic.h" - #include "mongo/db/s/resharding/resharding_oplog_batch_applier.h" -#include <memory> - #include "mongo/db/s/operation_sharding_state.h" #include "mongo/db/s/resharding/resharding_data_copy_util.h" #include "mongo/db/s/resharding/resharding_future_util.h" @@ -83,8 +79,8 @@ SemiFuture<void> ReshardingOplogBatchApplier::applyBatch( // ReshardingOpObserver depends on the collection metadata being known // when processing writes to the temporary resharding collection. We // attach shard version IGNORED to the write operations and retry once - // on a StaleConfig exception to allow the collection metadata - // information to be recovered. + // on a StaleConfig error to allow the collection metadata information to + // be recovered. ScopedSetShardRole scopedSetShardRole( opCtx.get(), _crudApplication.getOutputNss(), diff --git a/src/mongo/db/s/shard_filtering_metadata_refresh.h b/src/mongo/db/s/shard_filtering_metadata_refresh.h index 0a714ee2b61..fd3a8b8ca6d 100644 --- a/src/mongo/db/s/shard_filtering_metadata_refresh.h +++ b/src/mongo/db/s/shard_filtering_metadata_refresh.h @@ -39,11 +39,12 @@ namespace mongo { class OperationContext; /** - * Must be invoked whenever code, which is executing on a shard encounters a StaleConfig exception - * and should be passed the 'version received' from the exception. If the shard's current version is - * behind 'shardVersionReceived', causes the shard's filtering metadata to be refreshed from the - * config server, otherwise does nothing and immediately returns. If there are other threads - * currently performing refresh, blocks so that only one of them hits the config server. + * Must be invoked whenever code, which is executing on a shard encounters a StaleConfig error and + * should be passed the placement version from the 'version received' in the exception. If the + * shard's current placement version is behind 'chunkVersionReceived', causes the shard's filtering + * metadata to be refreshed from the config server, otherwise does nothing and immediately returns. + * If there are other threads currently performing refresh, blocks so that only one of them hits the + * config server. * * If refresh fails for any reason (most commonly ExceededTimeLimit), returns a failed status. * |