diff options
author | Judah Schvimer <judah@mongodb.com> | 2016-04-26 17:57:24 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2016-04-26 17:57:24 -0400 |
commit | 1ed034b959e15d5882a0dda072eef3435678248b (patch) | |
tree | 1c9c4a3f725e3399d6257af58ee4802a8bb7eb7e /src/mongo/db/s/chunk_move_write_concern_options.cpp | |
parent | d6a77a0135db56972b2626a08e20a240a770f66f (diff) | |
download | mongo-1ed034b959e15d5882a0dda072eef3435678248b.tar.gz |
SERVER-23340 Turn off secondaryThrottle by default
Diffstat (limited to 'src/mongo/db/s/chunk_move_write_concern_options.cpp')
-rw-r--r-- | src/mongo/db/s/chunk_move_write_concern_options.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mongo/db/s/chunk_move_write_concern_options.cpp b/src/mongo/db/s/chunk_move_write_concern_options.cpp index 4005e50106c..32ecdaf56dc 100644 --- a/src/mongo/db/s/chunk_move_write_concern_options.cpp +++ b/src/mongo/db/s/chunk_move_write_concern_options.cpp @@ -33,7 +33,9 @@ #include "mongo/db/s/chunk_move_write_concern_options.h" #include "mongo/base/status_with.h" +#include "mongo/db/operation_context.h" #include "mongo/db/repl/replication_coordinator_global.h" +#include "mongo/db/service_context.h" #include "mongo/s/migration_secondary_throttle_options.h" #include "mongo/util/log.h" @@ -64,8 +66,17 @@ WriteConcernOptions getDefaultWriteConcernForMigration() { } // namespace StatusWith<WriteConcernOptions> ChunkMoveWriteConcernOptions::getEffectiveWriteConcern( - const MigrationSecondaryThrottleOptions& options) { - if (options.getSecondaryThrottle() == MigrationSecondaryThrottleOptions::kOff) { + OperationContext* txn, const MigrationSecondaryThrottleOptions& options) { + auto secondaryThrottle = options.getSecondaryThrottle(); + if (secondaryThrottle == MigrationSecondaryThrottleOptions::kDefault) { + if (txn->getServiceContext()->getGlobalStorageEngine()->supportsDocLocking()) { + secondaryThrottle = MigrationSecondaryThrottleOptions::kOff; + } else { + secondaryThrottle = MigrationSecondaryThrottleOptions::kOn; + } + } + + if (secondaryThrottle == MigrationSecondaryThrottleOptions::kOff) { return kWriteConcernLocal; } |