There shouldn't be any problem with dumping & saving at the same time

This commit is contained in:
Ai Lin Chia
2017-04-25 11:01:37 +02:00
parent f6df4d44cc
commit d587f6f22a
2 changed files with 0 additions and 28 deletions

@ -575,20 +575,6 @@ bool Process::save2 ( ) {
return true;
}
// . wait for any dump to complete
// . when merging titldb, it sets Rdb::m_dump.m_isDumping to true
// because it is dumping the results of the merge to a file.
// occasionally it will initiate a dump of tfndb which will not be
// possible because Rdb/RdbDump checks g_process.m_mode == Process::SAVE_MODE,
// and do not allow dumps to begin if that is true! so we end up in
// deadlock! the save can not complete
if ( isRdbDumping() ) {
return false;
}
// ok, now nobody is dumping, etc. make it so no dumps can start.
// Rdb.cpp/RdbDump.cpp check for this and will not dump if it is
// set to Process::SAVE_MODE
m_mode = Process::SAVE_MODE;
logf(LOG_INFO,"gb: Saving data to disk");

14
Rdb.cpp

@ -742,20 +742,6 @@ bool Rdb::dumpTree() {
return true;
}
// . if tree is saving do not dump it, that removes things from tree
// . i think this caused a problem messing of RdbMem before when
// both happened at once
if (isSavingTree()) {
logTrace( g_conf.m_logTraceRdb, "END. %s: Rdb tree/bucket is saving. Returning true", m_dbname );
return true;
}
// . if Process is saving, don't start a dump
if ( g_process.m_mode == Process::SAVE_MODE ) {
logTrace( g_conf.m_logTraceRdb, "END. %s: Process is in save mode. Returning true", m_dbname );
return true;
}
// if it has been less than 3 seconds since our last failed attempt
// do not try again to avoid flooding our log
if ( getTime() - s_lastTryTime < 3 ) {