summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-06-08 13:29:37 -0400
committerAndy Schwerin <schwerin@mongodb.com>2015-06-08 13:31:22 -0400
commit9e1657ebd156ed70f44a4585d2330510d75e2ae5 (patch)
tree4eba9bdb8e5824c8caee34c482207e6c6c5d4e7b /src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
parent9706bfd8946fdcfdbd97b9f451522666355985f1 (diff)
downloadmongo-9e1657ebd156ed70f44a4585d2330510d75e2ae5.tar.gz
SERVER-15192 Roll up of patches required to make logOp rollback safe in v3.0.
This rolls up commits with the following summaries from the master development branch into the v3.0 branch. * Make AuthzManager logOp listener rollback-safe * Make MigrateFromStatus logOp listener rollback-safe * Make dbhash and storedFuncMod logOp listeners rollback-safe * Remove RollBackPreventer since all logOp listeners are now rollback-safe * Do not perform a query while committing. * Terminate server if RecoveryUnit::Change throws on commit or rollback.
Diffstat (limited to 'src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp')
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp b/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
index af4d93ba039..a806bae91be 100644
--- a/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
@@ -107,9 +107,14 @@ namespace mongo {
if (getDur().isDurable())
markWritesForJournaling();
- for (Changes::const_iterator it = _changes.begin(), end = _changes.end();
+ try {
+ for (Changes::const_iterator it = _changes.begin(), end = _changes.end();
it != end; ++it) {
- (*it)->commit();
+ (*it)->commit();
+ }
+ }
+ catch (...) {
+ std::terminate();
}
resetChanges();
@@ -223,9 +228,14 @@ namespace mongo {
LOG(2) << " ***** ROLLING BACK " << (_changes.size()) << " custom changes";
- for (int i = _changes.size() - 1; i >= 0; i--) {
- LOG(2) << "CUSTOM ROLLBACK " << demangleName(typeid(*_changes[i]));
- _changes[i]->rollback();
+ try {
+ for (int i = _changes.size() - 1; i >= 0; i--) {
+ LOG(2) << "CUSTOM ROLLBACK " << demangleName(typeid(*_changes[i]));
+ _changes[i]->rollback();
+ }
+ }
+ catch (...) {
+ std::terminate();
}
resetChanges();