summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarolyn Duan <carolyn.duan@mongodb.com>2021-07-15 21:24:35 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-22 22:10:55 +0000
commit9f8022c18615e333ae7acb529f2cf79c5e18d9e8 (patch)
tree3fcd52845490c7e38fe947fecd8cda65b7691ea5 /src
parent94dbfc26bb4189f6a42b19623665994dd4c52225 (diff)
downloadmongo-9f8022c18615e333ae7acb529f2cf79c5e18d9e8.tar.gz
SERVER-57807 Track filenames returned by $backupCursor, in
BackupCursorService
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/pipeline/process_interface/stub_mongo_process_interface.h2
-rw-r--r--src/mongo/db/storage/backup_cursor_hooks.cpp10
-rw-r--r--src/mongo/db/storage/backup_cursor_hooks.h8
3 files changed, 19 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/process_interface/stub_mongo_process_interface.h b/src/mongo/db/pipeline/process_interface/stub_mongo_process_interface.h
index bf500cf70e3..4a3973ab030 100644
--- a/src/mongo/db/pipeline/process_interface/stub_mongo_process_interface.h
+++ b/src/mongo/db/pipeline/process_interface/stub_mongo_process_interface.h
@@ -209,7 +209,7 @@ public:
}
BackupCursorState openBackupCursor(OperationContext* opCtx,
- const StorageEngine::BackupOptions& options) final {
+ const StorageEngine::BackupOptions& options) override {
return BackupCursorState{UUID::gen(), boost::none, nullptr, {}};
}
diff --git a/src/mongo/db/storage/backup_cursor_hooks.cpp b/src/mongo/db/storage/backup_cursor_hooks.cpp
index 8a965ddb40b..68fdfd5c3e5 100644
--- a/src/mongo/db/storage/backup_cursor_hooks.cpp
+++ b/src/mongo/db/storage/backup_cursor_hooks.cpp
@@ -33,6 +33,7 @@
#include "mongo/base/init.h"
#include "mongo/db/service_context.h"
+#include "mongo/util/assert_util.h"
namespace mongo {
@@ -95,4 +96,13 @@ BackupCursorExtendState BackupCursorHooks::extendBackupCursor(OperationContext*
bool BackupCursorHooks::isBackupCursorOpen() const {
return false;
}
+
+bool BackupCursorHooks::isFileReturnedByCursor(const UUID& backupId, std::string filename) {
+ MONGO_UNREACHABLE;
+}
+
+void BackupCursorHooks::addFilename(const UUID& backupId, std::string filename) {
+ MONGO_UNREACHABLE;
+}
+
} // namespace mongo
diff --git a/src/mongo/db/storage/backup_cursor_hooks.h b/src/mongo/db/storage/backup_cursor_hooks.h
index 6852d544f25..e166181aa03 100644
--- a/src/mongo/db/storage/backup_cursor_hooks.h
+++ b/src/mongo/db/storage/backup_cursor_hooks.h
@@ -71,6 +71,14 @@ public:
const Timestamp& extendTo);
virtual bool isBackupCursorOpen() const;
+
+ /**
+ * Returns true if `filename` was returned by the backup cursor `backupId`.
+ * Used to verify filenames passed into $backupFile.
+ */
+ virtual bool isFileReturnedByCursor(const UUID& backupId, std::string filename);
+
+ virtual void addFilename(const UUID& backupId, std::string filename);
};
} // namespace mongo