diff options
author | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-04-26 09:57:45 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-04-26 13:00:12 +0000 |
commit | cf46565283f92c3dc3fe778be2045f82a7544797 (patch) | |
tree | 46c8aadbf80ef25518dcc35d82155ccc48d147fc /searchcorespi/src | |
parent | bcf40a691b7412ff847c24921d01ef2a0d298ab3 (diff) |
Wipe removed fields when setting up index manager.
Diffstat (limited to 'searchcorespi/src')
3 files changed, 11 insertions, 0 deletions
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp index 1d0bd08ea98..dfe5eaf67a1 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp @@ -13,6 +13,7 @@ #include <vespa/searchlib/util/filekit.h> #include <vespa/vespalib/util/autoclosurecaller.h> #include <vespa/vespalib/util/closuretask.h> +#include <vespa/searchlib/common/lambdatask.h> #include <sstream> #include <vespa/searchcorespi/flush/closureflushtask.h> #include <vespa/vespalib/util/exceptions.h> @@ -30,6 +31,7 @@ using search::common::FileHeaderContext; using search::queryeval::ISourceSelector; using search::queryeval::Source; using search::SerialNum; +using search::makeLambdaTask; using std::ostringstream; using vespalib::makeClosure; using vespalib::makeTask; @@ -869,6 +871,8 @@ IndexMaintainer::IndexMaintainer(const IndexMaintainerConfig &config, sourceList->setCurrentIndex(_current_index_id); _source_list = std::move(sourceList); _fusion_spec = spec; + _ctx.getThreadingService().master().execute(makeLambdaTask([this,&config]() {internalWipeHistory(_schema, config.getSerialNum()); })); + _ctx.getThreadingService().master().sync(); } IndexMaintainer::~IndexMaintainer() diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp index bb9bed17360..84ce5b77bef 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp @@ -15,11 +15,13 @@ IndexMaintainerConfig::IndexMaintainerConfig(const vespalib::string &baseDir, const WarmupConfig & warmup, size_t maxFlushed, const Schema &schema, + const search::SerialNum serialNum, const TuneFileAttributes &tuneFileAttributes) : _baseDir(baseDir), _warmup(warmup), _maxFlushed(maxFlushed), _schema(schema), + _serialNum(serialNum), _tuneFileAttributes(tuneFileAttributes) { } diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h index 9176ae1fd31..ea51399bcd7 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h @@ -3,6 +3,7 @@ #include <vespa/searchcommon/common/schema.h> #include <vespa/searchlib/common/tunefileinfo.h> +#include <vespa/searchlib/common/serialnum.h> #include <vespa/vespalib/stllike/string.h> #include "warmupconfig.h" @@ -18,6 +19,7 @@ private: const WarmupConfig _warmup; const size_t _maxFlushed; const search::index::Schema _schema; + const search::SerialNum _serialNum; const search::TuneFileAttributes _tuneFileAttributes; public: @@ -25,6 +27,7 @@ public: const WarmupConfig & warmup, size_t maxFlushed, const search::index::Schema &schema, + const search::SerialNum serialNum, const search::TuneFileAttributes &tuneFileAttributes); /** @@ -43,6 +46,8 @@ public: return _schema; } + search::SerialNum getSerialNum() const { return _serialNum; } + /** * Returns the specification on how to read/write attribute vector data files. */ |