mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
Revert "SERVER-56779 Include forgotten file change on the master branch"
This reverts commit1c4527816b
. Also reverts "SERVER-56779 Make the sharded_mergeChunks_partitioned.js workload retry on conflicting operations" This reverts commit550df92b89
.
This commit is contained in:
parent
5ffdb69a0d
commit
eae62a64d0
@ -105,11 +105,7 @@ var ChunkHelper = (function() {
|
||||
|
||||
function mergeChunks(db, collName, bounds) {
|
||||
var cmd = {mergeChunks: db[collName].getFullName(), bounds: bounds};
|
||||
return runCommandWithRetries(
|
||||
db,
|
||||
cmd,
|
||||
res => (res.code === ErrorCodes.ConflictingOperationInProgress ||
|
||||
res.code === ErrorCodes.LockBusy));
|
||||
return runCommandWithRetries(db, cmd, res => res.code === ErrorCodes.LockBusy);
|
||||
}
|
||||
|
||||
// Take a set of connections to a shard (replica set or standalone mongod),
|
||||
|
@ -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 chunk boundaries and has no holes, error if not valid
|
||||
// Validate the range starts and ends at chunks and has no holes, error if not valid
|
||||
//
|
||||
|
||||
BSONObj firstDocMin = chunksToMerge.front().getMin();
|
||||
@ -187,9 +187,14 @@ void mergeChunks(OperationContext* opCtx,
|
||||
const BSONObj& minKey,
|
||||
const BSONObj& maxKey,
|
||||
const OID& expectedEpoch) {
|
||||
auto scopedSplitOrMergeChunk(
|
||||
uassertStatusOK(ActiveMigrationsRegistry::get(opCtx).registerSplitOrMergeChunk(
|
||||
nss, ChunkRange(minKey, maxKey))));
|
||||
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)
|
||||
<< ")");
|
||||
|
||||
// We now have the collection distributed lock, refresh metadata to latest version and sanity
|
||||
// check
|
||||
|
Loading…
Reference in New Issue
Block a user