0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

roll back bad bug commited couple hours ago

This commit is contained in:
Dwight 2008-07-16 17:21:47 -04:00
parent 4bfd28fa48
commit 7d5c131193
3 changed files with 12 additions and 20 deletions

View File

@ -113,7 +113,12 @@ void BucketBasics::assertValid(bool force) {
break;
}
else if( z == 0 ) {
wassert( k(i).recordLoc < k(i+1).recordLoc );
if( !(k(i).recordLoc < k(i+1).recordLoc) ) {
cout << "ERROR: btree key order corrupt (recordloc's wrong). Keys:" << endl;
cout << " k(" << i << "):" << keyNode(i).key.toString() << " RL:" << k(i).recordLoc.toString() << endl;
cout << " k(" << i+1 << "):" << keyNode(i+1).key.toString() << " RL:" << k(i+1).recordLoc.toString() << endl;
wassert( k(i).recordLoc < k(i+1).recordLoc );
}
}
}
}

View File

@ -18,16 +18,14 @@ struct _KeyNode {
void setKeyDataOfs(short s) { _kdo = s; assert(s>=0); }
void setKeyDataOfsSavingUse(short s) { _kdo = s; assert(s>=0); }
void setUnused() {
/* setting ofs to 1 is the sentinel. setInvalid sets the
fileno, that is defensive code.
/* Setting ofs to odd is the sentinel for unused, as real recordLoc's are always
even numbers.
Note we need to keep its value basically the same as we use the recordLoc
as part of the key in the index (to handle duplicate keys efficiently).
*/
recordLoc.setInvalid();
recordLoc.GETOFS() = 1;
recordLoc.GETOFS() |= 1;
}
/* & 1 for backward compatibility. can be made "== 1" later when we increment
the db data version
*/
int isUnused() { return (recordLoc.getOfs() & 1); }
int isUnused() { return recordLoc.getOfs() & 1; }
int isUsed() { return !isUnused(); }
};

View File

@ -757,17 +757,6 @@ void DataFileMgr::deleteRecord(const char *ns, Record *todelete, const DiskLoc&
{
d->nrecords--;
d->datasize -= todelete->netLength();
/// DEBUGGING << "temp: dddelrec deleterecord " << ns << endl;
// if( todelete->extentOfs == 0xaca500 ) {
// cout << "break\n";
// }
/*
TEMP: add deleted rec 0:aca5b0 aca500
temp: adddelrec deleterecord admin.blog.posts
TEMP: add deleted rec 0:b9e750 b6a500
temp: adddelrec deleterecord admin.blog.posts
*/
d->addDeletedRec((DeletedRecord*)todelete, dl);
}
}