mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-56779 Include forgotten file change on the master branch
This commit is contained in:
parent
ba0658c4d7
commit
1c4527816b
@ -38,8 +38,8 @@
|
||||
#include "mongo/db/commands.h"
|
||||
#include "mongo/db/field_parser.h"
|
||||
#include "mongo/db/namespace_string.h"
|
||||
#include "mongo/db/s/active_migrations_registry.h"
|
||||
#include "mongo/db/s/collection_sharding_runtime.h"
|
||||
#include "mongo/db/s/dist_lock_manager.h"
|
||||
#include "mongo/db/s/shard_filtering_metadata_refresh.h"
|
||||
#include "mongo/db/s/sharding_state.h"
|
||||
#include "mongo/db/vector_clock.h"
|
||||
@ -106,7 +106,7 @@ Shard::CommandResponse commitMergeOnConfigServer(OperationContext* opCtx,
|
||||
!chunksToMerge.empty());
|
||||
|
||||
//
|
||||
// Validate the range starts and ends at chunks and has no holes, error if not valid
|
||||
// Validate the range starts and ends at chunk boundaries and has no holes, error if not valid
|
||||
//
|
||||
|
||||
BSONObj firstDocMin = chunksToMerge.front().getMin();
|
||||
@ -187,14 +187,9 @@ void mergeChunks(OperationContext* opCtx,
|
||||
const BSONObj& minKey,
|
||||
const BSONObj& maxKey,
|
||||
const OID& expectedEpoch) {
|
||||
const std::string whyMessage = str::stream() << "merging chunks in " << nss.ns() << " from "
|
||||
<< redact(minKey) << " to " << redact(maxKey);
|
||||
auto scopedDistLock = uassertStatusOKWithContext(
|
||||
DistLockManager::get(opCtx)->lock(
|
||||
opCtx, nss.ns(), whyMessage, DistLockManager::kDefaultLockTimeout),
|
||||
str::stream() << "could not acquire collection lock for " << nss.ns()
|
||||
<< " to merge chunks in [" << redact(minKey) << ", " << redact(maxKey)
|
||||
<< ")");
|
||||
auto scopedSplitOrMergeChunk(
|
||||
uassertStatusOK(ActiveMigrationsRegistry::get(opCtx).registerSplitOrMergeChunk(
|
||||
nss, ChunkRange(minKey, maxKey))));
|
||||
|
||||
// We now have the collection distributed lock, refresh metadata to latest version and sanity
|
||||
// check
|
||||
|
Loading…
Reference in New Issue
Block a user