diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-05 15:15:00 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-05 23:07:08 +0200 |
commit | 1273bfa7c489c8b6861fca1777833b068336944b (patch) | |
tree | 1a4024fab30584c74fd8b193ab5eef401f47f8db | |
parent | dff6169faab318931c8c3ca4d0dc7df4ea763594 (diff) |
There is a less intrusive way ...
21 files changed, 74 insertions, 112 deletions
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp index 20309559854..86ab574f7d3 100644 --- a/searchcore/src/apps/tests/persistenceconformance_test.cpp +++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp @@ -185,7 +185,7 @@ public: _queryLimiter, _clock, docType, - std::make_shared<ProtonConfig>(), + *b->getProtonConfigSP(), const_cast<DocumentDBFactory &>(*this), _summaryExecutor, _summaryExecutor, diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index db15093e8b5..da85bb3e8c0 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -209,7 +209,7 @@ public: _configMgr.nextGeneration(0); if (! FastOS_File::MakeDirectory((std::string("tmpdb/") + docTypeName).c_str())) { abort(); } _ddb.reset(new DocumentDB("tmpdb", _configMgr.getConfig(), "tcp/localhost:9013", _queryLimiter, _clock, - DocTypeName(docTypeName), std::make_shared<ProtonConfig>(), *this, _summaryExecutor, _summaryExecutor, + DocTypeName(docTypeName), *b->getProtonConfigSP(), *this, _summaryExecutor, _summaryExecutor, _tls, _dummy, _fileHeaderContext, ConfigStore::UP(new MemoryConfigStore), std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo)), _ddb->start(); 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 cd88666662e..af1d283077c 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 @@ -355,7 +355,7 @@ struct FixtureBase cmpResult.documenttypesChanged = true; cmpResult.documentTypeRepoChanged = true; MyDocumentDBReferenceResolver resolver; - auto tasks = _subDb.applyConfig(newCfg->_bootstrap->getProtonConfig(), *newCfg->_cfg, *_snapshot->_cfg, + auto tasks = _subDb.applyConfig(*newCfg->_cfg, *_snapshot->_cfg, serialNum, ReconfigParams(cmpResult), resolver); _snapshot = std::move(newCfg); if (!tasks.empty()) { diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp index e15a44ff962..96b98dd4274 100644 --- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp @@ -114,7 +114,7 @@ Fixture::Fixture() mgr.forwardConfig(b); mgr.nextGeneration(0); _db.reset(new DocumentDB(".", mgr.getConfig(), "tcp/localhost:9014", _queryLimiter, _clock, DocTypeName("typea"), - b->getProtonConfigSP(), _myDBOwner, _summaryExecutor, _summaryExecutor, _tls, _dummy, + *b->getProtonConfigSP(), _myDBOwner, _summaryExecutor, _summaryExecutor, _tls, _dummy, _fileHeaderContext, ConfigStore::UP(new MemoryConfigStore), std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo)); _db->start(); diff --git a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp index ec14f7de818..79a97ece098 100644 --- a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp +++ b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp @@ -209,7 +209,7 @@ struct MyDocumentDBConfigOwner : public IDocumentDBConfigOwner } ~MyDocumentDBConfigOwner() { } - void reconfigure(const std::shared_ptr<ProtonConfig> & protonConfig, const DocumentDBConfig::SP & config) override; + void reconfigure(const DocumentDBConfig::SP & config) override; }; struct MyProtonConfigurerOwner : public IProtonConfigurerOwner @@ -267,7 +267,7 @@ struct MyProtonConfigurerOwner : public IProtonConfigurerOwner }; void -MyDocumentDBConfigOwner::reconfigure(const std::shared_ptr<ProtonConfig> &,const DocumentDBConfig::SP & config) +MyDocumentDBConfigOwner::reconfigure(const DocumentDBConfig::SP & config) { _owner.reconfigureDocumentDB(_name, config); } diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index 98c8d5f93f7..37bb02199d8 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -85,7 +85,7 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir, matching::QueryLimiter & queryLimiter, const vespalib::Clock &clock, const DocTypeName &docTypeName, - const std::shared_ptr<ProtonConfig> & protonCfg, + const ProtonConfig & protonCfg, IDocumentDBOwner & owner, vespalib::ThreadExecutor & warmupExecutor, vespalib::ThreadStackExecutorBase & summaryExecutor, @@ -104,17 +104,16 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir, _docTypeName(docTypeName), _baseDir(baseDir + "/" + _docTypeName.toString()), // Only one thread per executor, or performDropFeedView() will fail. - _defaultExecutorTaskLimit(protonCfg->indexing.tasklimit), - _semiUnboundExecutorTaskLimit(protonCfg->indexing.semiunboundtasklimit), - _indexingThreads(protonCfg->indexing.threads), - _writeService(std::max(1, protonCfg->indexing.threads), + _defaultExecutorTaskLimit(protonCfg.indexing.tasklimit), + _semiUnboundExecutorTaskLimit(protonCfg.indexing.semiunboundtasklimit), + _indexingThreads(protonCfg.indexing.threads), + _writeService(std::max(1, protonCfg.indexing.threads), indexing_thread_stack_size, _defaultExecutorTaskLimit), _initializeThreads(initializeThreads), _initConfigSnapshot(), _initConfigSerialNum(0u), _pendingConfigSnapshot(configSnapshot), - _pendingProtonConfigSnapshot(protonCfg), _configMutex(), _configCV(), _activeConfigSnapshot(), @@ -123,12 +122,12 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir, _initGate(), _clusterStateHandler(_writeService.master()), _bucketHandler(_writeService.master()), - _protonSummaryCfg(protonCfg->summary), - _protonIndexCfg(protonCfg->index), + _protonSummaryCfg(protonCfg.summary), + _protonIndexCfg(protonCfg.index), _config_store(std::move(config_store)), - _sessionManager(new matching::SessionManager(protonCfg->grouping.sessionmanager.maxentries)), + _sessionManager(new matching::SessionManager(protonCfg.grouping.sessionmanager.maxentries)), _metricsWireService(metricsWireService), - _metricsHook(*this, _docTypeName.getName(), protonCfg->numthreadspersearch), + _metricsHook(*this, _docTypeName.getName(), protonCfg.numthreadspersearch), _feedView(), _refCount(), _syncFeedViewEnabled(false), @@ -141,7 +140,7 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir, _state, *this, _writeFilter, *this, tlsDirectWriter), _subDBs(*this, *this, _feedHandler, _docTypeName, _writeService, warmupExecutor, summaryExecutor, fileHeaderContext, metricsWireService, getMetricsCollection(), - queryLimiter, clock, _configMutex, _baseDir, *protonCfg, hwInfo), + queryLimiter, clock, _configMutex, _baseDir, protonCfg, hwInfo), _maintenanceController(_writeService.master(), summaryExecutor, _docTypeName), _visibility(_feedHandler, _writeService, _feedView), _lidSpaceCompactionHandlers(), @@ -282,11 +281,10 @@ DocumentDB::initFinish(DocumentDBConfig::SP configSnapshot) void -DocumentDB::newConfigSnapshot(std::shared_ptr<ProtonConfig> protonConfig, DocumentDBConfig::SP snapshot) +DocumentDB::newConfigSnapshot(DocumentDBConfig::SP snapshot) { // Called by executor thread _pendingConfigSnapshot.set(snapshot); - _pendingProtonConfigSnapshot.set(protonConfig); { lock_guard guard(_configMutex); if (_activeConfigSnapshot.get() == NULL) { @@ -305,7 +303,7 @@ DocumentDB::newConfigSnapshot(std::shared_ptr<ProtonConfig> protonConfig, Docume return; } } - masterExecute([this] () { performReconfig(_pendingProtonConfigSnapshot.get(), _pendingConfigSnapshot.get()); } ); + masterExecute([this] () { performReconfig(_pendingConfigSnapshot.get()); } ); } @@ -345,10 +343,10 @@ DocumentDB::enterOnlineState() } void -DocumentDB::performReconfig(std::shared_ptr<ProtonConfig> bootstrapConfig, DocumentDBConfig::SP configSnapshot) +DocumentDB::performReconfig(DocumentDBConfig::SP configSnapshot) { // Called by executor thread - applyConfig(std::move(bootstrapConfig), std::move(configSnapshot), getCurrentSerialNumber()); + applyConfig(std::move(configSnapshot), getCurrentSerialNumber()); if (_state.getState() == DDBState::State::APPLY_LIVE_CONFIG) { enterReprocessState(); } @@ -356,7 +354,7 @@ DocumentDB::performReconfig(std::shared_ptr<ProtonConfig> bootstrapConfig, Docum void -DocumentDB::applySubDBConfig(const ProtonConfig & protonConfig, const DocumentDBConfig &newConfigSnapshot, +DocumentDB::applySubDBConfig(const DocumentDBConfig &newConfigSnapshot, SerialNum serialNum, const ReconfigParams ¶ms) { auto registry = _owner.getDocumentDBReferenceRegistry(); @@ -368,12 +366,11 @@ DocumentDB::applySubDBConfig(const ProtonConfig & protonConfig, const DocumentDB assert(newDocType != nullptr); DocumentDBReferenceResolver resolver(*registry, *newDocType, newConfigSnapshot.getImportedFieldsConfig(), *oldDocType, _refCount, _writeService.attributeFieldWriter()); - _subDBs.applyConfig(protonConfig, newConfigSnapshot, *_activeConfigSnapshot, serialNum, params, resolver); + _subDBs.applyConfig(newConfigSnapshot, *_activeConfigSnapshot, serialNum, params, resolver); } void -DocumentDB::applyConfig(std::shared_ptr<ProtonConfig> protonConfig, - DocumentDBConfig::SP configSnapshot, SerialNum serialNum) +DocumentDB::applyConfig(DocumentDBConfig::SP configSnapshot, SerialNum serialNum) { // Always called by executor thread: // Called by performReconfig() by executor thread during normal @@ -432,7 +429,7 @@ DocumentDB::applyConfig(std::shared_ptr<ProtonConfig> protonConfig, _writeService.setTaskLimit(_defaultExecutorTaskLimit); } if (params.shouldSubDbsChange() || hasVisibilityDelayChanged) { - applySubDBConfig(*protonConfig, *configSnapshot, serialNum, params); + applySubDBConfig(*configSnapshot, serialNum, params); if (serialNum < _feedHandler.getSerialNum()) { // Not last entry in tls. Reprocessing should already be done. _subDBs.getReprocessingRunner().reset(); @@ -769,10 +766,9 @@ DocumentDB::setIndexSchema(const DocumentDBConfig &configSnapshot, SerialNum ser } void -DocumentDB::reconfigure(const std::shared_ptr<ProtonConfig> & protonConfig, - const DocumentDBConfig::SP & snapshot) +DocumentDB::reconfigure(const DocumentDBConfig::SP & snapshot) { - masterExecute([this, protonConfig, snapshot]() { newConfigSnapshot(protonConfig, snapshot); }); + masterExecute([this, snapshot]() { newConfigSnapshot(snapshot); }); // Wait for config to be applied, or for document db close std::unique_lock<std::mutex> guard(_configMutex); while ((_activeConfigSnapshotGeneration < snapshot->getGeneration()) && !_state.getClosed()) { @@ -809,7 +805,7 @@ DocumentDB::enterApplyLiveConfigState() lock_guard guard(_configMutex); (void) _state.enterApplyLiveConfigState(); } - masterExecute([this]() { performReconfig(_pendingProtonConfigSnapshot.get(), _pendingConfigSnapshot.get()); }); + masterExecute([this]() { performReconfig(_pendingConfigSnapshot.get()); }); } @@ -867,7 +863,7 @@ DocumentDB::replayConfig(search::SerialNum serialNum) configSnapshot = DocumentDBConfigScout::scout(configSnapshot, *_pendingConfigSnapshot.get()); // Ignore configs that are not relevant during replay of transaction log configSnapshot = DocumentDBConfig::makeReplayConfig(configSnapshot); - applyConfig(_pendingProtonConfigSnapshot.get(), configSnapshot, serialNum); + applyConfig(configSnapshot, serialNum); LOG(info, "DocumentDB(%s): Replayed config with serialNum=%" PRIu64, _docTypeName.toString().c_str(), serialNum); diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h index dc49256bd36..31d12d2358b 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h @@ -96,7 +96,6 @@ private: DocumentDBConfig::SP _initConfigSnapshot; SerialNum _initConfigSerialNum; vespalib::VarHolder<DocumentDBConfig::SP> _pendingConfigSnapshot; - vespalib::VarHolder<std::shared_ptr<ProtonConfig>> _pendingProtonConfigSnapshot; mutable std::mutex _configMutex; // protects _active* below. mutable std::condition_variable _configCV; DocumentDBConfig::SP _activeConfigSnapshot; @@ -140,13 +139,12 @@ private: void internalInit(); void initManagers(); void initFinish(DocumentDBConfig::SP configSnapshot); - void performReconfig(std::shared_ptr<ProtonConfig> bootstrapConfig, DocumentDBConfig::SP configSnapshot); + void performReconfig(DocumentDBConfig::SP configSnapshot); void closeSubDBs(); - void applySubDBConfig(const ProtonConfig & protonConfig, const DocumentDBConfig &newConfigSnapshot, + void applySubDBConfig(const DocumentDBConfig &newConfigSnapshot, SerialNum serialNum, const ReconfigParams ¶ms); - void applyConfig(std::shared_ptr<ProtonConfig> bootstrapConfig, - DocumentDBConfig::SP configSnapshot, SerialNum serialNum); + void applyConfig(DocumentDBConfig::SP configSnapshot, SerialNum serialNum); /** * Save initial config if we don't have any saved config snapshots. @@ -241,7 +239,7 @@ public: matching::QueryLimiter & queryLimiter, const vespalib::Clock &clock, const DocTypeName &docTypeName, - const std::shared_ptr<ProtonConfig> &protonCfg, + const ProtonConfig &protonCfg, IDocumentDBOwner & owner, vespalib::ThreadExecutor & warmupExecutor, vespalib::ThreadStackExecutorBase & summaryExecutor, @@ -393,22 +391,12 @@ public: void release() { _refCount.release(); } bool getDelayedConfig() const { return _state.getDelayedConfig(); } - void replayConfig(SerialNum serialNum) override; - const DocTypeName & getDocTypeName() const { return _docTypeName; } - - void newConfigSnapshot(std::shared_ptr<ProtonConfig> bootstrapConfig, DocumentDBConfig::SP snapshot); - - // Implements DocumentDBConfigOwner - void reconfigure(const std::shared_ptr<ProtonConfig> & bootstrapConfig, - const DocumentDBConfig::SP & snapshot) override; - + void newConfigSnapshot(DocumentDBConfig::SP snapshot); + void reconfigure(const DocumentDBConfig::SP & snapshot) override; int64_t getActiveGeneration() const; - - // Implements IDocumentSubDBOwner void syncFeedView() override; - vespalib::string getName() const override { return _docTypeName.getName(); } uint32_t getDistributionKey() const override; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h index 773450af620..015da3a30f9 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h @@ -10,21 +10,16 @@ #include <vespa/config/retriever/configkeyset.h> #include <vespa/config/retriever/configsnapshot.h> -namespace vespa { - namespace config { - namespace search { - namespace internal { - class InternalSummaryType; - class InternalSummarymapType; - class InternalRankProfilesType; - class InternalAttributesType; - class InternalIndexschemaType; - class InternalImportedFieldsType; - } - namespace summary { namespace internal { class InternalJuniperrcType; } } - } - } +namespace vespa::config::search::internal { + class InternalSummaryType; + class InternalSummarymapType; + class InternalRankProfilesType; + class InternalAttributesType; + class InternalIndexschemaType; + class InternalImportedFieldsType; } +namespace vespa::config::search::summary { namespace internal { class InternalJuniperrcType; } } + namespace document { namespace internal { class InternalDocumenttypesType; } } diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp index b566eb05e79..ab1519d96cc 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp @@ -251,8 +251,7 @@ DocumentSubDBCollection::pruneRemovedFields(SerialNum serialNum) void -DocumentSubDBCollection::applyConfig(const ProtonConfig & protonConfig, - const DocumentDBConfig &newConfigSnapshot, +DocumentSubDBCollection::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, const ReconfigParams ¶ms, @@ -261,8 +260,7 @@ DocumentSubDBCollection::applyConfig(const ProtonConfig & protonConfig, _reprocessingRunner.reset(); for (auto subDb : _subDBs) { IReprocessingTask::List tasks; - tasks = subDb->applyConfig(protonConfig, newConfigSnapshot, oldConfigSnapshot, - serialNum, params, resolver); + tasks = subDb->applyConfig(newConfigSnapshot, oldConfigSnapshot, serialNum, params, resolver); _reprocessingRunner.addTasks(tasks); } } diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h index 9ad6732d50d..394810587d1 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h @@ -129,10 +129,7 @@ public: const vespa::config::search::core::ProtonConfig::Summary &protonSummaryCfg, const vespa::config::search::core::ProtonConfig::Index & indexCfg); - void - initViews(const DocumentDBConfig &configSnapshot, - const SessionManagerSP &sessionManager); - + void initViews(const DocumentDBConfig &configSnapshot, const SessionManagerSP &sessionManager); void clearViews(); void onReplayDone(); void onReprocessDone(SerialNum serialNum); @@ -141,9 +138,8 @@ public: void pruneRemovedFields(SerialNum serialNum); - void applyConfig(const ProtonConfig & bootstrapConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver); + void applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver); IFeedViewSP getFeedView(); IFlushTargetList getFlushTargets(); 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 eedd54cfb92..2d7555b518d 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 @@ -250,13 +250,12 @@ FastAccessDocSubDB::initViews(const DocumentDBConfig &configSnapshot, } IReprocessingTask::List -FastAccessDocSubDB::applyConfig(const ProtonConfig & protonConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) +FastAccessDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) { (void) resolver; - reconfigure(protonConfig); + // reconfigure(protonConfig); IReprocessingTask::List tasks; updateLidReuseDelayer(&newConfigSnapshot); /* 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 ed5326475b1..06e51280c6b 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 @@ -93,26 +93,23 @@ protected: virtual IFlushTargetList getFlushTargetsInternal() override; void reconfigureAttributeMetrics(const IAttributeManager &newMgr, const IAttributeManager &oldMgr); - IReprocessingTask::UP - createReprocessingTask(IReprocessingInitializer &initializer, const document::DocumentTypeRepo::SP &docTypeRepo) const; + IReprocessingTask::UP createReprocessingTask(IReprocessingInitializer &initializer, + const document::DocumentTypeRepo::SP &docTypeRepo) const; public: FastAccessDocSubDB(const Config &cfg, const Context &ctx); ~FastAccessDocSubDB(); std::unique_ptr<DocumentSubDbInitializer> - createInitializer(const DocumentDBConfig &configSnapshot, - SerialNum configSerialNum, - const ProtonConfig::Summary &protonSummaryCfg, - const ProtonConfig::Index &indexCfg) const override; + createInitializer(const DocumentDBConfig &configSnapshot, SerialNum configSerialNum, + const ProtonConfig::Summary &protonSummaryCfg, const ProtonConfig::Index &indexCfg) const override; void setup(const DocumentSubDbInitializerResult &initResult) override; void initViews(const DocumentDBConfig &configSnapshot, const SessionManagerSP &sessionManager) override; IReprocessingTask::List - applyConfig(const ProtonConfig & bootstrapConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) override; + applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) override; proton::IAttributeManager::SP getAttributeManager() const override; IDocumentRetriever::UP getDocumentRetriever() override; diff --git a/searchcore/src/vespa/searchcore/proton/server/i_document_db_config_owner.h b/searchcore/src/vespa/searchcore/proton/server/i_document_db_config_owner.h index b9cbacfa78a..10a47e7c6e4 100644 --- a/searchcore/src/vespa/searchcore/proton/server/i_document_db_config_owner.h +++ b/searchcore/src/vespa/searchcore/proton/server/i_document_db_config_owner.h @@ -2,7 +2,7 @@ #pragma once -#include <vespa/searchcore/config/config-proton.h> +#include <memory> namespace proton { @@ -14,10 +14,8 @@ class DocumentDBConfig; class IDocumentDBConfigOwner { public: - using ProtonConfig = vespa::config::search::core::ProtonConfig; virtual ~IDocumentDBConfigOwner() { } - virtual void reconfigure(const std::shared_ptr<ProtonConfig> & protonConfig, - const std::shared_ptr<DocumentDBConfig> & config) = 0; + virtual void reconfigure(const std::shared_ptr<DocumentDBConfig> & config) = 0; }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h index 5f5a8e43f26..b687867e330 100644 --- a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h @@ -70,9 +70,8 @@ public: virtual void initViews(const DocumentDBConfig &configSnapshot, const std::shared_ptr<matching::SessionManager> &sessionManager) = 0; virtual IReprocessingTask::List - applyConfig(const ProtonConfig & bootstrapConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) = 0; + applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) = 0; virtual std::shared_ptr<ISearchHandler> getSearchView() const = 0; virtual std::shared_ptr<IFeedView> getFeedView() const = 0; diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index bdd0f101f51..3689edc55a4 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -547,7 +547,7 @@ Proton::addDocumentDB(const document::DocumentType &docType, _queryLimiter, _clock, docTypeName, - bootstrapConfig->getProtonConfigSP(), + config, *this, *_warmupExecutor, *_summaryExecutor, diff --git a/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp index ade934f10b5..fe3314e7976 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp @@ -140,7 +140,7 @@ ProtonConfigurer::configureDocumentDB(const ProtonConfigSnapshot &configSnapshot assert(insres.second); } } else { - dbitr->second->reconfigure(bootstrapConfig->getProtonConfigSP(), documentDBConfig); + dbitr->second->reconfigure(documentDBConfig); } } diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp index e19e4502246..193c34e1b8f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp @@ -159,11 +159,10 @@ reconfigureMatchingMetrics(const RankProfilesConfig &cfg) } IReprocessingTask::List -SearchableDocSubDB::applyConfig(const ProtonConfig & protonConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) +SearchableDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) { - StoreOnlyDocSubDB::reconfigure(protonConfig); +// StoreOnlyDocSubDB::reconfigure(protonConfig); IReprocessingTask::List tasks; updateLidReuseDelayer(&newConfigSnapshot); if (params.shouldMatchersChange() && _addMetrics) { diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h index dc933c92aab..b6bac90101f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h @@ -118,9 +118,8 @@ public: void initViews(const DocumentDBConfig &configSnapshot, const SessionManagerSP &sessionManager) override; IReprocessingTask::List - applyConfig(const ProtonConfig & protonConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) override; + applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) override; void clearViews() override; diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp index f653e133486..7c93f54e5cd 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp @@ -437,16 +437,15 @@ StoreOnlyDocSubDB::updateLidReuseDelayer(const LidReuseDelayerConfig &config) } IReprocessingTask::List -StoreOnlyDocSubDB::applyConfig(const ProtonConfig & protonConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) +StoreOnlyDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) { (void) oldConfigSnapshot; (void) serialNum; (void) params; (void) resolver; assert(_writeService.master().isCurrentThread()); - reconfigure(protonConfig); +// reconfigure(protonConfig); initFeedView(newConfigSnapshot); updateLidReuseDelayer(&newConfigSnapshot); _owner.syncFeedView(); diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h index f39d0173d5e..318836089cc 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h @@ -213,9 +213,8 @@ public: void initViews(const DocumentDBConfig &configSnapshot, const std::shared_ptr<matching::SessionManager> &sessionManager) override; IReprocessingTask::List - applyConfig(const ProtonConfig & protonConfig, const DocumentDBConfig &newConfigSnapshot, - const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) override; + applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, + SerialNum serialNum, const ReconfigParams ¶ms, IDocumentDBReferenceResolver &resolver) override; ISearchHandler::SP getSearchView() const override { return _iSearchView.get(); } IFeedView::SP getFeedView() const override { return _iFeedView.get(); } diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h index 8d20270df9d..435dcfdd323 100644 --- a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h +++ b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h @@ -51,7 +51,7 @@ struct DummyDocumentSubDb : public IDocumentSubDB } void setup(const DocumentSubDbInitializerResult &) override {} void initViews(const DocumentDBConfig &, const proton::matching::SessionManager::SP &) override {} - IReprocessingTask::List applyConfig(const ProtonConfig &, const DocumentDBConfig &, const DocumentDBConfig &, + IReprocessingTask::List applyConfig(const DocumentDBConfig &, const DocumentDBConfig &, SerialNum, const ReconfigParams &, IDocumentDBReferenceResolver &) override { return IReprocessingTask::List(); |