summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_chunk_cloner_source_legacy.h
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2017-04-05 11:35:23 -0400
committerCharlie Swanson <charlie.swanson@mongodb.com>2017-04-13 16:15:20 -0400
commitcc954e9e1d88b30d1ab89ee3bbbd9db0bb15263d (patch)
tree37df000f0d37d17bc82d5d1ad5436b4911249e4b /src/mongo/db/s/migration_chunk_cloner_source_legacy.h
parentb02b7f7bb78d4fd0bb006591769faaa216e6f8a7 (diff)
downloadmongo-cc954e9e1d88b30d1ab89ee3bbbd9db0bb15263d.tar.gz
SERVER-25694 Eliminate race in PlanExecutor cleanup.
Ensures that a collection lock is held in at least MODE_IS while deregistering a PlanExecutor from the cursor manager. Introduces new PlanExecutor::dispose() and ClientCursor::dispose() methods that must be called before destruction of those classes, and ensures they are called before destruction. These calls will thread an OperationContext all the way through to DocumentSource::dispose() for each stage in a Pipeline, which will give DocumentSourceCursor a chance to acquire locks and deregister its PlanExecutor if necessary.
Diffstat (limited to 'src/mongo/db/s/migration_chunk_cloner_source_legacy.h')
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.h b/src/mongo/db/s/migration_chunk_cloner_source_legacy.h
index 7f8b7bf5468..28eca3989c5 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.h
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.h
@@ -34,6 +34,7 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/client/connection_string.h"
#include "mongo/db/namespace_string.h"
+#include "mongo/db/query/plan_executor.h"
#include "mongo/db/s/migration_chunk_cloner_source.h"
#include "mongo/db/s/migration_session_id.h"
#include "mongo/s/move_chunk_request.h"
@@ -48,7 +49,6 @@ class BSONArrayBuilder;
class BSONObjBuilder;
class Collection;
class Database;
-class PlanExecutor;
class RecordId;
class MigrationChunkClonerSourceLegacy final : public MigrationChunkClonerSource {
@@ -181,7 +181,7 @@ private:
// Registered deletion notifications plan executor, which will listen for document deletions
// during the cloning stage
- std::unique_ptr<PlanExecutor> _deleteNotifyExec;
+ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> _deleteNotifyExec;
// Protects the entries below
stdx::mutex _mutex;