mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
roll back bad bug commited couple hours ago
This commit is contained in:
parent
4bfd28fa48
commit
7d5c131193
@ -113,10 +113,15 @@ void BucketBasics::assertValid(bool force) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if( z == 0 ) {
|
else if( z == 0 ) {
|
||||||
|
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 );
|
wassert( k(i).recordLoc < k(i+1).recordLoc );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
//faster:
|
//faster:
|
||||||
if( n > 1 ) {
|
if( n > 1 ) {
|
||||||
|
14
db/btree.h
14
db/btree.h
@ -18,16 +18,14 @@ struct _KeyNode {
|
|||||||
void setKeyDataOfs(short s) { _kdo = s; assert(s>=0); }
|
void setKeyDataOfs(short s) { _kdo = s; assert(s>=0); }
|
||||||
void setKeyDataOfsSavingUse(short s) { _kdo = s; assert(s>=0); }
|
void setKeyDataOfsSavingUse(short s) { _kdo = s; assert(s>=0); }
|
||||||
void setUnused() {
|
void setUnused() {
|
||||||
/* setting ofs to 1 is the sentinel. setInvalid sets the
|
/* Setting ofs to odd is the sentinel for unused, as real recordLoc's are always
|
||||||
fileno, that is defensive code.
|
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
|
int isUnused() { return recordLoc.getOfs() & 1; }
|
||||||
the db data version
|
|
||||||
*/
|
|
||||||
int isUnused() { return (recordLoc.getOfs() & 1); }
|
|
||||||
int isUsed() { return !isUnused(); }
|
int isUsed() { return !isUnused(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -757,17 +757,6 @@ void DataFileMgr::deleteRecord(const char *ns, Record *todelete, const DiskLoc&
|
|||||||
{
|
{
|
||||||
d->nrecords--;
|
d->nrecords--;
|
||||||
d->datasize -= todelete->netLength();
|
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);
|
d->addDeletedRec((DeletedRecord*)todelete, dl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user