diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp | 13 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp index 85048dc5552..6a33378a070 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -1281,7 +1281,7 @@ Status WiredTigerRecordStore::_insertRecords(OperationContext* txn, } else if (_isCapped) { stdx::lock_guard<stdx::mutex> lk(_uncommittedRecordIdsMutex); record.id = _nextId(); - _addUncommitedRecordId_inlock(txn, record.id); + _addUncommittedRecordId_inlock(txn, record.id); } else { record.id = _nextId(); } @@ -1329,7 +1329,7 @@ StatusWith<RecordId> WiredTigerRecordStore::insertRecord(OperationContext* txn, } void WiredTigerRecordStore::_dealtWithCappedId(SortedRecordIds::iterator it, bool didCommit) { - invariant(&(*it) != NULL); + invariant(it->isNormal()); stdx::lock_guard<stdx::mutex> lk(_uncommittedRecordIdsMutex); if (didCommit && _isOplog && *it != _oplog_highestSeen) { // Defer removal from _uncommittedRecordIds until it is durable. We don't need to wait for @@ -1667,7 +1667,7 @@ Status WiredTigerRecordStore::oplogDiskLocRegister(OperationContext* txn, const return id.getStatus(); stdx::lock_guard<stdx::mutex> lk(_uncommittedRecordIdsMutex); - _addUncommitedRecordId_inlock(txn, id.getValue()); + _addUncommittedRecordId_inlock(txn, id.getValue()); return Status::OK(); } @@ -1746,11 +1746,10 @@ void WiredTigerRecordStore::waitForAllEarlierOplogWritesToBeVisible(OperationCon }); } -void WiredTigerRecordStore::_addUncommitedRecordId_inlock(OperationContext* txn, - const RecordId& id) { - // todo: make this a dassert at some point - // invariant(_uncommittedRecordIds.empty() || _uncommittedRecordIds.back() < id); +void WiredTigerRecordStore::_addUncommittedRecordId_inlock(OperationContext* txn, RecordId id) { + dassert(_uncommittedRecordIds.empty() || _uncommittedRecordIds.back() < id); SortedRecordIds::iterator it = _uncommittedRecordIds.insert(_uncommittedRecordIds.end(), id); + invariant(it->isNormal()); txn->recoveryUnit()->registerChange(new CappedInsertChange(this, it)); _oplog_highestSeen = id; } diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h index 98cd612513d..50360324e75 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h @@ -263,7 +263,7 @@ private: static RecordId _fromKey(int64_t k); void _dealtWithCappedId(SortedRecordIds::iterator it, bool didCommit); - void _addUncommitedRecordId_inlock(OperationContext* txn, const RecordId& id); + void _addUncommittedRecordId_inlock(OperationContext* txn, RecordId id); Status _insertRecords(OperationContext* txn, Record* records, size_t nRecords); |