Skip to content

Commit

Permalink
show docids of corrupted title recs found.
Browse files Browse the repository at this point in the history
show key range of each dump to disk.
fix 'sentToDiffbot' bug for unchanged docs in status docs.
make sure firstKeyInQueue is set properly from current key,
so reset list ptr before doing that in RdbDump.cpp.
  • Loading branch information
gigablast committed Mar 16, 2016
1 parent 1faff50 commit 7396e57
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
9 changes: 8 additions & 1 deletion RdbDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,10 @@ bool RdbDump::dumpTree ( bool recall ) {
char *s = "none";
if ( m_rdb ) s = getDbnameFromId(m_rdb->m_rdbId);
log("dump: verifying list before dumping (rdb=%s "
"collnum=%i)",s,(int)m_collnum);
"collnum=%i k1=%s k2=%s)",s,
(int)m_collnum,
KEYSTR(m_firstKeyInQueue,m_list->m_ks),
KEYSTR(m_lastKeyInQueue ,m_list->m_ks));
m_list->checkList_r ( false , // removeNegRecs?
false , // sleep on problem?
m_rdb->m_rdbId );
Expand Down Expand Up @@ -460,6 +463,10 @@ bool RdbDump::dumpTree ( bool recall ) {
// . this doesn't work if you're doing an unordered dump, but we should
// not allow adds when closing
m_lastKeyInQueue = m_list->getLastKey();

// ensure we are getting the first key of the list
m_list->resetListPtr();

//m_firstKeyInQueue = m_list->getCurrentKey();
m_list->getCurrentKey(m_firstKeyInQueue);
// . write this list to disk
Expand Down
6 changes: 5 additions & 1 deletion RdbList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,11 @@ bool RdbList::checkList_r ( bool removeNegRecs , bool sleepOnProblem ,
if ( data &&
(*(int32_t *)data < 0 ||
*(int32_t *)data > 100000000 ) ) {
char *xx = NULL; *xx = 0; }
log("rdblist: bad titlerec data for docid "
"%"INT64,
g_titledb.getDocIdFromKey((key_t *)k));
char *xx = NULL; *xx = 0;
}
}
// tagrec?
if ( rdbId == RDB_TAGDB && ! KEYNEG(k) ) {
Expand Down
7 changes: 4 additions & 3 deletions RdbTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,18 +1187,19 @@ bool RdbTree::fixTree ( ) {
// skip if empty
if ( m_parents[i] <= -2 ) continue;


char *key = &m_keys[i*m_ks];
if ( isTitledb && m_data[i] ) {
char *data = m_data[i];
int32_t ucompSize = *(int32_t *)data;
if ( ucompSize < 0 || ucompSize > 100000000 ) {
log("db: removing titlerec with uncompressed "
"size of %i from tree",(int)ucompSize);
"size of %i from tree (docid=%"INT64"",
(int)ucompSize,
g_titledb.getDocIdFromKey((key_t *)key));
continue;
}
}

char *key = &m_keys[i*m_ks];
if ( isSpiderdb && m_data[i] &&
g_spiderdb.isSpiderRequest ( (SPIDERDBKEY *)key ) ) {
char *data = m_data[i];
Expand Down
5 changes: 5 additions & 0 deletions XmlDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4659,6 +4659,11 @@ int32_t *XmlDoc::getIndexCode2 ( ) {
if ( *ch32 == od->m_contentHash32 ) {
m_indexCode = EDOCUNCHANGED;
m_indexCodeValid = true;
// hack these values on or off.
// really should be function calls.
// but it never gets set when it should if the
// doc is unchanged.
m_sentToDiffbot = od->m_sentToDiffbot;
return &m_indexCode;
}
}
Expand Down

0 comments on commit 7396e57

Please sign in to comment.