diff options
author | Geir Storli <geirst@oath.com> | 2017-09-11 15:12:02 +0000 |
---|---|---|
committer | Geir Storli <geirst@oath.com> | 2017-09-11 15:12:02 +0000 |
commit | 67bf5f95c79f9452112931714fc1f273a19a5eb9 (patch) | |
tree | 4e54c19ab09085d9299a23a140b24da8f524cdb5 /searchcore/src/tests | |
parent | fcefafb47a56d9893834d27eb6de1759c8286193 (diff) |
Keep a document meta store read guard together with bitvector posting list in search cache for imported attributes.
This is to ensure that no lids that are cached in the bitvector are re-used until the guard is released.
Diffstat (limited to 'searchcore/src/tests')
7 files changed, 8 insertions, 2 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 5b64fa80d39..6a5932d2b3a 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 @@ -133,7 +133,8 @@ struct ImportedAttributesRepoBuilder { void add(const vespalib::string &name) { auto refAttr = std::make_shared<ReferenceAttribute>(name + "_ref", AVConfig(BasicType::REFERENCE)); auto targetAttr = search::AttributeFactory::createAttribute(name + "_target", INT32_SINGLE); - auto importedAttr = std::make_shared<ImportedAttributeVector>(name, refAttr, targetAttr, false); + auto documentMetaStore = std::shared_ptr<search::IDocumentMetaStoreContext>(); + auto importedAttr = std::make_shared<ImportedAttributeVector>(name, refAttr, targetAttr, documentMetaStore, 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 1112cf75570..badb42d4be4 100644 --- a/searchcore/src/tests/proton/attribute/attribute_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp @@ -723,6 +723,7 @@ createImportedAttribute(const vespalib::string &name) auto result = std::make_shared<ImportedAttributeVector>(name, ReferenceAttribute::SP(), AttributeVector::SP(), + std::shared_ptr<search::IDocumentMetaStoreContext>(), true); result->getSearchCache()->insert("foo", BitVectorSearchCache::Entry::SP()); return result; 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 d95d79fbd11..f221b2140c1 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 @@ -71,6 +71,7 @@ struct Fixture { auto attr = std::make_shared<ImportedAttributeVector>(name, createReferenceAttribute(name + "_ref"), createTargetAttribute(name + "_target"), + std::shared_ptr<search::IDocumentMetaStoreContext>(), 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 c41b88be2b4..e23c308050b 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 @@ -22,6 +22,7 @@ createAttr(const vespalib::string &name) return std::make_shared<ImportedAttributeVector>(name, ReferenceAttribute::SP(), AttributeVector::SP(), + std::shared_ptr<search::IDocumentMetaStoreContext>(), false); } diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index 211adce5f48..412c7abac5b 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -143,6 +143,7 @@ struct EmptyConstantValueFactory : public vespalib::eval::ConstantValueFactory { struct MyDocumentDBReferenceResolver : public IDocumentDBReferenceResolver { std::unique_ptr<ImportedAttributesRepo> resolve(const search::IAttributeManager &, const search::IAttributeManager &, + const std::shared_ptr<search::IDocumentMetaStoreContext> &, fastos::TimeStamp) override { return std::make_unique<ImportedAttributesRepo>(); } diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp index 8cd57b1b0cb..0b88471a1f5 100644 --- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp +++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp @@ -110,6 +110,7 @@ struct MyMetricsWireService : public DummyWireService struct MyDocumentDBReferenceResolver : public IDocumentDBReferenceResolver { std::unique_ptr<ImportedAttributesRepo> resolve(const search::IAttributeManager &, const search::IAttributeManager &, + const std::shared_ptr<search::IDocumentMetaStoreContext> &, fastos::TimeStamp) override { return std::make_unique<ImportedAttributesRepo>(); } diff --git a/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp b/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp index a6576d11279..40f9ed9b749 100644 --- a/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp +++ b/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp @@ -226,7 +226,7 @@ struct Fixture { } ImportedAttributesRepo::UP resolve(fastos::TimeStamp visibilityDelay) { DocumentDBReferenceResolver resolver(registry, docModel.childDocType, importedFieldsCfg, docModel.childDocType, _gidToLidChangeListenerRefCount, _attributeFieldWriter); - return resolver.resolve(attrMgr, oldAttrMgr, visibilityDelay); + return resolver.resolve(attrMgr, oldAttrMgr, std::shared_ptr<search::IDocumentMetaStoreContext>(), visibilityDelay); } ImportedAttributesRepo::UP resolve() { return resolve(fastos::TimeStamp(0)); |