mirror of
https://github.com/gigablast/open-source-search-engine.git
synced 2024-10-04 04:07:13 +03:00
fix bug when we nuke a collnum
from a tree right in the middle of when saving rdb trees in process.cpp.
This commit is contained in:
parent
fe2144d13d
commit
b83dd59913
@ -591,6 +591,9 @@ bool Collectiondb::deleteRec ( char *coll , bool deleteTurkdb ) {
|
||||
sc->m_lastDownloadCache.clear(collnum);
|
||||
*/
|
||||
|
||||
// CAUTION: tree might be in the middle of saving
|
||||
// we deal with this in Process.cpp now
|
||||
|
||||
// remove from spider cache, tell it to sync up with collectiondb
|
||||
//g_spiderCache.reset1();
|
||||
// . TODO: remove from g_sync
|
||||
@ -796,6 +799,9 @@ bool Collectiondb::resetColl ( char *coll , bool resetTurkdb ) {
|
||||
// right now we #define collnum_t short
|
||||
if ( m_numRecs > 0x7fff ) { char *xx=NULL;*xx=0; }
|
||||
|
||||
// CAUTION: tree might be in the middle of saving
|
||||
// we deal with this in Process.cpp now
|
||||
|
||||
// . unlink all the *.dat and *.map files for this coll in its subdir
|
||||
// . remove all recs from this collnum from m_tree/m_buckets
|
||||
// . updates RdbBase::m_collnum
|
||||
|
@ -1497,7 +1497,11 @@ bool Process::saveRdbTrees ( bool useThread ) {
|
||||
// check if any need to finish saving
|
||||
for ( long i = 0 ; i < m_numRdbs ; i++ ) {
|
||||
Rdb *rdb = m_rdbs[i];
|
||||
if ( rdb->needsSave ( ) ) return false;
|
||||
//if ( rdb->needsSave ( ) ) return false;
|
||||
// we disable the tree while saving so we can't really add recs
|
||||
// to one rdb tree while saving, but for crawlbot
|
||||
// we might have added or deleted collections.
|
||||
if ( rdb->isSavingTree ( ) ) return false;
|
||||
}
|
||||
|
||||
// . check spider cache files (doleiptable waitingtree etc.)
|
||||
|
5
Rdb.cpp
5
Rdb.cpp
@ -879,6 +879,11 @@ void Rdb::doneSaving ( ) {
|
||||
//if ( m_isClosing ) close ( );
|
||||
}
|
||||
|
||||
bool Rdb::isSavingTree ( ) {
|
||||
if ( m_useTree ) return m_tree.m_isSaving;
|
||||
return m_buckets.m_isSaving;
|
||||
}
|
||||
|
||||
bool Rdb::saveTree ( bool useThread ) {
|
||||
char *dbn = m_dbname;
|
||||
if ( ! dbn ) dbn = "unknown";
|
||||
|
Loading…
Reference in New Issue
Block a user