Skip to content

Commit

Permalink
SERVER-13912 Better write intents for RSV1Base::deleteRecord
Browse files Browse the repository at this point in the history
Only declare intent to write to areas we actually write to, rather than the
entire Extent header. Most of the time (ie unless deleting the first or last
record) no write intents should be declared.
  • Loading branch information
RedBeard0531 committed May 16, 2014
1 parent babe3e3 commit 7b1fc98
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mongo/db/structure/record_store_v1_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,16 @@ namespace mongo {

/* remove ourself from extent pointers */
{
Extent *e = txn->recoveryUnit()->writing( _getExtent( _getExtentLocForRecord( dl ) ) );
Extent *e = _getExtent( todelete->myExtentLoc(dl) );
if ( e->firstRecord == dl ) {
txn->recoveryUnit()->writing(&e->firstRecord);
if ( todelete->nextOfs() == DiskLoc::NullOfs )
e->firstRecord.Null();
else
e->firstRecord.set(dl.a(), todelete->nextOfs() );
}
if ( e->lastRecord == dl ) {
txn->recoveryUnit()->writing(&e->lastRecord);
if ( todelete->prevOfs() == DiskLoc::NullOfs )
e->lastRecord.Null();
else
Expand Down

0 comments on commit 7b1fc98

Please sign in to comment.