diff options
author | Geir Storli <geirstorli@yahoo.no> | 2018-04-25 09:55:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-25 09:55:57 +0200 |
commit | 91050e8bf466ebf558fd368df8bd71ced8fa7272 (patch) | |
tree | 97f01f606965912ee092d9306147e13861fa115c /searchcore/src | |
parent | d82730695ca5a0e74e8bc0a8a985bd1da5af3ae5 (diff) | |
parent | 6ebb5d4295aafff8302fbae0675c44818a0b27cc (diff) |
Merge pull request #5679 from vespa-engine/toregge/use-read-guard-on-document-meta-store-for-target-document-db
Use read guard on document meta store for target document db
Diffstat (limited to 'searchcore/src')
21 files changed, 70 insertions, 35 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp index 59393ac0a26..9bf4d43fff7 100644 --- a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp @@ -16,6 +16,7 @@ LOG_SETUP("attribute_manager_test"); #include <vespa/searchcore/proton/attribute/sequential_attributes_initializer.h> #include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h> #include <vespa/searchcore/proton/common/hw_info.h> +#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h> #include <vespa/searchcore/proton/initializer/initializer_task.h> #include <vespa/searchcore/proton/initializer/task_runner.h> #include <vespa/searchcore/proton/server/executor_thread_service.h> @@ -139,7 +140,8 @@ struct ImportedAttributesRepoBuilder { refAttr->setGidToLidMapperFactory(std::make_shared<MockGidToLidMapperFactory>()); auto targetAttr = search::AttributeFactory::createAttribute(name + "_target", INT32_SINGLE); auto documentMetaStore = std::shared_ptr<search::IDocumentMetaStoreContext>(); - auto importedAttr = ImportedAttributeVectorFactory::create(name, refAttr, targetAttr, documentMetaStore, false); + auto targetDocumentMetaStore = std::make_shared<const DocumentMetaStoreContext>(std::make_shared<BucketDBOwner>()); + auto importedAttr = ImportedAttributeVectorFactory::create(name, refAttr, documentMetaStore, targetAttr, targetDocumentMetaStore, false); _repo->add(name, importedAttr); } ImportedAttributesRepo::UP build() { diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp index 4a9d1b31c8e..ee5f29255fb 100644 --- a/searchcore/src/tests/proton/attribute/attribute_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp @@ -748,8 +748,9 @@ createImportedAttribute(const vespalib::string &name) { auto result = ImportedAttributeVectorFactory::create(name, std::shared_ptr<ReferenceAttribute>(), - AttributeVector::SP(), std::shared_ptr<search::IDocumentMetaStoreContext>(), + AttributeVector::SP(), + std::shared_ptr<const search::IDocumentMetaStoreContext>(), true); result->getSearchCache()->insert("foo", BitVectorSearchCache::Entry::SP()); return result; diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt b/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt index 51365ee52f2..261242077b4 100644 --- a/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt +++ b/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt @@ -4,5 +4,6 @@ vespa_add_executable(searchcore_imported_attributes_context_test_app TEST imported_attributes_context_test.cpp DEPENDS searchcore_attribute + searchcore_documentmetastore ) vespa_add_test(NAME searchcore_imported_attributes_context_test_app COMMAND searchcore_imported_attributes_context_test_app) diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp index 998537b2745..2dc51d4577e 100644 --- a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp +++ b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp @@ -5,6 +5,7 @@ LOG_SETUP("imported_attributes_context_test"); #include <vespa/searchcore/proton/attribute/imported_attributes_context.h> #include <vespa/searchcore/proton/attribute/imported_attributes_repo.h> +#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h> #include <vespa/searchlib/attribute/attribute.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/imported_attribute_vector.h> @@ -77,8 +78,9 @@ struct Fixture { Fixture &addAttribute(const vespalib::string &name) { auto attr = ImportedAttributeVectorFactory::create(name, createReferenceAttribute(name + "_ref"), - createTargetAttribute(name + "_target"), std::shared_ptr<search::IDocumentMetaStoreContext>(), + createTargetAttribute(name + "_target"), + std::make_shared<const DocumentMetaStoreContext>(std::make_shared<BucketDBOwner>()), false); repo.add(name, attr); return *this; diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp b/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp index ddabed210d8..d92392ec8df 100644 --- a/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp +++ b/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp @@ -23,8 +23,9 @@ createAttr(const vespalib::string &name) { return ImportedAttributeVectorFactory::create(name, ReferenceAttribute::SP(), - AttributeVector::SP(), std::shared_ptr<search::IDocumentMetaStoreContext>(), + AttributeVector::SP(), + std::shared_ptr<const search::IDocumentMetaStoreContext>(), false); } diff --git a/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp b/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp index 13a3df2d139..fc9d2d770cd 100644 --- a/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp +++ b/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp @@ -26,8 +26,9 @@ makeImportedAttributesRepo() ImportedAttributesRepo::UP result = std::make_unique<ImportedAttributesRepo>(); ImportedAttributeVector::SP attr = std::make_shared<ImportedAttributeVector>("imported", std::shared_ptr<ReferenceAttribute>(), + std::shared_ptr<IDocumentMetaStoreContext>(), std::shared_ptr<ReadableAttributeVector>(), - std::shared_ptr<IDocumentMetaStoreContext>(), false); + std::shared_ptr<const IDocumentMetaStoreContext>(), false); result->add("imported", std::move(attr)); return result; } @@ -37,7 +38,7 @@ struct Fixture { DocumentDBReference ref; Fixture() : attrMgr(std::make_shared<test::MockAttributeManager>()), - ref(attrMgr, std::shared_ptr<DocumentMetaStore>(), std::shared_ptr<IGidToLidChangeHandler>()) + ref(attrMgr, std::shared_ptr<const IDocumentMetaStoreContext>(), std::shared_ptr<IGidToLidChangeHandler>()) { attrMgr->addAttribute("regular", AttributeFactory::createAttribute("regular", {BasicType::INT32})); attrMgr->setImportedAttributes(makeImportedAttributesRepo()); diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp index cec51e18e3c..a209dcd1f5d 100644 --- a/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp +++ b/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp @@ -2,6 +2,7 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h> #include <vespa/searchcore/proton/documentmetastore/documentmetastore.h> +#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h> #include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/test/insertion_operators.h> #include <vespa/document/base/documentid.h> @@ -76,12 +77,14 @@ struct Fixture BucketDBOwner::SP _bucketDB; std::shared_ptr<DocumentMetaStore> _dms; + std::shared_ptr<const DocumentMetaStoreContext> _dmsContext; Timestamp _timestamp; using generation_t = GenerationHandler::generation_t; Fixture() : _bucketDB(std::make_shared<BucketDBOwner>()), - _dms(std::make_shared<DocumentMetaStore>(_bucketDB)) + _dms(std::make_shared<DocumentMetaStore>(_bucketDB)), + _dmsContext(std::make_shared<const DocumentMetaStoreContext>(_dms)) { populate(); } @@ -120,7 +123,7 @@ struct Fixture } std::shared_ptr<search::IGidToLidMapperFactory> getGidToLidMapperFactory() { - return std::make_shared<GidToLidMapperFactory>(_dms); + return std::make_shared<GidToLidMapperFactory>(_dmsContext); } void assertGenerations(generation_t currentGeneration, generation_t firstUsedGeneration) diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp index 7829e6ac8e6..d2bbde1eadd 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp @@ -10,6 +10,7 @@ #include <vespa/searchlib/btree/btreenodeallocator.hpp> #include <vespa/searchlib/btree/btreeroot.hpp> #include <vespa/searchlib/btree/btreebuilder.hpp> +#include <vespa/searchlib/common/i_gid_to_lid_mapper.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/searchcore/proton/bucketdb/bucketsessionbase.h> #include <vespa/searchcore/proton/bucketdb/joinbucketssession.h> @@ -1070,6 +1071,13 @@ DocumentMetaStore::getVersion() const return _trackDocumentSizes ? documentmetastore::DOCUMENT_SIZE_TRACKING_VERSION : documentmetastore::NO_DOCUMENT_SIZE_TRACKING_VERSION; } +void +DocumentMetaStore::foreach(const search::IGidToLidMapperVisitor &visitor) const +{ + beginFrozen().foreach_key([this,&visitor](uint32_t lid) + { visitor.visit(getRawMetaData(lid).getGid(), lid); }); +} + } // namespace proton template class search::btree:: diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h index 33594117715..eba98fef1e0 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h @@ -274,6 +274,7 @@ public: uint64_t getEstimatedSaveByteSize() const override; virtual uint32_t getVersion() const override; void setTrackDocumentSizes(bool trackDocumentSizes) { _trackDocumentSizes = trackDocumentSizes; } + virtual void foreach(const search::IGidToLidMapperVisitor &visitor) const override; }; } diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index e285d30b74a..2cb23965450 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -49,6 +49,7 @@ struct StupidMetaStore : search::IDocumentMetaStore { uint64_t getCurrentGeneration() const override { return 0; } LidUsageStats getLidUsageStats() const override { return LidUsageStats(); } Blueprint::UP createWhiteListBlueprint() const override { return Blueprint::UP(); } + void foreach(const search::IGidToLidMapperVisitor &) const override { } }; FeatureSet::SP findFeatureSet(const DocsumRequest &req, diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp index 9192960b4c6..229006a349b 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp @@ -12,10 +12,10 @@ namespace proton { DocumentDBReference::DocumentDBReference(std::shared_ptr<IAttributeManager> attrMgr, - std::shared_ptr<DocumentMetaStore> dms, + std::shared_ptr<const search::IDocumentMetaStoreContext> dmsContext, std::shared_ptr<IGidToLidChangeHandler> gidToLidChangeHandler) : _attrMgr(std::move(attrMgr)), - _dms(std::move(dms)), + _dmsContext(std::move(dmsContext)), _gidToLidChangeHandler(std::move(gidToLidChangeHandler)) { } @@ -39,10 +39,16 @@ DocumentDBReference::getAttribute(vespalib::stringref name) } } +std::shared_ptr<const search::IDocumentMetaStoreContext> +DocumentDBReference::getDocumentMetaStore() const +{ + return _dmsContext; +} + std::shared_ptr<search::IGidToLidMapperFactory> DocumentDBReference::getGidToLidMapperFactory() { - return std::make_shared<GidToLidMapperFactory>(_dms); + return std::make_shared<GidToLidMapperFactory>(_dmsContext); } std::unique_ptr<GidToLidChangeRegistrator> diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h index 7c6aea9c2e6..56f06dca58e 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h +++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h @@ -3,10 +3,11 @@ #include "i_document_db_reference.h" +namespace search { class IDocumentMetaStoreContext; } + namespace proton { class IAttributeManager; -class DocumentMetaStore; class IGidToLidChangeHandler; /* @@ -17,14 +18,15 @@ class IGidToLidChangeHandler; class DocumentDBReference : public IDocumentDBReference { std::shared_ptr<IAttributeManager> _attrMgr; - std::shared_ptr<DocumentMetaStore> _dms; + std::shared_ptr<const search::IDocumentMetaStoreContext> _dmsContext; std::shared_ptr<IGidToLidChangeHandler> _gidToLidChangeHandler; public: DocumentDBReference(std::shared_ptr<IAttributeManager> attrMgr, - std::shared_ptr<DocumentMetaStore> dms, + std::shared_ptr<const search::IDocumentMetaStoreContext> dmsContext, std::shared_ptr<IGidToLidChangeHandler> gidToLidChangeHandler); virtual ~DocumentDBReference(); virtual std::shared_ptr<search::attribute::ReadableAttributeVector> getAttribute(vespalib::stringref name) override; + virtual std::shared_ptr<const search::IDocumentMetaStoreContext> getDocumentMetaStore() const override; virtual std::shared_ptr<search::IGidToLidMapperFactory> getGidToLidMapperFactory() override; virtual std::unique_ptr<GidToLidChangeRegistrator> makeGidToLidChangeRegistrator(const vespalib::string &docTypeName) override; }; diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp index 99b7eb300bf..95da27cf3bd 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp @@ -143,8 +143,10 @@ DocumentDBReferenceResolver::createImportedAttributesRepo(const IAttributeManage if (_useReferences) { for (const auto &attr : _importedFieldsCfg.attribute) { ReferenceAttribute::SP refAttr = getReferenceAttribute(attr.referencefield, attrMgr); - auto targetAttr = getTargetDocumentDB(refAttr->getName())->getAttribute(attr.targetfield); - auto importedAttr = ImportedAttributeVectorFactory::create(attr.name, refAttr, targetAttr, documentMetaStore, useSearchCache); + auto targetDocumentDB = getTargetDocumentDB(refAttr->getName()); + auto targetAttr = targetDocumentDB->getAttribute(attr.targetfield); + auto targetDocumentMetaStore = targetDocumentDB->getDocumentMetaStore(); + auto importedAttr = ImportedAttributeVectorFactory::create(attr.name, refAttr, documentMetaStore, targetAttr, targetDocumentMetaStore, useSearchCache); result->add(importedAttr->getName(), importedAttr); } } diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.cpp b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.cpp index 20bc1d1a49d..dde445b5075 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.cpp @@ -1,14 +1,12 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "gid_to_lid_mapper.h" -#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h> +#include <vespa/searchlib/common/idocumentmetastore.h> namespace proton { -GidToLidMapper::GidToLidMapper(vespalib::GenerationHandler::Guard &&guard, - const DocumentMetaStore &dms) - : _guard(std::move(guard)), - _dms(dms) +GidToLidMapper::GidToLidMapper(const search::IDocumentMetaStoreContext &dmsContext) + : _guard(dmsContext.getReadGuard()) { } @@ -19,9 +17,7 @@ GidToLidMapper::~GidToLidMapper() void GidToLidMapper::foreach(const search::IGidToLidMapperVisitor &visitor) const { - const auto &dms = _dms; - dms.beginFrozen().foreach_key([&dms,&visitor](uint32_t lid) - { visitor.visit(dms.getRawMetaData(lid).getGid(), lid); }); + _guard->get().foreach(visitor); } diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h index 47bcf4257f8..3a112ab7efa 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h @@ -2,8 +2,8 @@ #pragma once +#include <vespa/searchlib/common/i_document_meta_store_context.h> #include <vespa/searchlib/common/i_gid_to_lid_mapper.h> -#include <vespa/vespalib/util/generationhandler.h> namespace proton { @@ -15,11 +15,9 @@ class DocumentMetaStore; */ class GidToLidMapper : public search::IGidToLidMapper { - vespalib::GenerationHandler::Guard _guard; - const DocumentMetaStore &_dms; + search::IDocumentMetaStoreContext::IReadGuard::UP _guard; public: - GidToLidMapper(vespalib::GenerationHandler::Guard &&guard, - const DocumentMetaStore &dms); + GidToLidMapper(const search::IDocumentMetaStoreContext &dmsContext); virtual ~GidToLidMapper(); virtual void foreach(const search::IGidToLidMapperVisitor &visitor) const override; }; diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.cpp b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.cpp index 0c874d4ee38..66818ca9bf7 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.cpp @@ -6,8 +6,8 @@ namespace proton { -GidToLidMapperFactory::GidToLidMapperFactory(std::shared_ptr<DocumentMetaStore> dms) - : _dms(std::move(dms)) +GidToLidMapperFactory::GidToLidMapperFactory(std::shared_ptr<const search::IDocumentMetaStoreContext> dmsContext) + : _dmsContext(std::move(dmsContext)) { } @@ -18,7 +18,7 @@ GidToLidMapperFactory::~GidToLidMapperFactory() std::unique_ptr<search::IGidToLidMapper> GidToLidMapperFactory::getMapper() const { - return std::make_unique<GidToLidMapper>(_dms->getGenerationHandler().takeGuard(), *_dms); + return std::make_unique<GidToLidMapper>(*_dmsContext); } } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.h b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.h index ab9b4444407..e0ffdc412a0 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.h +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.h @@ -4,15 +4,17 @@ #include <vespa/searchlib/common/i_gid_to_lid_mapper_factory.h> +namespace search { class IDocumentMetaStoreContext; } + namespace proton { class DocumentMetaStore; class GidToLidMapperFactory : public search::IGidToLidMapperFactory { - std::shared_ptr<DocumentMetaStore> _dms; + std::shared_ptr<const search::IDocumentMetaStoreContext> _dmsContext; public: - GidToLidMapperFactory(std::shared_ptr<DocumentMetaStore> dms); + GidToLidMapperFactory(std::shared_ptr<const search::IDocumentMetaStoreContext> dmsContext); virtual ~GidToLidMapperFactory(); virtual std::unique_ptr<search::IGidToLidMapper> getMapper() const override; }; diff --git a/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h b/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h index a37a553ed40..1029bda191c 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h +++ b/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h @@ -8,6 +8,7 @@ namespace search::attribute { class ReadableAttributeVector; } namespace search { class IGidToLidMapperFactory; +class IDocumentMetaStoreContext; } @@ -26,6 +27,7 @@ public: using SP = std::shared_ptr<IDocumentDBReference>; virtual ~IDocumentDBReference() { } virtual std::shared_ptr<search::attribute::ReadableAttributeVector> getAttribute(vespalib::stringref name) = 0; + virtual std::shared_ptr<const search::IDocumentMetaStoreContext> getDocumentMetaStore() const = 0; virtual std::shared_ptr<search::IGidToLidMapperFactory> getGidToLidMapperFactory() = 0; virtual std::unique_ptr<GidToLidChangeRegistrator> makeGidToLidChangeRegistrator(const vespalib::string &docTypeName) = 0; }; diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp index e05ab4b798f..bb2242d5596 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp @@ -364,7 +364,7 @@ SearchableDocSubDB::close() std::shared_ptr<IDocumentDBReference> SearchableDocSubDB::getDocumentDBReference() { - return std::make_shared<DocumentDBReference>(getAttributeManager(), _dms, _gidToLidChangeHandler); + return std::make_shared<DocumentDBReference>(getAttributeManager(), _metaStoreCtx, _gidToLidChangeHandler); } void diff --git a/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h b/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h index e0faf372454..fa29eb33933 100644 --- a/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h +++ b/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h @@ -182,6 +182,9 @@ struct DocumentMetaStoreObserver : public IDocumentMetaStore virtual search::SerialNum getLastSerialNum() const override { return _store.getLastSerialNum(); } + virtual void foreach(const search::IGidToLidMapperVisitor &visitor) const override { + _store.foreach(visitor); + } }; } diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h b/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h index defe78c0e75..1c3cb0719ac 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h +++ b/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h @@ -18,6 +18,9 @@ struct MockDocumentDBReference : public IDocumentDBReference { virtual std::shared_ptr<search::attribute::ReadableAttributeVector> getAttribute(vespalib::stringref) override { return std::shared_ptr<search::attribute::ReadableAttributeVector>(); } + virtual std::shared_ptr<const search::IDocumentMetaStoreContext> getDocumentMetaStore() const override { + return std::shared_ptr<const search::IDocumentMetaStoreContext>(); + } virtual std::shared_ptr<search::IGidToLidMapperFactory> getGidToLidMapperFactory() override { return std::shared_ptr<search::IGidToLidMapperFactory>(); } |