diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-26 13:17:28 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-26 13:17:28 +0000 |
commit | 35f26e02632b01b60299c5ea800dc5a944c09fba (patch) | |
tree | 6141a4e9b7a0a6da3a4a7f2ae5b12ccf7b18d0bd /searchcore | |
parent | 3602fbc2bc9530429589e5ad50c105f12fea3c49 (diff) |
Remove the syncFeedView upcall as it has no purpose other than forcing it more than necessary.
Instead do it in the main documentdb after all subds are reconfigured.
Diffstat (limited to 'searchcore')
7 files changed, 3 insertions, 34 deletions
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 1f5382eb68b..9cdd984b152 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 @@ -76,9 +76,6 @@ struct ConfigDir4 { static vespalib::string dir() { return TEST_PATH("cfg4"); } struct MySubDBOwner : public IDocumentSubDBOwner { - uint32_t _syncCnt; - MySubDBOwner() : _syncCnt(0) {} - void syncFeedView() override { ++_syncCnt; } document::BucketSpace getBucketSpace() const override { return makeBucketSpace(); } vespalib::string getName() const override { return "owner"; } uint32_t getDistributionKey() const override { return -1; } @@ -576,32 +573,6 @@ TEST_F("require that reconfigured attributes are accessible via feed view", Sear template <typename Fixture> void -requireThatOwnerIsNotifiedWhenFeedViewChanges(Fixture &f) -{ - EXPECT_EQUAL(0u, f.getOwner()._syncCnt); - f.basicReconfig(10); - EXPECT_EQUAL(1u, f.getOwner()._syncCnt); -} - -TEST_F("require that owner is noticed when feed view changes", StoreOnlyFixture) -{ - requireThatOwnerIsNotifiedWhenFeedViewChanges(f); -} - -TEST_F("require that owner is noticed when feed view changes", FastAccessFixture) -{ - requireThatOwnerIsNotifiedWhenFeedViewChanges(f); -} - -TEST_F("require that owner is noticed when feed view changes", SearchableFixture) -{ - EXPECT_EQUAL(1u, f.getOwner()._syncCnt); // NOTE: init also notifies owner - f.basicReconfig(10); - EXPECT_EQUAL(2u, f.getOwner()._syncCnt); -} - -template <typename Fixture> -void requireThatAttributeMetricsAreRegistered(Fixture &f) { EXPECT_EQUAL(2u, f.getWireService()._attributes.size()); diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index 9df81e5ceec..db38c711dd2 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -472,6 +472,7 @@ DocumentDB::applyConfig(DocumentDBConfig::SP configSnapshot, SerialNum serialNum // Changes applied while online should not trigger reprocessing assert(_subDBs.getReprocessingRunner().empty()); } + syncFeedView(); } if (params.shouldIndexManagerChange()) { setIndexSchema(*configSnapshot, serialNum); diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h index 6ed876f197d..9f6cf44c75d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h @@ -200,6 +200,8 @@ private: */ void tearDownReferences(); + void syncFeedView(); + template <typename FunctionType> inline void masterExecute(FunctionType &&function); @@ -383,7 +385,6 @@ public: /* * Implements IDocumentSubDBOwner */ - void syncFeedView() override; document::BucketSpace getBucketSpace() const override; vespalib::string getName() const override; uint32_t getDistributionKey() const override; 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 42310df2531..f92f3e74e31 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 @@ -274,7 +274,6 @@ FastAccessDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const reconfigureAttributeMetrics(*newMgr, *oldMgr); } _iFeedView.set(_fastAccessFeedView.get()); - _owner.syncFeedView(); } return tasks; } diff --git a/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h b/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h index fa19e5c77c4..3acde1392d5 100644 --- a/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h +++ b/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h @@ -15,7 +15,6 @@ class IDocumentSubDBOwner { public: virtual ~IDocumentSubDBOwner() {} - virtual void syncFeedView() = 0; virtual document::BucketSpace getBucketSpace() const = 0; virtual vespalib::string getName() const = 0; virtual uint32_t getDistributionKey() const = 0; diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp index 38478b4ff20..987d19bb8a8 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp @@ -64,7 +64,6 @@ SearchableDocSubDB::syncViews() { _iSearchView.set(_rSearchView.get()); _iFeedView.set(_rFeedView.get()); - _owner.syncFeedView(); } SerialNum diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp index 95051341e8c..2aeece204fb 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp @@ -411,7 +411,6 @@ StoreOnlyDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const assert(_writeService.master().isCurrentThread()); reconfigure(newConfigSnapshot.getStoreConfig()); initFeedView(newConfigSnapshot); - _owner.syncFeedView(); return IReprocessingTask::List(); } |