mirror of
https://github.com/privacore/open-source-search-engine.git
synced 2025-07-12 02:26:07 -04:00
There shouldn't be any problem with dumping & saving at the same time
This commit is contained in:
14
Process.cpp
14
Process.cpp
@ -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
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 ) {
|
||||
|
Reference in New Issue
Block a user