diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-07-10 16:01:21 -0400 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-07-13 19:01:45 -0400 |
commit | 93accf1620db95d4aa7edbd5bbc017264b28e0f2 (patch) | |
tree | fab09fb1f5618338bc0c6a9232d11936e972ed56 /src/mongo/db/storage | |
parent | 77ab40c05f28c6c0afbc84bb72375a9867f79ecb (diff) | |
download | mongo-93accf1620db95d4aa7edbd5bbc017264b28e0f2.tar.gz |
SERVER-35626 remove old MMAP 'enforceQuota' code
Diffstat (limited to 'src/mongo/db/storage')
33 files changed, 132 insertions, 155 deletions
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp index 7f0b16fa26b..bd48a8cfddd 100644 --- a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp +++ b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp @@ -101,8 +101,10 @@ public: virtual void deleteRecord(OperationContext* opCtx, const RecordId& dl) {} - virtual StatusWith<RecordId> insertRecord( - OperationContext* opCtx, const char* data, int len, Timestamp, bool enforceQuota) { + virtual StatusWith<RecordId> insertRecord(OperationContext* opCtx, + const char* data, + int len, + Timestamp) { _numInserts++; return StatusWith<RecordId>(RecordId(6, 4)); } @@ -125,7 +127,6 @@ public: const RecordId& oldLocation, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier) { return Status::OK(); } diff --git a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp index f2ed2f99de2..aa69447703a 100644 --- a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp +++ b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.cpp @@ -397,8 +397,10 @@ StatusWith<RecordId> EphemeralForTestRecordStore::extractAndCheckLocForOplog(con return status; } -StatusWith<RecordId> EphemeralForTestRecordStore::insertRecord( - OperationContext* opCtx, const char* data, int len, Timestamp, bool enforceQuota) { +StatusWith<RecordId> EphemeralForTestRecordStore::insertRecord(OperationContext* opCtx, + const char* data, + int len, + Timestamp) { if (_isCapped && len > _cappedMaxSize) { // We use dataSize for capped rollover and we don't want to delete everything if we know // this won't fit. @@ -473,7 +475,6 @@ Status EphemeralForTestRecordStore::updateRecord(OperationContext* opCtx, const RecordId& loc, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier) { stdx::lock_guard<stdx::recursive_mutex> lock(_data->recordsMutex); EphemeralForTestRecord* oldRecord = recordFor(loc); @@ -620,9 +621,7 @@ Status EphemeralForTestRecordStore::touch(OperationContext* opCtx, BSONObjBuilde return Status::OK(); } -void EphemeralForTestRecordStore::increaseStorageSize(OperationContext* opCtx, - int size, - bool enforceQuota) { +void EphemeralForTestRecordStore::increaseStorageSize(OperationContext* opCtx, int size) { // unclear what this would mean for this class. For now, just error if called. invariant(!"increaseStorageSize not yet implemented"); } diff --git a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.h b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.h index 5e0d7ba1e5a..1b39400cc51 100644 --- a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.h +++ b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.h @@ -66,8 +66,10 @@ public: virtual void deleteRecord(OperationContext* opCtx, const RecordId& dl); - virtual StatusWith<RecordId> insertRecord( - OperationContext* opCtx, const char* data, int len, Timestamp, bool enforceQuota); + virtual StatusWith<RecordId> insertRecord(OperationContext* opCtx, + const char* data, + int len, + Timestamp); virtual Status insertRecordsWithDocWriter(OperationContext* opCtx, const DocWriter* const* docs, @@ -79,7 +81,6 @@ public: const RecordId& oldLocation, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier); virtual bool updateWithDamagesSupported() const; @@ -109,7 +110,7 @@ public: virtual Status touch(OperationContext* opCtx, BSONObjBuilder* output) const; - virtual void increaseStorageSize(OperationContext* opCtx, int size, bool enforceQuota); + virtual void increaseStorageSize(OperationContext* opCtx, int size); virtual int64_t storageSize(OperationContext* opCtx, BSONObjBuilder* extraInfo = NULL, diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp index 283b0090a7e..89ad94b6544 100644 --- a/src/mongo/db/storage/kv/kv_catalog.cpp +++ b/src/mongo/db/storage/kv/kv_catalog.cpp @@ -306,17 +306,14 @@ void KVCatalog::FeatureTracker::putInfo(OperationContext* opCtx, const FeatureBi if (_rid.isNull()) { // This is the first time a feature is being marked as in-use or not in-use, so we must // insert the feature document rather than update it. - const bool enforceQuota = false; // TODO SERVER-30638: using timestamp 0 for these inserts - auto rid = _catalog->_rs->insertRecord( - opCtx, obj.objdata(), obj.objsize(), Timestamp(), enforceQuota); + auto rid = _catalog->_rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), Timestamp()); fassert(40113, rid.getStatus()); _rid = rid.getValue(); } else { - const bool enforceQuota = false; UpdateNotifier* notifier = nullptr; - auto status = _catalog->_rs->updateRecord( - opCtx, _rid, obj.objdata(), obj.objsize(), enforceQuota, notifier); + auto status = + _catalog->_rs->updateRecord(opCtx, _rid, obj.objdata(), obj.objsize(), notifier); fassert(40114, status); } } @@ -425,10 +422,8 @@ Status KVCatalog::newCollection(OperationContext* opCtx, b.append("md", md.toBSON()); obj = b.obj(); } - const bool enforceQuota = false; // TODO SERVER-30638: using timestamp 0 for these inserts. - StatusWith<RecordId> res = - _rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), Timestamp(), enforceQuota); + StatusWith<RecordId> res = _rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), Timestamp()); if (!res.isOK()) return res.getStatus(); @@ -524,7 +519,7 @@ void KVCatalog::putMetaData(OperationContext* opCtx, } LOG(3) << "recording new metadata: " << obj; - Status status = _rs->updateRecord(opCtx, loc, obj.objdata(), obj.objsize(), false, NULL); + Status status = _rs->updateRecord(opCtx, loc, obj.objdata(), obj.objsize(), NULL); fassert(28521, status.isOK()); } @@ -549,7 +544,7 @@ Status KVCatalog::renameCollection(OperationContext* opCtx, b.appendElementsUnique(old); BSONObj obj = b.obj(); - Status status = _rs->updateRecord(opCtx, loc, obj.objdata(), obj.objsize(), false, NULL); + Status status = _rs->updateRecord(opCtx, loc, obj.objdata(), obj.objsize(), NULL); fassert(28522, status.isOK()); } diff --git a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp index e0eebfaa73d..6b9b671fd37 100644 --- a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp +++ b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp @@ -75,7 +75,7 @@ TEST(KVEngineTestHarness, SimpleRS1) { { MyOperationContext opCtx(engine); WriteUnitOfWork uow(&opCtx); - StatusWith<RecordId> res = rs->insertRecord(&opCtx, "abc", 4, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(&opCtx, "abc", 4, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -115,7 +115,7 @@ TEST(KVEngineTestHarness, Restart1) { { MyOperationContext opCtx(engine); WriteUnitOfWork uow(&opCtx); - StatusWith<RecordId> res = rs->insertRecord(&opCtx, "abc", 4, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(&opCtx, "abc", 4, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/kv/kv_engine_test_timestamps.cpp b/src/mongo/db/storage/kv/kv_engine_test_timestamps.cpp index d2c24f3b44e..90c51d942c8 100644 --- a/src/mongo/db/storage/kv/kv_engine_test_timestamps.cpp +++ b/src/mongo/db/storage/kv/kv_engine_test_timestamps.cpp @@ -101,7 +101,7 @@ public: } RecordId insertRecord(OperationContext* opCtx, std::string contents = "abcd") { - auto id = rs->insertRecord(opCtx, contents.c_str(), contents.length() + 1, _counter, false); + auto id = rs->insertRecord(opCtx, contents.c_str(), contents.length() + 1, _counter); ASSERT_OK(id); return id.getValue(); } @@ -118,8 +118,7 @@ public: auto op = makeOperation(); WriteUnitOfWork wuow(op); ASSERT_OK(op->recoveryUnit()->setTimestamp(_counter)); - ASSERT_OK( - rs->updateRecord(op, id, contents.c_str(), contents.length() + 1, false, nullptr)); + ASSERT_OK(rs->updateRecord(op, id, contents.c_str(), contents.length() + 1, nullptr)); wuow.commit(); } diff --git a/src/mongo/db/storage/mobile/mobile_record_store.cpp b/src/mongo/db/storage/mobile/mobile_record_store.cpp index 4e62e87b29b..2e1aed4c5e2 100644 --- a/src/mongo/db/storage/mobile/mobile_record_store.cpp +++ b/src/mongo/db/storage/mobile/mobile_record_store.cpp @@ -291,8 +291,10 @@ void MobileRecordStore::deleteRecord(OperationContext* opCtx, const RecordId& re deleteStmt.step(SQLITE_DONE); } -StatusWith<RecordId> MobileRecordStore::insertRecord( - OperationContext* opCtx, const char* data, int len, Timestamp, bool enforceQuota) { +StatusWith<RecordId> MobileRecordStore::insertRecord(OperationContext* opCtx, + const char* data, + int len, + Timestamp) { // Inserts record into SQLite table (or replaces if duplicate record id). MobileSession* session = MobileRecoveryUnit::get(opCtx)->getSession(opCtx, false); @@ -326,7 +328,7 @@ Status MobileRecordStore::insertRecordsWithDocWriter(OperationContext* opCtx, for (size_t i = 0; i < nDocs; i++) { docs[i]->writeDocument(pos); size_t docLen = docs[i]->documentSize(); - StatusWith<RecordId> res = insertRecord(opCtx, pos, docLen, timestamps[i], true); + StatusWith<RecordId> res = insertRecord(opCtx, pos, docLen, timestamps[i]); idsOut[i] = res.getValue(); pos += docLen; } @@ -338,7 +340,6 @@ Status MobileRecordStore::updateRecord(OperationContext* opCtx, const RecordId& recId, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier) { MobileSession* session = MobileRecoveryUnit::get(opCtx)->getSession(opCtx, false); std::string dataSizeQuery = diff --git a/src/mongo/db/storage/mobile/mobile_record_store.h b/src/mongo/db/storage/mobile/mobile_record_store.h index d0771f0317a..ec8ab13aa2e 100644 --- a/src/mongo/db/storage/mobile/mobile_record_store.h +++ b/src/mongo/db/storage/mobile/mobile_record_store.h @@ -63,8 +63,7 @@ public: StatusWith<RecordId> insertRecord(OperationContext* opCtx, const char* data, int len, - Timestamp timestamp, - bool enforceQuota) override; + Timestamp timestamp) override; Status insertRecordsWithDocWriter(OperationContext* opCtx, const DocWriter* const* docs, @@ -76,7 +75,6 @@ public: const RecordId& oldLocation, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier) override; bool updateWithDamagesSupported() const override; diff --git a/src/mongo/db/storage/record_store.h b/src/mongo/db/storage/record_store.h index e09ef89980b..32f7b41cf7b 100644 --- a/src/mongo/db/storage/record_store.h +++ b/src/mongo/db/storage/record_store.h @@ -372,20 +372,15 @@ public: virtual StatusWith<RecordId> insertRecord(OperationContext* opCtx, const char* data, int len, - Timestamp timestamp, - bool enforceQuota) = 0; + Timestamp timestamp) = 0; virtual Status insertRecords(OperationContext* opCtx, std::vector<Record>* records, - std::vector<Timestamp>* timestamps, - bool enforceQuota) { + std::vector<Timestamp>* timestamps) { int index = 0; for (auto& record : *records) { - StatusWith<RecordId> res = insertRecord(opCtx, - record.data.data(), - record.data.size(), - (*timestamps)[index++], - enforceQuota); + StatusWith<RecordId> res = + insertRecord(opCtx, record.data.data(), record.data.size(), (*timestamps)[index++]); if (!res.isOK()) return res.getStatus(); @@ -431,7 +426,6 @@ public: const RecordId& oldLocation, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier) = 0; /** diff --git a/src/mongo/db/storage/record_store_test_capped_visibility.cpp b/src/mongo/db/storage/record_store_test_capped_visibility.cpp index 6b778dd2dce..e66544ce0c4 100644 --- a/src/mongo/db/storage/record_store_test_capped_visibility.cpp +++ b/src/mongo/db/storage/record_store_test_capped_visibility.cpp @@ -42,7 +42,7 @@ namespace { RecordId doInsert(unowned_ptr<OperationContext> opCtx, unowned_ptr<RecordStore> rs) { static char zeros[16]; - return uassertStatusOK(rs->insertRecord(opCtx, zeros, sizeof(zeros), Timestamp(), false)); + return uassertStatusOK(rs->insertRecord(opCtx, zeros, sizeof(zeros), Timestamp())); } // macro to keep assert line numbers correct. diff --git a/src/mongo/db/storage/record_store_test_datafor.cpp b/src/mongo/db/storage/record_store_test_datafor.cpp index 672fa03e017..07f94f9ed9f 100644 --- a/src/mongo/db/storage/record_store_test_datafor.cpp +++ b/src/mongo/db/storage/record_store_test_datafor.cpp @@ -63,7 +63,7 @@ TEST(RecordStoreTestHarness, DataFor) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -107,7 +107,7 @@ TEST(RecordStoreTestHarness, DataForMultiple) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_datasize.cpp b/src/mongo/db/storage/record_store_test_datasize.cpp index 3dad519623b..b57cebf06bd 100644 --- a/src/mongo/db/storage/record_store_test_datasize.cpp +++ b/src/mongo/db/storage/record_store_test_datasize.cpp @@ -80,7 +80,7 @@ TEST(RecordStoreTestHarness, DataSizeNonEmpty) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } diff --git a/src/mongo/db/storage/record_store_test_deleterecord.cpp b/src/mongo/db/storage/record_store_test_deleterecord.cpp index 0d630c0d0be..90d8f274c86 100644 --- a/src/mongo/db/storage/record_store_test_deleterecord.cpp +++ b/src/mongo/db/storage/record_store_test_deleterecord.cpp @@ -63,7 +63,7 @@ TEST(RecordStoreTestHarness, DeleteRecord) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -111,7 +111,7 @@ TEST(RecordStoreTestHarness, DeleteMultipleRecords) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_harness.cpp b/src/mongo/db/storage/record_store_test_harness.cpp index 2287e03052c..4ee95575612 100644 --- a/src/mongo/db/storage/record_store_test_harness.cpp +++ b/src/mongo/db/storage/record_store_test_harness.cpp @@ -60,7 +60,7 @@ TEST(RecordStoreTestHarness, Simple1) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc1 = res.getValue(); uow.commit(); @@ -87,7 +87,7 @@ TEST(RecordStoreTestHarness, Simple1) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } @@ -160,7 +160,7 @@ TEST(RecordStoreTestHarness, Delete1) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -205,9 +205,9 @@ TEST(RecordStoreTestHarness, Delete2) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); - res = rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp(), false); + res = rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -248,7 +248,7 @@ TEST(RecordStoreTestHarness, Update1) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), s1.c_str(), s1.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), s1.c_str(), s1.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -264,8 +264,7 @@ TEST(RecordStoreTestHarness, Update1) { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); - Status status = - rs->updateRecord(opCtx.get(), loc, s2.c_str(), s2.size() + 1, false, NULL); + Status status = rs->updateRecord(opCtx.get(), loc, s2.c_str(), s2.size() + 1, NULL); ASSERT_OK(status); uow.commit(); @@ -296,7 +295,7 @@ TEST(RecordStoreTestHarness, UpdateInPlace1) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), s1Rec.data(), s1Rec.size(), Timestamp(), false); + rs->insertRecord(opCtx.get(), s1Rec.data(), s1Rec.size(), Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -350,7 +349,7 @@ TEST(RecordStoreTestHarness, Truncate1) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -400,7 +399,7 @@ TEST(RecordStoreTestHarness, Cursor1) { WriteUnitOfWork uow(opCtx.get()); for (int i = 0; i < N; i++) { string s = str::stream() << "eliot" << i; - ASSERT_OK(rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp(), false) + ASSERT_OK(rs->insertRecord(opCtx.get(), s.c_str(), s.size() + 1, Timestamp()) .getStatus()); } uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_insertrecord.cpp b/src/mongo/db/storage/record_store_test_insertrecord.cpp index adcf2fc2300..0cef303a730 100644 --- a/src/mongo/db/storage/record_store_test_insertrecord.cpp +++ b/src/mongo/db/storage/record_store_test_insertrecord.cpp @@ -61,7 +61,7 @@ TEST(RecordStoreTestHarness, InsertRecord) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -96,7 +96,7 @@ TEST(RecordStoreTestHarness, InsertMultipleRecords) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_manyiter.cpp b/src/mongo/db/storage/record_store_test_manyiter.cpp index 5b477f0d27a..2080f1ca073 100644 --- a/src/mongo/db/storage/record_store_test_manyiter.cpp +++ b/src/mongo/db/storage/record_store_test_manyiter.cpp @@ -87,7 +87,7 @@ TEST(RecordStoreTestHarness, GetManyIteratorsNonEmpty) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_randomiter.cpp b/src/mongo/db/storage/record_store_test_randomiter.cpp index 0644b07a83b..3cdeec17f2d 100644 --- a/src/mongo/db/storage/record_store_test_randomiter.cpp +++ b/src/mongo/db/storage/record_store_test_randomiter.cpp @@ -87,7 +87,7 @@ TEST(RecordStoreTestHarness, GetRandomIteratorNonEmpty) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); uow.commit(); @@ -141,8 +141,7 @@ TEST(RecordStoreTestHarness, GetRandomIteratorSingleton) { { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), "some data", 10, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "some data", 10, Timestamp()); ASSERT_OK(res.getStatus()); idToRetrieve = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_recorditer.cpp b/src/mongo/db/storage/record_store_test_recorditer.cpp index 37f6d284258..968dfbcb760 100644 --- a/src/mongo/db/storage/record_store_test_recorditer.cpp +++ b/src/mongo/db/storage/record_store_test_recorditer.cpp @@ -71,7 +71,7 @@ TEST(RecordStoreTestHarness, IterateOverMultipleRecords) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); datas[i] = data; @@ -122,7 +122,7 @@ TEST(RecordStoreTestHarness, IterateOverMultipleRecordsReversed) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); datas[i] = data; @@ -173,7 +173,7 @@ TEST(RecordStoreTestHarness, IterateStartFromMiddle) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); datas[i] = data; @@ -225,7 +225,7 @@ TEST(RecordStoreTestHarness, IterateStartFromMiddleReversed) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); datas[i] = data; @@ -278,7 +278,7 @@ TEST(RecordStoreTestHarness, RecordIteratorEOF) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); datas[i] = data; @@ -315,7 +315,7 @@ TEST(RecordStoreTestHarness, RecordIteratorEOF) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); @@ -349,7 +349,7 @@ TEST(RecordStoreTestHarness, RecordIteratorSaveRestore) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); datas[i] = data; @@ -406,7 +406,7 @@ TEST(RecordStoreTestHarness, SeekAfterEofAndContinue) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); datas[i] = data; diff --git a/src/mongo/db/storage/record_store_test_repairiter.cpp b/src/mongo/db/storage/record_store_test_repairiter.cpp index f5397012cf8..a84e7dcab4d 100644 --- a/src/mongo/db/storage/record_store_test_repairiter.cpp +++ b/src/mongo/db/storage/record_store_test_repairiter.cpp @@ -89,7 +89,7 @@ TEST(RecordStoreTestHarness, GetIteratorForRepairNonEmpty) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); uow.commit(); @@ -136,8 +136,7 @@ TEST(RecordStoreTestHarness, GetIteratorForRepairInvalidateSingleton) { { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), "some data", 10, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "some data", 10, Timestamp()); ASSERT_OK(res.getStatus()); idToInvalidate = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_storagesize.cpp b/src/mongo/db/storage/record_store_test_storagesize.cpp index 521d879cfac..c5bd0bcf7cc 100644 --- a/src/mongo/db/storage/record_store_test_storagesize.cpp +++ b/src/mongo/db/storage/record_store_test_storagesize.cpp @@ -63,7 +63,7 @@ TEST(RecordStoreTestHarness, StorageSizeNonEmpty) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } diff --git a/src/mongo/db/storage/record_store_test_touch.cpp b/src/mongo/db/storage/record_store_test_touch.cpp index eae3e0046b0..dfd541250bb 100644 --- a/src/mongo/db/storage/record_store_test_touch.cpp +++ b/src/mongo/db/storage/record_store_test_touch.cpp @@ -85,7 +85,7 @@ TEST(RecordStoreTestHarness, TouchNonEmpty) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } @@ -149,7 +149,7 @@ TEST(RecordStoreTestHarness, TouchNonEmptyWithNullStats) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } diff --git a/src/mongo/db/storage/record_store_test_truncate.cpp b/src/mongo/db/storage/record_store_test_truncate.cpp index 7fda629b4f9..aac72c5caf8 100644 --- a/src/mongo/db/storage/record_store_test_truncate.cpp +++ b/src/mongo/db/storage/record_store_test_truncate.cpp @@ -89,7 +89,7 @@ TEST(RecordStoreTestHarness, TruncateNonEmpty) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } diff --git a/src/mongo/db/storage/record_store_test_updaterecord.cpp b/src/mongo/db/storage/record_store_test_updaterecord.cpp index f9c9e33c375..c6b96def16d 100644 --- a/src/mongo/db/storage/record_store_test_updaterecord.cpp +++ b/src/mongo/db/storage/record_store_test_updaterecord.cpp @@ -63,7 +63,7 @@ TEST(RecordStoreTestHarness, UpdateRecord) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -80,8 +80,7 @@ TEST(RecordStoreTestHarness, UpdateRecord) { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); - Status res = - rs->updateRecord(opCtx.get(), loc, data.c_str(), data.size() + 1, false, NULL); + Status res = rs->updateRecord(opCtx.get(), loc, data.c_str(), data.size() + 1, NULL); ASSERT_OK(res); uow.commit(); @@ -119,7 +118,7 @@ TEST(RecordStoreTestHarness, UpdateMultipleRecords) { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); locs[i] = res.getValue(); uow.commit(); @@ -140,7 +139,7 @@ TEST(RecordStoreTestHarness, UpdateMultipleRecords) { WriteUnitOfWork uow(opCtx.get()); Status res = - rs->updateRecord(opCtx.get(), locs[i], data.c_str(), data.size() + 1, false, NULL); + rs->updateRecord(opCtx.get(), locs[i], data.c_str(), data.size() + 1, NULL); ASSERT_OK(res); uow.commit(); @@ -177,8 +176,8 @@ TEST(RecordStoreTestHarness, UpdateRecordWithMoveNotifier) { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord( - opCtx.get(), oldData.c_str(), oldData.size() + 1, Timestamp(), false); + StatusWith<RecordId> res = + rs->insertRecord(opCtx.get(), oldData.c_str(), oldData.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -197,8 +196,8 @@ TEST(RecordStoreTestHarness, UpdateRecordWithMoveNotifier) { UpdateNotifierSpy umn(opCtx.get(), loc, oldData.c_str(), oldData.size()); WriteUnitOfWork uow(opCtx.get()); - Status res = rs->updateRecord( - opCtx.get(), loc, newData.c_str(), newData.size() + 1, false, &umn); + Status res = + rs->updateRecord(opCtx.get(), loc, newData.c_str(), newData.size() + 1, &umn); ASSERT_OK(res); ASSERT_GTE(1, umn.numInPlaceCallbacks()); diff --git a/src/mongo/db/storage/record_store_test_updatewithdamages.cpp b/src/mongo/db/storage/record_store_test_updatewithdamages.cpp index 2e839f28421..106d8f6e17c 100644 --- a/src/mongo/db/storage/record_store_test_updatewithdamages.cpp +++ b/src/mongo/db/storage/record_store_test_updatewithdamages.cpp @@ -65,7 +65,7 @@ TEST(RecordStoreTestHarness, UpdateWithDamages) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp(), false); + rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -131,7 +131,7 @@ TEST(RecordStoreTestHarness, UpdateWithOverlappingDamageEvents) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp(), false); + rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -195,7 +195,7 @@ TEST(RecordStoreTestHarness, UpdateWithOverlappingDamageEventsReversed) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp(), false); + rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); @@ -257,7 +257,7 @@ TEST(RecordStoreTestHarness, UpdateWithNoDamages) { { WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp(), false); + rs->insertRecord(opCtx.get(), rec.data(), rec.size(), Timestamp()); ASSERT_OK(res.getStatus()); loc = res.getValue(); uow.commit(); diff --git a/src/mongo/db/storage/record_store_test_validate.h b/src/mongo/db/storage/record_store_test_validate.h index 7edc8e152ec..4cecc65bf56 100644 --- a/src/mongo/db/storage/record_store_test_validate.h +++ b/src/mongo/db/storage/record_store_test_validate.h @@ -96,8 +96,8 @@ public: ASSERT(_remain.insert(data).second); WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = _rs->insertRecord( - opCtx.get(), data.c_str(), data.size() + 1, Timestamp(), false); + StatusWith<RecordId> res = + _rs->insertRecord(opCtx.get(), data.c_str(), data.size() + 1, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } diff --git a/src/mongo/db/storage/recovery_unit_test_harness.cpp b/src/mongo/db/storage/recovery_unit_test_harness.cpp index 1ec45a1f929..a5e4f210c75 100644 --- a/src/mongo/db/storage/recovery_unit_test_harness.cpp +++ b/src/mongo/db/storage/recovery_unit_test_harness.cpp @@ -53,7 +53,7 @@ public: TEST_F(RecoveryUnitTestHarness, CommitUnitOfWork) { const auto rs = harnessHelper->createRecordStore(opCtx.get(), "table1"); ru->beginUnitOfWork(opCtx.get()); - StatusWith<RecordId> s = rs->insertRecord(opCtx.get(), "data", 4, Timestamp(), false); + StatusWith<RecordId> s = rs->insertRecord(opCtx.get(), "data", 4, Timestamp()); ASSERT_TRUE(s.isOK()); ASSERT_EQUALS(1, rs->numRecords(NULL)); ru->commitUnitOfWork(); @@ -64,7 +64,7 @@ TEST_F(RecoveryUnitTestHarness, CommitUnitOfWork) { TEST_F(RecoveryUnitTestHarness, AbortUnitOfWork) { const auto rs = harnessHelper->createRecordStore(opCtx.get(), "table1"); ru->beginUnitOfWork(opCtx.get()); - StatusWith<RecordId> s = rs->insertRecord(opCtx.get(), "data", 4, Timestamp(), false); + StatusWith<RecordId> s = rs->insertRecord(opCtx.get(), "data", 4, Timestamp()); ASSERT_TRUE(s.isOK()); ASSERT_EQUALS(1, rs->numRecords(NULL)); ru->abortUnitOfWork(); diff --git a/src/mongo/db/storage/wiredtiger/record_store_test_oplog.cpp b/src/mongo/db/storage/wiredtiger/record_store_test_oplog.cpp index d85d6e35e16..73e84d06f05 100644 --- a/src/mongo/db/storage/wiredtiger/record_store_test_oplog.cpp +++ b/src/mongo/db/storage/wiredtiger/record_store_test_oplog.cpp @@ -44,8 +44,7 @@ StatusWith<RecordId> insertBSON(ServiceContext::UniqueOperationContext& opCtx, Status status = rs->oplogDiskLocRegister(opCtx.get(), opTime, false); if (!status.isOK()) return StatusWith<RecordId>(status); - StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), opTime, false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), opTime); if (res.isOK()) wuow.commit(); return res; @@ -58,7 +57,7 @@ RecordId _oplogOrderInsertOplog(OperationContext* opCtx, Status status = rs->oplogDiskLocRegister(opCtx, opTime, false); ASSERT_OK(status); BSONObj obj = BSON("ts" << opTime); - StatusWith<RecordId> res = rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), opTime, false); + StatusWith<RecordId> res = rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), opTime); ASSERT_OK(res.getStatus()); return res.getValue(); } @@ -79,19 +78,17 @@ TEST(RecordStore_Oplog, OplogHack) { { WriteUnitOfWork wuow(opCtx.get()); BSONObj obj = BSON("not_ts" << Timestamp(2, 1)); - ASSERT_EQ( - rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), Timestamp(2, 1), false) - .getStatus(), - ErrorCodes::BadValue); + ASSERT_EQ(rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), Timestamp(2, 1)) + .getStatus(), + ErrorCodes::BadValue); } { WriteUnitOfWork wuow(opCtx.get()); BSONObj obj = BSON("ts" << "not a Timestamp"); - ASSERT_EQ( - rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), Timestamp(), false) - .getStatus(), - ErrorCodes::BadValue); + ASSERT_EQ(rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), Timestamp()) + .getStatus(), + ErrorCodes::BadValue); } ASSERT_EQ(insertBSON(opCtx, rs, Timestamp(-2, 1)).getStatus(), ErrorCodes::BadValue); @@ -167,9 +164,8 @@ TEST(RecordStore_Oplog, OplogHackOnNonOplog) { BSONObj obj = BSON("ts" << Timestamp(2, -1)); { WriteUnitOfWork wuow(opCtx.get()); - ASSERT_OK( - rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), Timestamp(2, -1), false) - .getStatus()); + ASSERT_OK(rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), Timestamp(2, -1)) + .getStatus()); wuow.commit(); } ASSERT_EQ(rs->oplogStartHack(opCtx.get(), RecordId(0, 1)), boost::none); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_record_store_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_record_store_test.cpp index f9d431af36a..c205e361415 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_record_store_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_record_store_test.cpp @@ -213,7 +213,7 @@ TEST(WiredTigerRecordStoreTest, PrefixedTableScan) { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); for (int num = 0; num < numDocs; ++num) { WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } @@ -239,7 +239,7 @@ TEST(WiredTigerRecordStoreTest, PrefixedSeekingCursor) { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); for (int num = 0; num < numDocs; ++num) { WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); if (startRecordId.isNull()) { startRecordId = res.getValue(); } diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp index 19acc2dbc6d..ab92b1935bd 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -1239,8 +1239,7 @@ void WiredTigerRecordStore::reclaimOplog(OperationContext* opCtx, Timestamp pers Status WiredTigerRecordStore::insertRecords(OperationContext* opCtx, std::vector<Record>* records, - std::vector<Timestamp>* timestamps, - bool enforceQuota) { + std::vector<Timestamp>* timestamps) { return _insertRecords(opCtx, records->data(), timestamps->data(), records->size()); } @@ -1324,8 +1323,10 @@ Status WiredTigerRecordStore::_insertRecords(OperationContext* opCtx, return Status::OK(); } -StatusWith<RecordId> WiredTigerRecordStore::insertRecord( - OperationContext* opCtx, const char* data, int len, Timestamp timestamp, bool enforceQuota) { +StatusWith<RecordId> WiredTigerRecordStore::insertRecord(OperationContext* opCtx, + const char* data, + int len, + Timestamp timestamp) { Record record = {RecordId(), RecordData(data, len)}; Status status = _insertRecords(opCtx, &record, ×tamp, 1); if (!status.isOK()) @@ -1399,7 +1400,6 @@ Status WiredTigerRecordStore::updateRecord(OperationContext* opCtx, const RecordId& id, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier) { dassert(opCtx->lockState()->isWriteLocked()); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h index 5ef7017faca..9aa98659c70 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h @@ -143,11 +143,12 @@ public: virtual Status insertRecords(OperationContext* opCtx, std::vector<Record>* records, - std::vector<Timestamp>* timestamps, - bool enforceQuota); + std::vector<Timestamp>* timestamps); - virtual StatusWith<RecordId> insertRecord( - OperationContext* opCtx, const char* data, int len, Timestamp timestamp, bool enforceQuota); + virtual StatusWith<RecordId> insertRecord(OperationContext* opCtx, + const char* data, + int len, + Timestamp timestamp); virtual Status insertRecordsWithDocWriter(OperationContext* opCtx, const DocWriter* const* docs, @@ -159,7 +160,6 @@ public: const RecordId& oldLocation, const char* data, int len, - bool enforceQuota, UpdateNotifier* notifier); virtual bool updateWithDamagesSupported() const; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp index 73841f20e29..28b6efcebaf 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp @@ -113,11 +113,11 @@ TEST(WiredTigerRecordStoreTest, Isolation1) { { WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); id1 = res.getValue(); - res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); id2 = res.getValue(); @@ -136,12 +136,12 @@ TEST(WiredTigerRecordStoreTest, Isolation1) { rs->dataFor(t1.get(), id1); rs->dataFor(t2.get(), id1); - ASSERT_OK(rs->updateRecord(t1.get(), id1, "b", 2, false, NULL)); - ASSERT_OK(rs->updateRecord(t1.get(), id2, "B", 2, false, NULL)); + ASSERT_OK(rs->updateRecord(t1.get(), id1, "b", 2, NULL)); + ASSERT_OK(rs->updateRecord(t1.get(), id2, "B", 2, NULL)); try { // this should fail - rs->updateRecord(t2.get(), id1, "c", 2, false, NULL).transitional_ignore(); + rs->updateRecord(t2.get(), id1, "c", 2, NULL).transitional_ignore(); ASSERT(0); } catch (WriteConflictException&) { w2.reset(NULL); @@ -164,11 +164,11 @@ TEST(WiredTigerRecordStoreTest, Isolation2) { { WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); id1 = res.getValue(); - res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); id2 = res.getValue(); @@ -187,7 +187,7 @@ TEST(WiredTigerRecordStoreTest, Isolation2) { { WriteUnitOfWork w(t1.get()); - ASSERT_OK(rs->updateRecord(t1.get(), id1, "b", 2, false, NULL)); + ASSERT_OK(rs->updateRecord(t1.get(), id1, "b", 2, NULL)); w.commit(); } @@ -196,7 +196,7 @@ TEST(WiredTigerRecordStoreTest, Isolation2) { ASSERT_EQUALS(string("a"), rs->dataFor(t2.get(), id1).data()); try { // this should fail as our version of id1 is too old - rs->updateRecord(t2.get(), id1, "c", 2, false, NULL).transitional_ignore(); + rs->updateRecord(t2.get(), id1, "c", 2, NULL).transitional_ignore(); ASSERT(0); } catch (WriteConflictException&) { } @@ -215,8 +215,7 @@ StatusWith<RecordId> insertBSON(ServiceContext::UniqueOperationContext& opCtx, Status status = wrs->oplogDiskLocRegister(opCtx.get(), opTime, false); if (!status.isOK()) return StatusWith<RecordId>(status); - StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), opTime, false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), obj.objdata(), obj.objsize(), opTime); if (res.isOK()) wuow.commit(); return res; @@ -230,7 +229,7 @@ TEST(WiredTigerRecordStoreTest, CappedCursorRollover) { ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); for (int i = 0; i < 3; ++i) { WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } @@ -250,7 +249,7 @@ TEST(WiredTigerRecordStoreTest, CappedCursorRollover) { auto opCtx = harnessHelper->newOperationContext(client3.get()); for (int i = 0; i < 100; i++) { WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); uow.commit(); } @@ -268,7 +267,7 @@ RecordId _oplogOrderInsertOplog(OperationContext* opCtx, Status status = rs->oplogDiskLocRegister(opCtx, opTime, false); ASSERT_OK(status); BSONObj obj = BSON("ts" << opTime); - StatusWith<RecordId> res = rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), opTime, false); + StatusWith<RecordId> res = rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), opTime); ASSERT_OK(res.getStatus()); return res.getValue(); } @@ -384,7 +383,7 @@ TEST(WiredTigerRecordStoreTest, CappedCursorYieldFirst) { { // first insert a document ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); WriteUnitOfWork uow(opCtx.get()); - StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); id1 = res.getValue(); uow.commit(); @@ -428,7 +427,7 @@ StatusWith<RecordId> insertBSONWithSize(OperationContext* opCtx, if (!status.isOK()) { return StatusWith<RecordId>(status); } - StatusWith<RecordId> res = rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), opTime, false); + StatusWith<RecordId> res = rs->insertRecord(opCtx, obj.objdata(), obj.objsize(), opTime); if (res.isOK()) { wuow.commit(); } @@ -526,9 +525,9 @@ TEST(WiredTigerRecordStoreTest, OplogStones_UpdateRecord) { WriteUnitOfWork wuow(opCtx.get()); ASSERT_NOT_OK(rs->updateRecord( - opCtx.get(), RecordId(1, 1), changed1.objdata(), changed1.objsize(), false, nullptr)); + opCtx.get(), RecordId(1, 1), changed1.objdata(), changed1.objsize(), nullptr)); ASSERT_NOT_OK(rs->updateRecord( - opCtx.get(), RecordId(1, 2), changed2.objdata(), changed2.objsize(), false, nullptr)); + opCtx.get(), RecordId(1, 2), changed2.objdata(), changed2.objsize(), nullptr)); } // Attempts to shrink the records should also fail. @@ -540,9 +539,9 @@ TEST(WiredTigerRecordStoreTest, OplogStones_UpdateRecord) { WriteUnitOfWork wuow(opCtx.get()); ASSERT_NOT_OK(rs->updateRecord( - opCtx.get(), RecordId(1, 1), changed1.objdata(), changed1.objsize(), false, nullptr)); + opCtx.get(), RecordId(1, 1), changed1.objdata(), changed1.objsize(), nullptr)); ASSERT_NOT_OK(rs->updateRecord( - opCtx.get(), RecordId(1, 2), changed2.objdata(), changed2.objsize(), false, nullptr)); + opCtx.get(), RecordId(1, 2), changed2.objdata(), changed2.objsize(), nullptr)); } // Changing the contents of the records without changing their size should succeed. @@ -554,9 +553,9 @@ TEST(WiredTigerRecordStoreTest, OplogStones_UpdateRecord) { WriteUnitOfWork wuow(opCtx.get()); ASSERT_OK(rs->updateRecord( - opCtx.get(), RecordId(1, 1), changed1.objdata(), changed1.objsize(), false, nullptr)); + opCtx.get(), RecordId(1, 1), changed1.objdata(), changed1.objsize(), nullptr)); ASSERT_OK(rs->updateRecord( - opCtx.get(), RecordId(1, 2), changed2.objdata(), changed2.objsize(), false, nullptr)); + opCtx.get(), RecordId(1, 2), changed2.objdata(), changed2.objsize(), nullptr)); wuow.commit(); ASSERT_EQ(1U, oplogStones->numStones()); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit_test.cpp index 75dc1b4d029..0c3f74516f9 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit_test.cpp @@ -184,8 +184,7 @@ TEST_F(WiredTigerRecoveryUnitTestFixture, CreateAndCheckForCachePressure) { WriteUnitOfWork wu(opCtx); ASSERT_OK(ru1->setTimestamp(Timestamp(time++))); std::string str = str::stream() << "foobarbaz"; - StatusWith<RecordId> ress = - rs->insertRecord(opCtx, str.c_str(), str.size() + 1, Timestamp(), false); + StatusWith<RecordId> ress = rs->insertRecord(opCtx, str.c_str(), str.size() + 1, Timestamp()); ASSERT_OK(ress.getStatus()); auto recordId = ress.getValue(); wu.commit(); @@ -203,7 +202,7 @@ TEST_F(WiredTigerRecoveryUnitTestFixture, CreateAndCheckForCachePressure) { ASSERT_OK(ru1->setTimestamp(Timestamp(time++))); std::string s = str::stream() << "abcbcdcdedefefgfghghihijijkjklklmlmnmnomopopqpqrqrsrststutuv" << j; - ASSERT_OK(rs->updateRecord(opCtx, recordId, s.c_str(), s.size() + 1, false, nullptr)); + ASSERT_OK(rs->updateRecord(opCtx, recordId, s.c_str(), s.size() + 1, nullptr)); wuow.commit(); } catch (const DBException& ex) { invariant(ex.toStatus().code() == ErrorCodes::WriteConflict); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_standard_record_store_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_standard_record_store_test.cpp index 479bd470bf5..b914b4d6d57 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_standard_record_store_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_standard_record_store_test.cpp @@ -227,8 +227,7 @@ TEST(WiredTigerRecordStoreTest, SizeStorer1) { { WriteUnitOfWork uow(opCtx.get()); for (int i = 0; i < N; i++) { - StatusWith<RecordId> res = - rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false); + StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "a", 2, Timestamp()); ASSERT_OK(res.getStatus()); } uow.commit(); @@ -329,7 +328,7 @@ private: ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); WriteUnitOfWork uow(opCtx.get()); for (int i = 0; i < expectedNumRecords; i++) { - ASSERT_OK(rs->insertRecord(opCtx.get(), "a", 2, Timestamp(), false).getStatus()); + ASSERT_OK(rs->insertRecord(opCtx.get(), "a", 2, Timestamp()).getStatus()); } uow.commit(); } |