diff options
author | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-05-04 13:29:55 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-05-04 13:29:55 +0000 |
commit | 612d33a2d8ad09a0d96c6299b843d99706ffcf53 (patch) | |
tree | 6df87785680381d76d12982e1d3895ce524967cd | |
parent | e5b7d52bc38c988096f1a34fb802ad08dca0ab72 (diff) |
Replace attribute writer when document type repo changes.
4 files changed, 11 insertions, 0 deletions
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 d50eb20c10a..e1a9a2f421c 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 @@ -269,6 +269,7 @@ FastAccessDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, * to ready document sub db. */ if (params.shouldAttributeManagerChange() || + params.shouldAttributeWriterChange() || newConfigSnapshot.getDocumentTypeRepoSP().get() != oldConfigSnapshot.getDocumentTypeRepoSP().get()) { FastAccessDocSubDBConfigurer configurer(_fastAccessFeedView, std::make_unique<AttributeWriterFactory>(), getSubDbName()); diff --git a/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp b/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp index 646dc66e3cb..2ec8787a8ba 100644 --- a/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp @@ -75,4 +75,10 @@ ReconfigParams::shouldMaintenanceControllerChange() const return configHasChanged(); } +bool +ReconfigParams::shouldAttributeWriterChange() const +{ + return shouldAttributeManagerChange() || _res.documentTypeRepoChanged; +} + } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/reconfig_params.h b/searchcore/src/vespa/searchcore/proton/server/reconfig_params.h index d5c5e53fcca..6bb25f6a5bd 100644 --- a/searchcore/src/vespa/searchcore/proton/server/reconfig_params.h +++ b/searchcore/src/vespa/searchcore/proton/server/reconfig_params.h @@ -23,6 +23,7 @@ public: bool shouldSummaryManagerChange() const; bool shouldSubDbsChange() const; bool shouldMaintenanceControllerChange() const; + bool shouldAttributeWriterChange() const; }; } diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp index 5aec05ce1de..0bf34e63f69 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp @@ -219,6 +219,9 @@ SearchableDocSubDBConfigurer::reconfigure(const DocumentDBConfig &newConfig, shouldFeedViewChange = true; initializer.reset(createAttributeReprocessingInitializer(newConfig, newAttrMgr, oldConfig, oldAttrMgr, _subDbName, attrSpec.getCurrentSerialNum()).release()); + } else if (params.shouldAttributeWriterChange()) { + attrWriter = std::make_shared<AttributeWriter>(attrMgr); + shouldFeedViewChange = true; } ISummaryManager::ISummarySetup::SP sumSetup = |