summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/rollback_impl.cpp
diff options
context:
space:
mode:
authorKyle Suarez <kyle.suarez@mongodb.com>2018-03-07 13:47:50 -0500
committerKyle Suarez <kyle.suarez@mongodb.com>2018-03-07 13:47:50 -0500
commit86e1b61020ebe8c9490bce56b26b8037581a9c72 (patch)
tree06a8f80fedc62174ea87ec4ae4090f2230ecff93 /src/mongo/db/repl/rollback_impl.cpp
parent905194e3afac93289be65b40ede265e8fbfda6a4 (diff)
downloadmongo-86e1b61020ebe8c9490bce56b26b8037581a9c72.tar.gz
SERVER-33663 create parameter to control rollback data file creation
Users can suppress the creation of rollback data files by setting the 'createRollbackDataFiles' setParameter to false.
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.cpp')
-rw-r--r--src/mongo/db/repl/rollback_impl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/repl/rollback_impl.cpp b/src/mongo/db/repl/rollback_impl.cpp
index 34183ccf03f..1878d2cc679 100644
--- a/src/mongo/db/repl/rollback_impl.cpp
+++ b/src/mongo/db/repl/rollback_impl.cpp
@@ -45,12 +45,24 @@
#include "mongo/db/repl/storage_interface.h"
#include "mongo/db/s/shard_identity_rollback_notifier.h"
#include "mongo/db/s/type_shard_identity.h"
+#include "mongo/db/server_parameters.h"
#include "mongo/db/session_catalog.h"
#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
namespace mongo {
namespace repl {
+namespace {
+// Control whether or not the server will write out data files containing deleted documents during
+// rollback. This server parameter affects both rollback via refetch and rollback via recovery to
+// stable timestamp.
+constexpr bool createRollbackFilesDefault = true;
+MONGO_EXPORT_SERVER_PARAMETER(createRollbackDataFiles, bool, createRollbackFilesDefault);
+} // namespace
+
+bool RollbackImpl::shouldCreateDataFiles() {
+ return createRollbackDataFiles.load();
+}
RollbackImpl::RollbackImpl(OplogInterface* localOplog,
OplogInterface* remoteOplog,