diff options
author | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-03-17 13:45:59 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-03-17 13:45:59 +0000 |
commit | 4c4291043b03b292b7e9cbb44056d9388b2473f4 (patch) | |
tree | cb7a244ba920830f672b55943492cb90e596a957 /searchcore | |
parent | 8b8d2fd29f88296fc6b50074e9de7c6a237a6c4c (diff) |
Add serial number to index maintainer setSchema method, to allow for
implicit immediate history wipe later on.
Diffstat (limited to 'searchcore')
11 files changed, 16 insertions, 15 deletions
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp index 77d52d46cb4..b1081eb3338 100644 --- a/searchcore/src/tests/proton/index/indexmanager_test.cpp +++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp @@ -694,7 +694,7 @@ TEST_F("require that wipeHistory updates schema on disk", Fixture) { Schema empty_schema; f.addDocument(docid); f.flushIndexManager(); - f.runAsMaster([&]() { f._index_manager->setSchema(empty_schema); }); + f.runAsMaster([&]() { f._index_manager->setSchema(empty_schema, 1000); }); f.addDocument(docid); f.flushIndexManager(); diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h index b28df9fa02c..55f16047183 100644 --- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h +++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h @@ -114,8 +114,8 @@ public: return _maintainer.getFlushTargets(); } - virtual void setSchema(const Schema &schema) { - _maintainer.setSchema(schema); + virtual void setSchema(const Schema &schema, SerialNum serialNum) { + _maintainer.setSchema(schema, serialNum); } virtual void wipeHistory(SerialNum wipeSerial) { diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index ff1724c30e8..61799861171 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -531,7 +531,7 @@ DocumentDB::applyConfig(DocumentDBConfig::SP configSnapshot, } } if (params.shouldIndexManagerChange()) { - setIndexSchema(*configSnapshot); + setIndexSchema(*configSnapshot, serialNum); } if (!fallbackConfig) { if (_state.getRejectedConfig()) { @@ -873,10 +873,10 @@ DocumentDB::flushDone(SerialNum flushedSerial) } void -DocumentDB::setIndexSchema(const DocumentDBConfig &configSnapshot) +DocumentDB::setIndexSchema(const DocumentDBConfig &configSnapshot, SerialNum serialNum) { // Called by executor thread - _subDBs.getReadySubDB()->setIndexSchema(configSnapshot.getSchemaSP()); + _subDBs.getReadySubDB()->setIndexSchema(configSnapshot.getSchemaSP(), serialNum); // TODO: Adjust tune. } diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h index 43509cde8e3..ec1c7963dd8 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h @@ -186,7 +186,7 @@ private: reconfigureSchema(const DocumentDBConfig &configSnapshot, const DocumentDBConfig &oldConfigSnapshot); - void setIndexSchema(const DocumentDBConfig &configSnapshot); + void setIndexSchema(const DocumentDBConfig &configSnapshot, SerialNum serialNum); /** * Redo interrupted reprocessing if last entry in transaction log diff --git a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h index 075e1068690..b0e73bc5c72 100644 --- a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h @@ -123,7 +123,7 @@ public: */ virtual SerialNum getNewestFlushedSerial() = 0; virtual void wipeHistory(SerialNum wipeSerial, const Schema &wipeSchema) = 0; - virtual void setIndexSchema(const SchemaSP &schema) = 0; + virtual void setIndexSchema(const SchemaSP &schema, SerialNum serialNum) = 0; virtual search::SearchableStats getSearchableStats() const = 0; virtual std::unique_ptr<IDocumentRetriever> getDocumentRetriever() = 0; diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp index 0c63b2d32e6..2713b61880b 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp @@ -309,14 +309,14 @@ SearchableDocSubDB::wipeHistory(SerialNum wipeSerial, } void -SearchableDocSubDB::setIndexSchema(const Schema::SP &schema) +SearchableDocSubDB::setIndexSchema(const Schema::SP &schema, SerialNum serialNum) { assert(_writeService.master().isCurrentThread()); SearchView::SP oldSearchView = _rSearchView.get(); IFeedView::SP oldFeedView = _iFeedView.get(); - _indexMgr->setSchema(*schema); + _indexMgr->setSchema(*schema, serialNum); reconfigureIndexSearchable(); } diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h index 5d4bdd9e64c..9d2b45fa3ac 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h @@ -155,7 +155,7 @@ public: SerialNum getOldestFlushedSerial() override; SerialNum getNewestFlushedSerial() override; void wipeHistory(SerialNum wipeSerial, const Schema &wipeSchema) override; - void setIndexSchema(const Schema::SP &schema) override; + void setIndexSchema(const Schema::SP &schema, SerialNum serialNum) override; size_t getNumActiveDocs() const override; search::SearchableStats getSearchableStats() const override ; IDocumentRetriever::UP getDocumentRetriever() override; diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp index e1ed63dc8d8..06bcd509522 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp @@ -463,10 +463,11 @@ StoreOnlyDocSubDB::wipeHistory(SerialNum, const Schema &) } void -StoreOnlyDocSubDB::setIndexSchema(const Schema::SP &schema) +StoreOnlyDocSubDB::setIndexSchema(const Schema::SP &schema, SerialNum serialNum) { assert(_writeService.master().isCurrentThread()); (void) schema; + (void) serialNum; } search::SearchableStats diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h index 53dcb51643b..11b0db61576 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h @@ -250,7 +250,7 @@ public: SerialNum getNewestFlushedSerial() override; void wipeHistory(SerialNum wipeSerial, const Schema &wipeSchema) override; - void setIndexSchema(const Schema::SP &schema) override; + void setIndexSchema(const Schema::SP &schema, SerialNum serialNum) override; search::SearchableStats getSearchableStats() const override; IDocumentRetriever::UP getDocumentRetriever() override; matching::MatchingStats getMatcherStats(const vespalib::string &rankProfile) const override; 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 05c63a4ef48..e2638b617b3 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 @@ -82,7 +82,7 @@ struct DummyDocumentSubDb : public IDocumentSubDB SerialNum getOldestFlushedSerial() override { return 0; } SerialNum getNewestFlushedSerial() override { return 0; } void wipeHistory(SerialNum, const Schema &) override { } - void setIndexSchema(const Schema::SP &) override { } + void setIndexSchema(const Schema::SP &, SerialNum) override { } search::SearchableStats getSearchableStats() const override { return search::SearchableStats(); } diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h b/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h index b40b15eb429..34b246a1d1b 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h +++ b/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h @@ -26,7 +26,7 @@ struct MockIndexManager : public IIndexManager virtual searchcorespi::IFlushTarget::List getFlushTargets() override { return searchcorespi::IFlushTarget::List(); } - virtual void setSchema(const Schema &) override {} + virtual void setSchema(const Schema &, SerialNum) override {} virtual void wipeHistory(SerialNum) override {} virtual void heartBeat(SerialNum) override {} }; |