aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-03-17 14:14:58 +0000
committerGeir Storli <geirst@yahooinc.com>2022-03-17 14:14:58 +0000
commitdefcc21484db806f8ccf47a6864006fc54cfe193 (patch)
tree6a2d07e2b5669b722a25bf677c21c47685f28b3a
parent791812f39d990fb75c11cccb72334b21bf220630 (diff)
Make the attribute enum change interlock shared between all document dbs.
This is to avoid a potential deadlock when using imported attributes in parent/child.
-rw-r--r--searchcore/src/apps/tests/persistenceconformance_test.cpp6
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp6
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp8
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp8
-rw-r--r--searchcore/src/tests/proton/attribute/attributeflush_test.cpp8
-rw-r--r--searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp4
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp25
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp21
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp9
-rw-r--r--searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp26
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp11
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp11
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h24
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h11
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.h14
22 files changed, 145 insertions, 79 deletions
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp
index 9a7b49065d4..7c0a9b29a7b 100644
--- a/searchcore/src/apps/tests/persistenceconformance_test.cpp
+++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp
@@ -10,6 +10,7 @@
#include <vespa/config-rank-profiles.h>
#include <vespa/config-summary.h>
#include <vespa/config-summarymap.h>
+#include <vespa/config/subscription/sourcespec.h>
#include <vespa/document/base/testdocman.h>
#include <vespa/document/config/documenttypes_config_fwd.h>
#include <vespa/document/repo/documenttyperepo.h>
@@ -33,12 +34,12 @@
#include <vespa/searchcore/proton/server/threading_service_config.h>
#include <vespa/searchcore/proton/test/disk_mem_usage_notifier.h>
#include <vespa/searchcore/proton/test/mock_shared_threading_service.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/size_literals.h>
-#include <vespa/config/subscription/sourcespec.h>
#include <vespa/log/log.h>
LOG_SETUP("persistenceconformance_test");
@@ -209,7 +210,8 @@ public:
return DocumentDB::create(_baseDir, mgr.getConfig(), _tlsSpec, _queryLimiter, docType, bucketSpace,
*b->getProtonConfigSP(), const_cast<DocumentDBFactory &>(*this),
_shared_service, _tls, _metricsWireService,
- _fileHeaderContext, _config_stores.getConfigStore(docType.toString()),
+ _fileHeaderContext, std::make_shared<search::attribute::Interlock>(),
+ _config_stores.getConfigStore(docType.toString()),
std::make_shared<vespalib::ThreadStackExecutor>(16, 128_Ki), HwInfo());
}
};
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 7b3a2514347..7b0451d0f9d 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
@@ -11,8 +11,8 @@
#include <vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h>
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
#include <vespa/searchcore/proton/attribute/sequential_attributes_initializer.h>
-#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h>
#include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h>
#include <vespa/searchcore/proton/initializer/initializer_task.h>
@@ -24,6 +24,7 @@
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/imported_attribute_vector.h>
#include <vespa/searchlib/attribute/imported_attribute_vector_factory.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/attribute/predicate_attribute.h>
#include <vespa/searchlib/attribute/reference_attribute.h>
#include <vespa/searchlib/common/indexmetainfo.h>
@@ -161,7 +162,8 @@ struct BaseFixture
~BaseFixture();
proton::AttributeManager::SP make_manager() {
return std::make_shared<proton::AttributeManager>(test_dir, "test.subdb", TuneFileAttributes(),
- _fileHeaderContext, _attributeFieldWriter, _shared, _hwInfo);
+ _fileHeaderContext, std::make_shared<search::attribute::Interlock>(),
+ _attributeFieldWriter, _shared, _hwInfo);
}
};
diff --git a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
index 1ed5e6883cc..7ad427f303f 100644
--- a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
@@ -1,13 +1,14 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/document/fieldvalue/intfieldvalue.h>
-#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/datatype/documenttype.h>
+#include <vespa/document/fieldvalue/document.h>
+#include <vespa/document/fieldvalue/intfieldvalue.h>
#include <vespa/document/repo/configbuilder.h>
#include <vespa/searchcore/proton/attribute/attribute_populator.h>
#include <vespa/searchcore/proton/attribute/attributemanager.h>
#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchcore/proton/test/test.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/test/directory_handler.h>
#include <vespa/vespalib/testkit/testapp.h>
@@ -79,7 +80,8 @@ struct Fixture
_shared(),
_hwInfo(),
_mgr(std::make_shared<AttributeManager>(TEST_DIR, "test.subdb", TuneFileAttributes(),
- _fileHeader, _attributeFieldWriter, _shared, _hwInfo)),
+ _fileHeader, std::make_shared<search::attribute::Interlock>(),
+ _attributeFieldWriter, _shared, _hwInfo)),
_pop(),
_ctx()
{
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index 890a808ae88..fdf75bbd726 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp
@@ -1,18 +1,18 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/config-attributes.h>
-#include <vespa/document/datatype/tensor_data_type.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/datatype/mapdatatype.h>
+#include <vespa/document/datatype/tensor_data_type.h>
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/predicate/predicate_slime_builder.h>
#include <vespa/document/update/arithmeticvalueupdate.h>
#include <vespa/document/update/assignvalueupdate.h>
#include <vespa/document/update/documentupdate.h>
-#include <vespa/eval/eval/value.h>
#include <vespa/eval/eval/simple_value.h>
#include <vespa/eval/eval/tensor_spec.h>
#include <vespa/eval/eval/test/value_compare.h>
+#include <vespa/eval/eval/value.h>
#include <vespa/searchcommon/attribute/attributecontent.h>
#include <vespa/searchcommon/attribute/iattributevector.h>
#include <vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h>
@@ -30,8 +30,8 @@
#include <vespa/searchlib/attribute/bitvector_search_cache.h>
#include <vespa/searchlib/attribute/imported_attribute_vector.h>
#include <vespa/searchlib/attribute/imported_attribute_vector_factory.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/attribute/predicate_attribute.h>
-#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/predicate/predicate_hash.h>
@@ -47,6 +47,7 @@
#include <vespa/vespalib/util/foreground_thread_executor.h>
#include <vespa/vespalib/util/foregroundtaskexecutor.h>
#include <vespa/vespalib/util/gate.h>
+#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/vespalib/util/sequencedtaskexecutorobserver.h>
#include <vespa/log/log.h>
@@ -611,6 +612,7 @@ public:
_baseMgr(new proton::AttributeManager(test_dir, "test.subdb",
TuneFileAttributes(),
_fileHeaderContext,
+ std::make_shared<search::attribute::Interlock>(),
_attributeFieldWriter,
_shared,
_hwInfo)),
diff --git a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
index e85bf3c4baa..0dab0710209 100644
--- a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
@@ -8,8 +8,9 @@
#include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h>
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/integerbase.h>
-#include <vespa/searchlib/common/indexmetainfo.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/common/flush_token.h>
+#include <vespa/searchlib/common/indexmetainfo.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/test/directory_handler.h>
#include <vespa/vespalib/datastore/datastorebase.h>
@@ -17,9 +18,9 @@
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/foreground_thread_executor.h>
#include <vespa/vespalib/util/foregroundtaskexecutor.h>
+#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
-#include <vespa/vespalib/util/idestructorcallback.h>
#include <thread>
#include <vespa/log/log.h>
@@ -297,7 +298,8 @@ struct AttributeManagerFixture
AttributeManagerFixture::AttributeManagerFixture(BaseFixture &bf)
: _msp(std::make_shared<AttributeManager>(test_dir, "test.subdb", TuneFileAttributes(),
- bf._fileHeaderContext, bf._attributeFieldWriter, bf._shared, bf._hwInfo)),
+ bf._fileHeaderContext, std::make_shared<search::attribute::Interlock>(),
+ bf._attributeFieldWriter, bf._shared, bf._hwInfo)),
_m(*_msp)
{}
AttributeManagerFixture::~AttributeManagerFixture() = default;
diff --git a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
index 3737d6eb89a..1209ab3e578 100644
--- a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
@@ -5,12 +5,13 @@
#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchcore/proton/test/attribute_utils.h>
#include <vespa/searchcore/proton/test/attribute_vectors.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/test/directory_handler.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/gtest/gtest.h>
-#include <vespa/vespalib/util/sequencedtaskexecutor.h>
#include <vespa/vespalib/util/foreground_thread_executor.h>
+#include <vespa/vespalib/util/sequencedtaskexecutor.h>
#include <vespa/log/log.h>
LOG_SETUP("attributes_state_explorer_test");
@@ -50,6 +51,7 @@ struct AttributesStateExplorerTest : public ::testing::Test
_hwInfo(),
_mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
_fileHeaderContext,
+ std::make_shared<search::attribute::Interlock>(),
*_attribute_field_writer,
_shared,
_hwInfo)),
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 6ae9e7e2d52..a0400661b4e 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -28,6 +28,7 @@
#include <vespa/searchcore/proton/server/summaryadapter.h>
#include <vespa/searchcore/proton/test/bucketfactory.h>
#include <vespa/searchcore/proton/test/mock_shared_threading_service.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/engine/docsumapi.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
@@ -225,6 +226,7 @@ public:
_ddb = DocumentDB::create("tmpdb", _configMgr.getConfig(), "tcp/localhost:9013", _queryLimiter,
DocTypeName(docTypeName), makeBucketSpace(), *b->getProtonConfigSP(), *this,
_shared_service, _tls, _dummy, _fileHeaderContext,
+ std::make_shared<search::attribute::Interlock>(),
std::make_unique<MemoryConfigStore>(),
std::make_shared<vespalib::ThreadStackExecutor>(16, 128_Ki), _hwInfo),
_ddb->start();
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 9e77047e578..d4e337f2717 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -6,29 +6,30 @@
#include <vespa/searchcore/proton/attribute/attribute_writer.h>
#include <vespa/searchcore/proton/attribute/attributemanager.h>
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
+#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/searchcore/proton/docsummary/summarymanager.h>
#include <vespa/searchcore/proton/index/index_writer.h>
#include <vespa/searchcore/proton/index/indexmanager.h>
+#include <vespa/searchcore/proton/matching/querylimiter.h>
+#include <vespa/searchcore/proton/matching/sessionmanager.h>
+#include <vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h>
#include <vespa/searchcore/proton/reprocessing/attribute_reprocessing_initializer.h>
-#include <vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h>
-#include <vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h>
-#include <vespa/searchcore/proton/server/summaryadapter.h>
#include <vespa/searchcore/proton/server/attribute_writer_factory.h>
+#include <vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h>
#include <vespa/searchcore/proton/server/reconfig_params.h>
-#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
-#include <vespa/searchcore/proton/matching/sessionmanager.h>
-#include <vespa/searchcore/proton/matching/querylimiter.h>
+#include <vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h>
+#include <vespa/searchcore/proton/server/summaryadapter.h>
#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
-#include <vespa/searchcore/proton/test/mock_summary_adapter.h>
#include <vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h>
+#include <vespa/searchcore/proton/test/mock_summary_adapter.h>
#include <vespa/searchcore/proton/test/transport_helper.h>
-#include <vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/nosyncproxy.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/size_literals.h>
-#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/util/testclock.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
using namespace config;
using namespace document;
@@ -189,7 +190,8 @@ Fixture::initViewSet(ViewSet &views)
auto indexMgr = make_shared<IndexManager>(BASE_DIR, IndexConfig(searchcorespi::index::WarmupConfig(), 2, 0), Schema(), 1,
views._reconfigurer, views._service.write(), _summaryExecutor,
TuneFileIndexManager(), TuneFileAttributes(), views._fileHeaderContext);
- auto attrMgr = make_shared<AttributeManager>(BASE_DIR, "test.subdb", TuneFileAttributes(), views._fileHeaderContext,
+ auto attrMgr = make_shared<AttributeManager>(BASE_DIR, "test.subdb", TuneFileAttributes(),
+ views._fileHeaderContext, std::make_shared<search::attribute::Interlock>(),
views._service.write().attributeFieldWriter(), views._service.write().shared(), views._hwInfo);
auto summaryMgr = make_shared<SummaryManager>
(_summaryExecutor, search::LogDocumentStore::Config(), search::GrowStrategy(), BASE_DIR, views._docTypeName,
@@ -261,7 +263,8 @@ struct MyFastAccessFeedView
StoreOnlyFeedView::Context storeOnlyCtx(summaryAdapter, schema, _dmsc, repo,
_pendingLidsForCommit, *_gidToLidChangeHandler, _writeService);
StoreOnlyFeedView::PersistentParams params(1, 1, DocTypeName(DOC_TYPE), 0, SubDbType::NOTREADY);
- auto mgr = make_shared<AttributeManager>(BASE_DIR, "test.subdb", TuneFileAttributes(), _fileHeaderContext,
+ auto mgr = make_shared<AttributeManager>(BASE_DIR, "test.subdb", TuneFileAttributes(),
+ _fileHeaderContext, std::make_shared<search::attribute::Interlock>(),
_writeService.attributeFieldWriter(), _writeService.shared(), _hwInfo);
auto writer = std::make_shared<AttributeWriter>(mgr);
FastAccessFeedView::Context fastUpdateCtx(writer, _docIdLimit);
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 68a92c73b44..0a49b15d001 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
@@ -1,42 +1,43 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/config-bucketspaces.h>
+#include <vespa/config/subscription/sourcespec.h>
#include <vespa/document/test/make_bucket_space.h>
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
#include <vespa/searchcore/proton/bucketdb/bucketdbhandler.h>
#include <vespa/searchcore/proton/common/hw_info.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/initializer/task_runner.h>
+#include <vespa/searchcore/proton/matching/querylimiter.h>
#include <vespa/searchcore/proton/metrics/attribute_metrics.h>
#include <vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h>
#include <vespa/searchcore/proton/metrics/metricswireservice.h>
#include <vespa/searchcore/proton/reference/i_document_db_reference_resolver.h>
#include <vespa/searchcore/proton/reprocessing/reprocessingrunner.h>
-#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/server/bootstrapconfig.h>
#include <vespa/searchcore/proton/server/document_subdb_explorer.h>
+#include <vespa/searchcore/proton/server/document_subdb_initializer.h>
#include <vespa/searchcore/proton/server/emptysearchview.h>
#include <vespa/searchcore/proton/server/fast_access_document_retriever.h>
#include <vespa/searchcore/proton/server/i_document_subdb_owner.h>
#include <vespa/searchcore/proton/server/igetserialnum.h>
#include <vespa/searchcore/proton/server/minimal_document_retriever.h>
-#include <vespa/searchcore/proton/server/searchabledocsubdb.h>
-#include <vespa/searchcore/proton/server/document_subdb_initializer.h>
#include <vespa/searchcore/proton/server/reconfig_params.h>
-#include <vespa/searchcore/proton/matching/querylimiter.h>
+#include <vespa/searchcore/proton/server/searchabledocsubdb.h>
#include <vespa/searchcore/proton/test/test.h>
-#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchcore/proton/test/thread_utils.h>
-#include <vespa/vespalib/util/idestructorcallback.h>
+#include <vespa/searchcore/proton/test/transport_helper.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/test/directory_handler.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/util/destructor_callbacks.h>
+#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/size_literals.h>
-#include <vespa/vespalib/util/threadstackexecutor.h>
-#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/util/testclock.h>
-#include <vespa/config/subscription/sourcespec.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
using namespace cloud::config::filedistribution;
using namespace document;
@@ -200,7 +201,7 @@ MyFastAccessContext::MyFastAccessContext(IThreadingService &writeService,
: _storeOnlyCtx(writeService, bucketDB, bucketDBHandlerInitializer),
_attributeMetrics(nullptr),
_wireService(),
- _ctx(_storeOnlyCtx._ctx, _attributeMetrics, _wireService)
+ _ctx(_storeOnlyCtx._ctx, _attributeMetrics, _wireService, std::make_shared<search::attribute::Interlock>())
{}
MyFastAccessContext::~MyFastAccessContext() = default;
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index 0edea2c0c5c..a9f923833e5 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -2,10 +2,12 @@
#include <tests/proton/common/dummydbowner.h>
#include <vespa/config-bucketspaces.h>
+#include <vespa/config/subscription/sourcespec.h>
#include <vespa/document/config/documenttypes_config_fwd.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/test/make_bucket_space.h>
+#include <vespa/fnet/transport.h>
#include <vespa/searchcore/proton/attribute/flushableattribute.h>
#include <vespa/searchcore/proton/common/statusreport.h>
#include <vespa/searchcore/proton/docsummary/summaryflushtarget.h>
@@ -26,6 +28,7 @@
#include <vespa/searchcore/proton/test/mock_shared_threading_service.h>
#include <vespa/searchcorespi/index/indexflushtarget.h>
#include <vespa/searchlib/attribute/attribute_read_guard.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/vespalib/data/slime/slime.h>
@@ -33,8 +36,6 @@
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/size_literals.h>
-#include <vespa/config/subscription/sourcespec.h>
-#include <vespa/fnet/transport.h>
#include <iostream>
using namespace cloud::config::filedistribution;
@@ -165,7 +166,9 @@ Fixture::Fixture(bool file_config)
_db = DocumentDB::create(".", mgr.getConfig(), "tcp/localhost:9014", _queryLimiter, DocTypeName("typea"),
makeBucketSpace(),
*b->getProtonConfigSP(), _myDBOwner, _shared_service, _tls, _dummy,
- _fileHeaderContext, make_config_store(),
+ _fileHeaderContext,
+ std::make_shared<search::attribute::Interlock>(),
+ make_config_store(),
std::make_shared<vespalib::ThreadStackExecutor>(16, 128_Ki), _hwInfo);
_db->start();
_db->waitForOnlineState();
diff --git a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
index 6cd07849fab..c2664d4e143 100644
--- a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
+++ b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
@@ -11,6 +11,7 @@
#include <vespa/searchcore/proton/reprocessing/i_reprocessing_handler.h>
#include <vespa/searchcore/proton/test/attribute_utils.h>
#include <vespa/searchlib/attribute/attributefactory.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/test/directory_handler.h>
#include <vespa/vespalib/gtest/gtest.h>
@@ -93,7 +94,8 @@ MyConfig::MyConfig()
_shared(),
_hwInfo(),
_mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
- _fileHeaderContext, _attributeFieldWriter, _shared, _hwInfo)),
+ _fileHeaderContext, std::make_shared<search::attribute::Interlock>(),
+ _attributeFieldWriter, _shared, _hwInfo)),
_schema()
{}
MyConfig::~MyConfig() = default;
@@ -149,7 +151,8 @@ public:
_attributeFieldWriter(),
_shared(),
_hwInfo(),
- _mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(), _fileHeaderContext,
+ _mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
+ _fileHeaderContext, std::make_shared<search::attribute::Interlock>(),
_attributeFieldWriter, _shared, _hwInfo)),
_oldCfg(),
_newCfg(),
diff --git a/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp b/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp
index b42af79d946..9cab70cd72b 100644
--- a/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp
+++ b/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp
@@ -54,6 +54,7 @@
#include <vespa/searchcore/proton/server/persistencehandlerproxy.h>
#include <vespa/searchcore/proton/test/disk_mem_usage_notifier.h>
#include <vespa/searchcore/proton/test/mock_shared_threading_service.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
@@ -593,6 +594,7 @@ MyBmNode::create_document_db(const BmClusterParams& params)
_bucket_space, *bootstrap_config->getProtonConfigSP(), _document_db_owner,
_shared_service, _tls,
_metrics_wire_service, _file_header_context,
+ std::make_shared<search::attribute::Interlock>(),
_config_stores.getConfigStore(_doc_type_name.toString()),
std::make_shared<vespalib::ThreadStackExecutor>(16, 128_Ki), HwInfo());
_document_db->start();
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp
index ef7e422c722..92989da9b99 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp
@@ -1,29 +1,29 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include "attribute_factory.h"
#include "attribute_directory.h"
+#include "attribute_factory.h"
+#include "attribute_type_matcher.h"
#include "attributedisklayout.h"
#include "attributemanager.h"
-#include "attribute_type_matcher.h"
+#include "flushableattribute.h"
#include "imported_attributes_context.h"
#include "imported_attributes_repo.h"
#include "sequential_attributes_initializer.h"
-#include "flushableattribute.h"
+#include <vespa/searchcommon/attribute/i_attribute_functor.h>
#include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h>
-#include <vespa/searchlib/attribute/attributecontext.h>
#include <vespa/searchlib/attribute/attribute_read_guard.h>
+#include <vespa/searchlib/attribute/attributecontext.h>
+#include <vespa/searchlib/attribute/attributevector.h>
#include <vespa/searchlib/attribute/imported_attribute_vector.h>
-#include <vespa/searchlib/common/flush_token.h>
-#include <vespa/searchcommon/attribute/i_attribute_functor.h>
#include <vespa/searchlib/attribute/interlock.h>
-#include <vespa/vespalib/util/isequencedtaskexecutor.h>
+#include <vespa/searchlib/common/flush_token.h>
#include <vespa/searchlib/common/threaded_compactable_lid_space.h>
-#include <vespa/searchlib/attribute/attributevector.h>
-#include <vespa/vespalib/util/threadexecutor.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
+#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/gate.h>
-#include <vespa/vespalib/util/destructor_callbacks.h>
+#include <vespa/vespalib/util/isequencedtaskexecutor.h>
+#include <vespa/vespalib/util/threadexecutor.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.attribute.attributemanager");
@@ -239,6 +239,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir,
const vespalib::string &documentSubDbName,
const TuneFileAttributes &tuneFileAttributes,
const FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> interlock,
vespalib::ISequencedTaskExecutor &attributeFieldWriter,
vespalib::Executor& shared_executor,
const HwInfo &hwInfo)
@@ -251,7 +252,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir,
_tuneFileAttributes(tuneFileAttributes),
_fileHeaderContext(fileHeaderContext),
_factory(std::make_shared<AttributeFactory>()),
- _interlock(std::make_shared<search::attribute::Interlock>()),
+ _interlock(std::move(interlock)),
_attributeFieldWriter(attributeFieldWriter),
_shared_executor(shared_executor),
_hwInfo(hwInfo),
@@ -263,6 +264,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir,
const vespalib::string &documentSubDbName,
const search::TuneFileAttributes &tuneFileAttributes,
const search::common::FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> interlock,
vespalib::ISequencedTaskExecutor &attributeFieldWriter,
vespalib::Executor& shared_executor,
const IAttributeFactory::SP &factory,
@@ -276,7 +278,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir,
_tuneFileAttributes(tuneFileAttributes),
_fileHeaderContext(fileHeaderContext),
_factory(factory),
- _interlock(std::make_shared<search::attribute::Interlock>()),
+ _interlock(std::move(interlock)),
_attributeFieldWriter(attributeFieldWriter),
_shared_executor(shared_executor),
_hwInfo(hwInfo),
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h
index beea59b5350..41e553b47d1 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h
@@ -106,6 +106,7 @@ public:
const vespalib::string &documentSubDbName,
const search::TuneFileAttributes &tuneFileAttributes,
const search::common::FileHeaderContext & fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> interlock,
vespalib::ISequencedTaskExecutor &attributeFieldWriter,
vespalib::Executor& shared_executor,
const HwInfo &hwInfo);
@@ -114,6 +115,7 @@ public:
const vespalib::string &documentSubDbName,
const search::TuneFileAttributes &tuneFileAttributes,
const search::common::FileHeaderContext & fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> interlock,
vespalib::ISequencedTaskExecutor &attributeFieldWriter,
vespalib::Executor& shared_executor,
const IAttributeFactory::SP &factory,
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index 60e9dc68573..33a0001cc75 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -148,6 +148,7 @@ DocumentDB::create(const vespalib::string &baseDir,
const search::transactionlog::WriterFactory &tlsWriterFactory,
MetricsWireService &metricsWireService,
const search::common::FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> attribute_interlock,
ConfigStore::UP config_store,
InitializeThreads initializeThreads,
const HwInfo &hwInfo)
@@ -155,7 +156,8 @@ DocumentDB::create(const vespalib::string &baseDir,
return DocumentDB::SP(
new DocumentDB(baseDir, std::move(currentSnapshot), tlsSpec, queryLimiter, docTypeName, bucketSpace,
protonCfg, owner, shared_service, tlsWriterFactory,
- metricsWireService, fileHeaderContext, std::move(config_store), initializeThreads, hwInfo));
+ metricsWireService, fileHeaderContext, std::move(attribute_interlock),
+ std::move(config_store), initializeThreads, hwInfo));
}
DocumentDB::DocumentDB(const vespalib::string &baseDir,
DocumentDBConfig::SP configSnapshot,
@@ -169,6 +171,7 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir,
const search::transactionlog::WriterFactory &tlsWriterFactory,
MetricsWireService &metricsWireService,
const FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> attribute_interlock,
ConfigStore::UP config_store,
InitializeThreads initializeThreads,
const HwInfo &hwInfo)
@@ -214,8 +217,10 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir,
_writeFilter(),
_transient_usage_provider(std::make_shared<DocumentDBResourceUsageProvider>(*this)),
_feedHandler(std::make_unique<FeedHandler>(_writeService, tlsSpec, docTypeName, *this, _writeFilter, *this, tlsWriterFactory)),
- _subDBs(*this, *this, *_feedHandler, _docTypeName, _writeService, shared_service.warmup(), fileHeaderContext,
- metricsWireService, getMetrics(), queryLimiter, shared_service.clock(), _configMutex, _baseDir, hwInfo),
+ _subDBs(*this, *this, *_feedHandler, _docTypeName,
+ _writeService, shared_service.warmup(), fileHeaderContext, std::move(attribute_interlock),
+ metricsWireService, getMetrics(), queryLimiter, shared_service.clock(),
+ _configMutex, _baseDir, hwInfo),
_maintenanceController(shared_service.transport(), _writeService.master(), shared_service.shared(), _refCount, _docTypeName),
_jobTrackers(),
_calc(),
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
index 9dd9cf6542b..c842eb5ada7 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
@@ -6,8 +6,8 @@
#include "configstore.h"
#include "ddbstate.h"
#include "disk_mem_usage_forwarder.h"
-#include "documentdb_metrics_updater.h"
#include "document_db_config_owner.h"
+#include "documentdb_metrics_updater.h"
#include "documentdbconfig.h"
#include "documentsubdbcollection.h"
#include "executorthreadingservice.h"
@@ -19,10 +19,10 @@
#include "threading_service_config.h"
#include <vespa/searchcore/proton/attribute/attribute_usage_filter.h>
#include <vespa/searchcore/proton/common/doctypename.h>
+#include <vespa/searchcore/proton/index/indexmanager.h>
#include <vespa/searchcore/proton/metrics/documentdb_job_trackers.h>
#include <vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h>
#include <vespa/searchcore/proton/persistenceengine/i_resource_write_filter.h>
-#include <vespa/searchcore/proton/index/indexmanager.h>
#include <vespa/searchlib/docstore/cachestats.h>
#include <vespa/searchlib/transactionlog/syncproxy.h>
#include <vespa/vespalib/util/retain_guard.h>
@@ -31,6 +31,7 @@
#include <condition_variable>
namespace search {
+ namespace attribute { class Interlock; }
namespace common { class FileHeaderContext; }
namespace transactionlog {
class TransLogClient;
@@ -205,6 +206,7 @@ private:
const search::transactionlog::WriterFactory &tlsWriterFactory,
MetricsWireService &metricsWireService,
const search::common::FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> attribute_interlock,
ConfigStore::UP config_store,
InitializeThreads initializeThreads,
const HwInfo &hwInfo);
@@ -234,6 +236,7 @@ public:
const search::transactionlog::WriterFactory &tlsWriterFactory,
MetricsWireService &metricsWireService,
const search::common::FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> attribute_interlock,
ConfigStore::UP config_store,
InitializeThreads initializeThreads,
const HwInfo &hwInfo);
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
index 3c9bdb2ec5f..1cd27783a39 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
@@ -28,6 +28,7 @@ DocumentSubDBCollection::DocumentSubDBCollection(
searchcorespi::index::IThreadingService &writeService,
vespalib::Executor &warmupExecutor,
const search::common::FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> attribute_interlock,
MetricsWireService &metricsWireService,
DocumentDBTaggedMetrics &metrics,
matching::QueryLimiter &queryLimiter,
@@ -57,7 +58,10 @@ DocumentSubDBCollection::DocumentSubDBCollection(
StoreOnlyDocSubDB::Config(docTypeName, "0.ready", baseDir,_readySubDbId, SubDbType::READY),
true, true, false),
SearchableDocSubDB::Context(
- FastAccessDocSubDB::Context(context, metrics.ready.attributes, metricsWireService),
+ FastAccessDocSubDB::Context(context,
+ metrics.ready.attributes,
+ metricsWireService,
+ attribute_interlock),
queryLimiter, clock, warmupExecutor)));
_subDBs.push_back
@@ -68,7 +72,10 @@ DocumentSubDBCollection::DocumentSubDBCollection(
(new FastAccessDocSubDB(FastAccessDocSubDB::Config(
StoreOnlyDocSubDB::Config(docTypeName, "2.notready", baseDir,_notReadySubDbId, SubDbType::NOTREADY),
true, true, true),
- FastAccessDocSubDB::Context(context, metrics.notReady.attributes, metricsWireService)));
+ FastAccessDocSubDB::Context(context,
+ metrics.notReady.attributes,
+ metricsWireService,
+ attribute_interlock)));
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
index ca092bb0957..f5654fb661d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
@@ -17,6 +17,7 @@ namespace vespalib {
}
namespace search {
+ namespace attribute { class Interlock; }
namespace common { class FileHeaderContext; }
namespace transactionlog { class SyncProxy; }
}
@@ -28,22 +29,22 @@ namespace searchcorespi {
namespace proton {
-class DocumentDBConfig;
-struct DocumentDBTaggedMetrics;
-class MaintenanceController;
-struct MetricsWireService;
-struct IDocumentDBReferenceResolver;
-class IGetSerialNum;
class DocTypeName;
+class DocumentDBConfig;
+class FeedHandler;
class HwInfo;
-class IFeedView;
-struct IBucketStateCalculator;
-class IDocumentSubDBOwner;
-class IDocumentSubDB;
class IDocumentRetriever;
+class IDocumentSubDB;
+class IDocumentSubDBOwner;
+class IFeedView;
+class IGetSerialNum;
+class MaintenanceController;
class ReconfigParams;
class RemoveDocumentsOperation;
-class FeedHandler;
+struct DocumentDBTaggedMetrics;
+struct IBucketStateCalculator;
+struct IDocumentDBReferenceResolver;
+struct MetricsWireService;
namespace matching {
class QueryLimiter;
@@ -88,6 +89,7 @@ public:
searchcorespi::index::IThreadingService &writeService,
vespalib::Executor &warmupExecutor,
const search::common::FileHeaderContext &fileHeaderContext,
+ std::shared_ptr<search::attribute::Interlock> attribute_interlock,
MetricsWireService &metricsWireService,
DocumentDBTaggedMetrics &metrics,
matching::QueryLimiter & queryLimiter,
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
index f8a6253ead1..228a46123a4 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
@@ -56,6 +56,8 @@ extractAttributeManager(const FastAccessFeedView::SP &feedView)
}
+FastAccessDocSubDB::Context::~Context() = default;
+
InitializerTask::SP
FastAccessDocSubDB::createAttributeManagerInitializer(const DocumentDBConfig &configSnapshot,
SerialNum configSerialNum,
@@ -70,6 +72,7 @@ FastAccessDocSubDB::createAttributeManagerInitializer(const DocumentDBConfig &co
getSubDbName(),
configSnapshot.getTuneFileDocumentDBSP()->_attr,
_fileHeaderContext,
+ _attribute_interlock,
_writeService.attributeFieldWriter(),
_writeService.shared(),
attrFactory,
@@ -200,8 +203,10 @@ FastAccessDocSubDB::FastAccessDocSubDB(const Config &cfg, const Context &ctx)
_subAttributeMetrics(ctx._subAttributeMetrics),
_addMetrics(cfg._addMetrics),
_metricsWireService(ctx._metricsWireService),
+ _attribute_interlock(std::move(ctx._attribute_interlock)),
_docIdLimit(0)
-{ }
+{
+}
FastAccessDocSubDB::~FastAccessDocSubDB() = default;
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
index 1722f72bc80..51c2378789b 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
@@ -8,6 +8,8 @@
#include <vespa/searchcore/proton/metrics/attribute_metrics.h>
#include <vespa/searchcore/proton/metrics/metricswireservice.h>
+namespace search::attribute { class Interlock; }
+
namespace proton {
/**
@@ -47,13 +49,17 @@ public:
const StoreOnlyDocSubDB::Context _storeOnlyCtx;
AttributeMetrics &_subAttributeMetrics;
MetricsWireService &_metricsWireService;
+ std::shared_ptr<search::attribute::Interlock> _attribute_interlock;
Context(const StoreOnlyDocSubDB::Context &storeOnlyCtx,
AttributeMetrics &subAttributeMetrics,
- MetricsWireService &metricsWireService)
+ MetricsWireService &metricsWireService,
+ std::shared_ptr<search::attribute::Interlock> attribute_interlock)
: _storeOnlyCtx(storeOnlyCtx),
_subAttributeMetrics(subAttributeMetrics),
- _metricsWireService(metricsWireService)
+ _metricsWireService(metricsWireService),
+ _attribute_interlock(std::move(attribute_interlock))
{ }
+ ~Context();
};
private:
@@ -82,6 +88,7 @@ protected:
const bool _addMetrics;
MetricsWireService &_metricsWireService;
+ std::shared_ptr<search::attribute::Interlock> _attribute_interlock;
DocIdLimit _docIdLimit;
AttributeCollectionSpec::UP createAttributeSpec(const AttributesConfig &attrCfg, const AllocStrategy& alloc_strategy, SerialNum serialNum) const;
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index 0c281ed75c2..c558b749a60 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -18,6 +18,7 @@
#include <vespa/document/base/exceptions.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/fnet/transport.h>
#include <vespa/metrics/updatehook.h>
#include <vespa/searchcore/proton/attribute/i_attribute_usage_listener.h>
#include <vespa/searchcore/proton/flushengine/flush_engine_explorer.h>
@@ -29,6 +30,7 @@
#include <vespa/searchcore/proton/persistenceengine/persistenceengine.h>
#include <vespa/searchcore/proton/reference/document_db_reference_registry.h>
#include <vespa/searchcore/proton/summaryengine/summaryengine.h>
+#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/common/packets.h>
#include <vespa/searchlib/transactionlog/trans_log_server_explorer.h>
#include <vespa/searchlib/transactionlog/translogserverapp.h>
@@ -43,7 +45,6 @@
#include <vespa/vespalib/util/random.h>
#include <vespa/vespalib/util/sequencedtaskexecutor.h>
#include <vespa/vespalib/util/size_literals.h>
-#include <vespa/fnet/transport.h>
#ifdef __linux__
#include <malloc.h>
#endif
@@ -217,6 +218,7 @@ Proton::Proton(FastOS_ThreadPool & threadPool, FNET_Transport & transport, const
_metricsHook(std::make_unique<MetricsUpdateHook>(*this)),
_metricsEngine(std::make_unique<MetricsEngine>()),
_fileHeaderContext(progName),
+ _attribute_interlock(std::make_shared<search::attribute::Interlock>()),
_tls(),
_diskMemUsageSampler(),
_persistenceEngine(),
@@ -616,6 +618,7 @@ Proton::addDocumentDB(const document::DocumentType &docType,
*_tls->getTransLogServer(),
*_metricsEngine,
_fileHeaderContext,
+ _attribute_interlock,
std::move(config_store),
initializeThreads,
bootstrapConfig->getHwInfo());
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.h b/searchcore/src/vespa/searchcore/proton/server/proton.h
index 58c9a8bda3e..a18d409b57d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.h
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.h
@@ -30,7 +30,10 @@
#include <shared_mutex>
namespace vespalib { class StateServer; }
-namespace search::transactionlog { class TransLogServerApp; }
+namespace search {
+ namespace attribute { class Interlock; }
+ namespace transactionlog { class TransLogServerApp; }
+}
namespace metrics {
class MetricLockGuard;
class MetricManager;
@@ -40,14 +43,14 @@ namespace storage::spi { struct PersistenceProvider; }
namespace proton {
class DiskMemUsageSampler;
+class FlushEngine;
class IDocumentDBReferenceRegistry;
class IProtonDiskLayout;
-class PrepareRestartHandler;
-class SummaryEngine;
-class FlushEngine;
class MatchEngine;
-class PersistenceEngine;
class MetricsEngine;
+class PersistenceEngine;
+class PrepareRestartHandler;
+class SummaryEngine;
class Proton : public IProtonConfigurerOwner,
public search::engine::MonitorServer,
@@ -89,6 +92,7 @@ private:
std::unique_ptr<metrics::UpdateHook> _metricsHook;
std::unique_ptr<MetricsEngine> _metricsEngine;
ProtonFileHeaderContext _fileHeaderContext;
+ std::shared_ptr<search::attribute::Interlock> _attribute_interlock;
std::unique_ptr<TLS> _tls;
std::unique_ptr<DiskMemUsageSampler> _diskMemUsageSampler;
std::unique_ptr<PersistenceEngine> _persistenceEngine;