diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-11-07 17:43:48 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-25 22:26:41 +0000 |
commit | 4797caa17de8e8c34074b2f0db8a1e1fbd480fae (patch) | |
tree | b4d1bcecf6a1fb769260035ca7517da9ec07ef98 /src | |
parent | 6423985cd3bed73d0526b0b921ec27f68d018608 (diff) | |
download | mongo-4797caa17de8e8c34074b2f0db8a1e1fbd480fae.tar.gz |
SERVER-44370 Have openBackupCursor accept inputs for incremental backup requests
(cherry picked from commit 64d293db1d52a192e3ec34c3a7674f6d342c0c42)
Diffstat (limited to 'src')
7 files changed, 31 insertions, 8 deletions
diff --git a/src/mongo/db/pipeline/mongo_process_interface.h b/src/mongo/db/pipeline/mongo_process_interface.h index 09656242b5f..1b2a091b79b 100644 --- a/src/mongo/db/pipeline/mongo_process_interface.h +++ b/src/mongo/db/pipeline/mongo_process_interface.h @@ -350,7 +350,10 @@ public: /** * The following methods forward to the BackupCursorHooks decorating the ServiceContext. */ - virtual BackupCursorState openBackupCursor(OperationContext* opCtx) = 0; + virtual BackupCursorState openBackupCursor(OperationContext* opCtx, + bool incrementalBackup, + boost::optional<std::string> thisBackupName, + boost::optional<std::string> srcBackupName) = 0; virtual void closeBackupCursor(OperationContext* opCtx, const UUID& backupId) = 0; diff --git a/src/mongo/db/pipeline/mongos_process_interface.h b/src/mongo/db/pipeline/mongos_process_interface.h index 2f11f6b2030..75f0f2ab1ab 100644 --- a/src/mongo/db/pipeline/mongos_process_interface.h +++ b/src/mongo/db/pipeline/mongos_process_interface.h @@ -190,7 +190,10 @@ public: * The following methods only make sense for data-bearing nodes and should never be called on * a mongos. */ - BackupCursorState openBackupCursor(OperationContext* opCtx) final { + BackupCursorState openBackupCursor(OperationContext* opCtx, + bool incrementalBackup, + boost::optional<std::string> thisBackupName, + boost::optional<std::string> srcBackupName) final { MONGO_UNREACHABLE; } diff --git a/src/mongo/db/pipeline/process_interface_standalone.cpp b/src/mongo/db/pipeline/process_interface_standalone.cpp index 0e2bcf09bed..66671287ce4 100644 --- a/src/mongo/db/pipeline/process_interface_standalone.cpp +++ b/src/mongo/db/pipeline/process_interface_standalone.cpp @@ -496,10 +496,15 @@ boost::optional<Document> MongoInterfaceStandalone::lookupSingleDocument( return lookedUpDocument; } -BackupCursorState MongoInterfaceStandalone::openBackupCursor(OperationContext* opCtx) { +BackupCursorState MongoInterfaceStandalone::openBackupCursor( + OperationContext* opCtx, + bool incrementalBackup, + boost::optional<std::string> thisBackupName, + boost::optional<std::string> srcBackupName) { auto backupCursorHooks = BackupCursorHooks::get(opCtx->getServiceContext()); if (backupCursorHooks->enabled()) { - return backupCursorHooks->openBackupCursor(opCtx); + return backupCursorHooks->openBackupCursor( + opCtx, incrementalBackup, thisBackupName, srcBackupName); } else { uasserted(50956, "Backup cursors are an enterprise only feature."); } diff --git a/src/mongo/db/pipeline/process_interface_standalone.h b/src/mongo/db/pipeline/process_interface_standalone.h index 305fa8933ee..dbfb7261f1f 100644 --- a/src/mongo/db/pipeline/process_interface_standalone.h +++ b/src/mongo/db/pipeline/process_interface_standalone.h @@ -125,7 +125,10 @@ public: bool allowSpeculativeMajorityRead = false) final; std::vector<GenericCursor> getIdleCursors(const boost::intrusive_ptr<ExpressionContext>& expCtx, CurrentOpUserMode userMode) const final; - BackupCursorState openBackupCursor(OperationContext* opCtx) final; + BackupCursorState openBackupCursor(OperationContext* opCtx, + bool incrementalBackup, + boost::optional<std::string> thisBackupName, + boost::optional<std::string> srcBackupName) final; void closeBackupCursor(OperationContext* opCtx, const UUID& backupId) final; BackupCursorExtendState extendBackupCursor(OperationContext* opCtx, const UUID& backupId, diff --git a/src/mongo/db/pipeline/stub_mongo_process_interface.h b/src/mongo/db/pipeline/stub_mongo_process_interface.h index ec937bc8579..b2bf93560dd 100644 --- a/src/mongo/db/pipeline/stub_mongo_process_interface.h +++ b/src/mongo/db/pipeline/stub_mongo_process_interface.h @@ -182,7 +182,10 @@ public: MONGO_UNREACHABLE; } - BackupCursorState openBackupCursor(OperationContext* opCtx) final { + BackupCursorState openBackupCursor(OperationContext* opCtx, + bool incrementalBackup, + boost::optional<std::string> thisBackupName, + boost::optional<std::string> srcBackupName) final { return BackupCursorState{UUID::gen(), boost::none, {}}; } diff --git a/src/mongo/db/storage/backup_cursor_hooks.cpp b/src/mongo/db/storage/backup_cursor_hooks.cpp index f624762a914..0c86bec06f1 100644 --- a/src/mongo/db/storage/backup_cursor_hooks.cpp +++ b/src/mongo/db/storage/backup_cursor_hooks.cpp @@ -77,7 +77,10 @@ void BackupCursorHooks::fsyncUnlock(OperationContext* opCtx) { MONGO_UNREACHABLE; } -BackupCursorState BackupCursorHooks::openBackupCursor(OperationContext* opCtx) { +BackupCursorState BackupCursorHooks::openBackupCursor(OperationContext* opCtx, + bool incrementalBackup, + boost::optional<std::string> thisBackupName, + boost::optional<std::string> srcBackupName) { MONGO_UNREACHABLE; } diff --git a/src/mongo/db/storage/backup_cursor_hooks.h b/src/mongo/db/storage/backup_cursor_hooks.h index 6d4b306a296..c78110a3e90 100644 --- a/src/mongo/db/storage/backup_cursor_hooks.h +++ b/src/mongo/db/storage/backup_cursor_hooks.h @@ -61,7 +61,10 @@ public: virtual void fsyncUnlock(OperationContext* opCtx); - virtual BackupCursorState openBackupCursor(OperationContext* opCtx); + virtual BackupCursorState openBackupCursor(OperationContext* opCtx, + bool incrementalBackup, + boost::optional<std::string> thisBackupName, + boost::optional<std::string> srcBackupName); virtual void closeBackupCursor(OperationContext* opCtx, const UUID& backupId); |