diff options
author | Tor Egge <Tor.Egge@online.no> | 2021-11-10 14:19:55 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2021-11-10 14:53:14 +0100 |
commit | 634dc8044870d056eb4dfaae7b4f6b7e7f81649c (patch) | |
tree | 268462246a620418cf5e635480afb5c32448558f /searchcorespi | |
parent | 8dcbd10ee9d81cd546b8cfffef42e0f4198ed172 (diff) |
Keep write context live until inverter thread has completed invert task.
Diffstat (limited to 'searchcorespi')
4 files changed, 5 insertions, 5 deletions
diff --git a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h index 02adcbc11ce..5bd618d16a6 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h +++ b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h @@ -94,7 +94,7 @@ public: * @param serialNum The unique monotoninc increasing serial number * for this operation. **/ - virtual void putDocument(uint32_t lid, const Document &doc, SerialNum serialNum) = 0; + virtual void putDocument(uint32_t lid, const Document &doc, SerialNum serialNum, OnWriteDoneType on_write_done) = 0; /** * Removes the given document from the index. This method is diff --git a/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h b/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h index bff929206a0..d502d290ea4 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h +++ b/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h @@ -43,7 +43,7 @@ struct IMemoryIndex : public searchcorespi::IndexSearchable { * @param lid the local document id. * @param doc the document to insert. */ - virtual void insertDocument(uint32_t lid, const document::Document &doc) = 0; + virtual void insertDocument(uint32_t lid, const document::Document &doc, OnWriteDoneType on_write_done) = 0; /** * Removes the given document from this memory index. diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp index 74848e93411..839618afb4d 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp @@ -1165,12 +1165,12 @@ IndexMaintainer::getNumFrozenMemoryIndexes(void) const } void -IndexMaintainer::putDocument(uint32_t lid, const Document &doc, SerialNum serialNum) +IndexMaintainer::putDocument(uint32_t lid, const Document &doc, SerialNum serialNum, OnWriteDoneType on_write_done) { assert(_ctx.getThreadingService().index().isCurrentThread()); LockGuard lock(_index_update_lock); try { - _current_index->insertDocument(lid, doc); + _current_index->insertDocument(lid, doc, on_write_done); } catch (const vespalib::IllegalStateException & e) { vespalib::string s = "Failed inserting document :\n" + doc.toXml(" ") + "\n"; LOG(error, "%s", s.c_str()); diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h index 816ec76cd1f..55f05410108 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h @@ -324,7 +324,7 @@ public: vespalib::system_time getLastFlushTime() const { return _lastFlushTime; } // Implements IIndexManager - void putDocument(uint32_t lid, const Document &doc, SerialNum serialNum) override; + void putDocument(uint32_t lid, const Document &doc, SerialNum serialNum, OnWriteDoneType on_write_done) override; void removeDocuments(LidVector lids, SerialNum serialNum) override; void commit(SerialNum serialNum, OnWriteDoneType onWriteDone) override; void heartBeat(search::SerialNum serialNum) override; |