diff options
Diffstat (limited to 'src/mongo/dbtests/storage_timestamp_tests.cpp')
-rw-r--r-- | src/mongo/dbtests/storage_timestamp_tests.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mongo/dbtests/storage_timestamp_tests.cpp b/src/mongo/dbtests/storage_timestamp_tests.cpp index 74fbbea51bc..dd25e73d3b0 100644 --- a/src/mongo/dbtests/storage_timestamp_tests.cpp +++ b/src/mongo/dbtests/storage_timestamp_tests.cpp @@ -140,17 +140,17 @@ private: const auto kIndexVersion = IndexDescriptor::IndexVersion::kV2; -void assertIndexMetaDataMissing(const BSONCollectionCatalogEntry::MetaData& collMetaData, +void assertIndexMetaDataMissing(std::shared_ptr<BSONCollectionCatalogEntry::MetaData> collMetaData, StringData indexName) { - const auto idxOffset = collMetaData.findIndexOffset(indexName); - ASSERT_EQUALS(-1, idxOffset) << indexName << ". Collection Metdata: " << collMetaData.toBSON(); + const auto idxOffset = collMetaData->findIndexOffset(indexName); + ASSERT_EQUALS(-1, idxOffset) << indexName << ". Collection Metdata: " << collMetaData->toBSON(); } BSONCollectionCatalogEntry::IndexMetaData getIndexMetaData( - const BSONCollectionCatalogEntry::MetaData& collMetaData, StringData indexName) { - const auto idxOffset = collMetaData.findIndexOffset(indexName); + std::shared_ptr<BSONCollectionCatalogEntry::MetaData> collMetaData, StringData indexName) { + const auto idxOffset = collMetaData->findIndexOffset(indexName); ASSERT_GT(idxOffset, -1) << indexName; - return collMetaData.indexes[idxOffset]; + return collMetaData->indexes[idxOffset]; } class DoNothingOplogApplierObserver : public repl::OplogApplier::Observer { @@ -245,7 +245,8 @@ public: if (_opCtx->recoveryUnit()->getCommitTimestamp().isNull()) { ASSERT_OK(_opCtx->recoveryUnit()->setTimestamp(Timestamp(1, 1))); } - collRaii.getWritableCollection()->getIndexCatalog()->dropAllIndexes(_opCtx, false); + collRaii.getWritableCollection()->getIndexCatalog()->dropAllIndexes( + _opCtx, collRaii.getWritableCollection(), false); wunit.commit(); return; } @@ -327,9 +328,8 @@ public: return optRecord.get().data.toBson(); } - BSONCollectionCatalogEntry::MetaData getMetaDataAtTime(DurableCatalog* durableCatalog, - RecordId catalogId, - const Timestamp& ts) { + std::shared_ptr<BSONCollectionCatalogEntry::MetaData> getMetaDataAtTime( + DurableCatalog* durableCatalog, RecordId catalogId, const Timestamp& ts) { OneOffRead oor(_opCtx, ts); return durableCatalog->getMetaData(_opCtx, catalogId); } @@ -3308,12 +3308,12 @@ public: auto systemViewsMd = getMetaDataAtTime( durableCatalog, catalogId, Timestamp(systemViewsCreateTs.asULL() - 1)); - ASSERT_EQ("", systemViewsMd.ns) + ASSERT(systemViewsMd == nullptr) << systemViewsNss << " incorrectly exists before creation. CreateTs: " << systemViewsCreateTs; systemViewsMd = getMetaDataAtTime(durableCatalog, catalogId, systemViewsCreateTs); - ASSERT_EQ(systemViewsNss.ns(), systemViewsMd.ns); + ASSERT_EQ(systemViewsNss.ns(), systemViewsMd->ns); assertDocumentAtTimestamp(autoColl.getCollection(), systemViewsCreateTs, BSONObj()); assertDocumentAtTimestamp(autoColl.getCollection(), |