summaryrefslogtreecommitdiffstats
path: root/common/pipeline.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-20 18:24:37 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-20 18:24:37 +0200
commited78ccd0f6cfc8f1e821c997fa9547bc90dde510 (patch)
tree2d041aa4559367e7606438e2fa8c268cc54ef720 /common/pipeline.cpp
parent31ae386a96e61c4382aa15c13d9b23cdb158353d (diff)
downloadsink-ed78ccd0f6cfc8f1e821c997fa9547bc90dde510.tar.gz
sink-ed78ccd0f6cfc8f1e821c997fa9547bc90dde510.zip
Workaround mdb_put failures
I got failures during a sync during the initial mdb_put that stores the db name for verification on open (invalid parameter passed). It seems the verification step actually prevents the problem in the first place.
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r--common/pipeline.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp
index f9e82b7..7a89492 100644
--- a/common/pipeline.cpp
+++ b/common/pipeline.cpp
@@ -111,6 +111,16 @@ void Pipeline::startTransaction()
111 d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { 111 d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) {
112 Warning() << error.message; 112 Warning() << error.message;
113 })); 113 }));
114
115 //FIXME this is a temporary measure to recover from a failure to open the named databases correctly.
116 //Once the actual problem is fixed it will be enough to simply crash if we open the wrong database (which we check in openDatabase already).
117 //It seems like the validateNamedDatabase calls actually stops the mdb_put failures during sync...
118 while (!d->transaction.validateNamedDatabases()) {
119 Warning() << "Opened an invalid transaction!!!!!!";
120 d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) {
121 Warning() << error.message;
122 }));
123 }
114} 124}
115 125
116void Pipeline::commit() 126void Pipeline::commit()