diff options
author | Randolph Tan <randolph@10gen.com> | 2019-03-06 14:17:57 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2019-03-20 14:17:38 -0400 |
commit | 6d774652650dff718a8fa89c2bc845c3b11aa051 (patch) | |
tree | 8b99f5cf191fdc258ab8e38123d61eca1338a298 /src/mongo/db/s/migration_chunk_cloner_source_legacy.h | |
parent | 5c1857f6dbd4a8c5e98fbaca2bda58c606b241a9 (diff) | |
download | mongo-6d774652650dff718a8fa89c2bc845c3b11aa051.tar.gz |
SERVER-35219 Change the sleep on the destination side into a cond var wait on the donor side of session migration.
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.h | 10 |
1 files changed, 10 insertions, 0 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 3440f7d79ea..aa8fda0530c 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.h +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.h @@ -164,6 +164,16 @@ public: boost::optional<repl::OpTime> nextSessionMigrationBatch(OperationContext* opCtx, BSONArrayBuilder* arrBuilder); + /** + * Returns a notification that can be used to wait for new oplog that needs to be migrated. + * If the value in the notification returns true, it means that there are no more new batches + * that needs to be fetched because the migration has already entered the critical section or + * aborted. + * + * Returns nullptr if there is no session migration associated with this migration. + */ + std::shared_ptr<Notification<bool>> getNotificationForNextSessionMigrationBatch(); + private: friend class LogOpForShardingHandler; |