From ed78ccd0f6cfc8f1e821c997fa9547bc90dde510 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 20 Jun 2016 18:24:37 +0200 Subject: 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. --- common/pipeline.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common/pipeline.cpp') 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() d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { Warning() << error.message; })); + + //FIXME this is a temporary measure to recover from a failure to open the named databases correctly. + //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). + //It seems like the validateNamedDatabase calls actually stops the mdb_put failures during sync... + while (!d->transaction.validateNamedDatabases()) { + Warning() << "Opened an invalid transaction!!!!!!"; + d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { + Warning() << error.message; + })); + } } void Pipeline::commit() -- cgit v1.2.3