diff options
Diffstat (limited to 'src/mongo/db/catalog/collection.cpp')
-rw-r--r-- | src/mongo/db/catalog/collection.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp index 6e5f5a5306b..6730670e60c 100644 --- a/src/mongo/db/catalog/collection.cpp +++ b/src/mongo/db/catalog/collection.cpp @@ -474,15 +474,12 @@ Status Collection::aboutToDeleteCapped(OperationContext* txn, _cursorManager.invalidateDocument(txn, loc, INVALIDATION_DELETION); BSONObj doc = data.releaseToBson(); - _indexCatalog.unindexRecord(txn, doc, loc, false); + _indexCatalog.unindexRecord(txn, doc, loc); return Status::OK(); } -void Collection::deleteDocument(OperationContext* txn, - const RecordId& loc, - bool fromMigrate, - bool noWarn) { +void Collection::deleteDocument(OperationContext* txn, const RecordId& loc, bool fromMigrate) { if (isCapped()) { log() << "failing remove on a capped ns " << _ns << endl; uasserted(10089, "cannot remove from a capped collection"); @@ -497,7 +494,7 @@ void Collection::deleteDocument(OperationContext* txn, /* check if any cursors point to us. if so, advance them. */ _cursorManager.invalidateDocument(txn, loc, INVALIDATION_DELETION); - _indexCatalog.unindexRecord(txn, doc.value(), loc, noWarn); + _indexCatalog.unindexRecord(txn, doc.value(), loc); _recordStore->deleteRecord(txn, loc); @@ -573,9 +570,7 @@ StatusWith<RecordId> Collection::updateDocument(OperationContext* txn, IndexCatalogEntry* entry = ii.catalogEntry(descriptor); IndexAccessMethod* iam = ii.accessMethod(descriptor); - InsertDeleteOptions options; - options.logIfError = false; - options.dupsAllowed = + bool dupsAllowed = !(KeyPattern::isIdKeyPattern(descriptor->keyPattern()) || descriptor->unique()) || repl::getGlobalReplicationCoordinator()->shouldIgnoreUniqueIndex(descriptor); UpdateTicket* updateTicket = new UpdateTicket(); @@ -584,7 +579,7 @@ StatusWith<RecordId> Collection::updateDocument(OperationContext* txn, oldDoc.value(), newDoc, oldLocation, - options, + dupsAllowed, updateTicket, entry->getFilterExpression()); if (!ret.isOK()) { @@ -658,7 +653,7 @@ Status Collection::recordStoreGoingToMove(OperationContext* txn, size_t oldSize) { moveCounter.increment(); _cursorManager.invalidateDocument(txn, oldLocation, INVALIDATION_DELETION); - _indexCatalog.unindexRecord(txn, BSONObj(oldBuffer), oldLocation, true); + _indexCatalog.unindexRecord(txn, BSONObj(oldBuffer), oldLocation); return Status::OK(); } |