diff options
author | Geir Storli <geirst@yahooinc.com> | 2022-10-13 14:44:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-13 14:44:00 +0200 |
commit | f2b3ed1ec55679cfb5508dfe2a58326475c895d4 (patch) | |
tree | dd0d5007662c2c2fe3e90ca7f1e5dd3455ae12f9 /searchlib | |
parent | 0a0a41976464257594627231f038563b78f87224 (diff) | |
parent | e29cee68089fb2558a01712c6b365a46279be1fb (diff) |
Merge pull request #24427 from vespa-engine/geirst/generation-hold-list-terminology
Align terminology on generation hold lists in attribute vector code
Diffstat (limited to 'searchlib')
15 files changed, 18 insertions, 22 deletions
diff --git a/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp b/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp index b89a3827cc2..b9c70d76934 100644 --- a/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp +++ b/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp @@ -145,7 +145,6 @@ DocumentWeightOrFilterSearchTest::inc_generation() _postings.freeze(); _postings.assign_generation(_gens.getCurrentGeneration()); _gens.incGeneration(); - _gens.update_oldest_used_generation(); _postings.reclaim_memory(_gens.get_oldest_used_generation()); } diff --git a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp index 958423860e5..9fccad1d2d4 100644 --- a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp +++ b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp @@ -101,7 +101,6 @@ public: void commit() { index->assign_generation(gen_handler.getCurrentGeneration()); gen_handler.incGeneration(); - gen_handler.update_oldest_used_generation(); index->reclaim_memory(gen_handler.get_oldest_used_generation()); } void set_filter(std::vector<uint32_t> docids) { diff --git a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp index 47812c2a63c..81b56909d57 100644 --- a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp +++ b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp @@ -269,7 +269,6 @@ public: void commit(uint32_t docid) { index->assign_generation(gen_handler.getCurrentGeneration()); gen_handler.incGeneration(); - gen_handler.update_oldest_used_generation(); index->reclaim_memory(gen_handler.get_oldest_used_generation()); std::lock_guard<std::mutex> guard(in_progress_lock); in_progress->clearBit(docid); diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index 100470b5a5f..7f8f3f92f9e 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -187,7 +187,7 @@ AttributeVector::incGeneration() before_inc_generation(_genHandler.getCurrentGeneration()); _genHandler.incGeneration(); // Remove old data on hold lists that can no longer be reached by readers - removeAllOldGenerations(); + reclaim_unused_memory(); } void @@ -408,7 +408,7 @@ bool AttributeVector::applyWeight(DocId, const FieldValue &, const ArithmeticVal bool AttributeVector::applyWeight(DocId, const FieldValue&, const AssignValueUpdate&) { return false; } void -AttributeVector::removeAllOldGenerations() { +AttributeVector::reclaim_unused_memory() { _genHandler.update_oldest_used_generation(); reclaim_memory(_genHandler.get_oldest_used_generation()); } @@ -493,7 +493,7 @@ void AttributeVector::shrinkLidSpace() { commit(); - removeAllOldGenerations(); + reclaim_unused_memory(); if (!canShrinkLidSpace()) { return; } @@ -715,7 +715,7 @@ AttributeVector::drain_hold(uint64_t hold_limit) { incGeneration(); for (int retry = 0; retry < 40; ++retry) { - removeAllOldGenerations(); + reclaim_unused_memory(); updateStat(true); if (_status.getOnHold() <= hold_limit) { return; diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index 6963814be0c..261290247ad 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -156,7 +156,7 @@ protected: public: void incGeneration(); - void removeAllOldGenerations(); + void reclaim_unused_memory(); generation_t get_oldest_used_generation() const { return _genHandler.get_oldest_used_generation(); diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp index 4dad82073e0..e4e451ffcda 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp @@ -147,7 +147,7 @@ MultiValueEnumAttribute<B, M>::onCommit() updater.commit(); this->freezeEnumDictionary(); std::atomic_thread_fence(std::memory_order_release); - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); if (this->_mvMapping.considerCompact(this->getConfig().getCompactionStrategy())) { this->incGeneration(); this->updateStat(true); diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp index b746fa5d555..6dde909821e 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp @@ -63,7 +63,7 @@ MultiValueNumericAttribute<B, M>::onCommit() } std::atomic_thread_fence(std::memory_order_release); - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); this->_changes.clear(); if (this->_mvMapping.considerCompact(this->getConfig().getCompactionStrategy())) { diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp index 2066b6fa845..2456c57140c 100644 --- a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp @@ -245,7 +245,7 @@ MultiValueAttribute<B, M>::addDoc(DocId & doc) if (incGen) { this->incGeneration(); } else - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); return true; } diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp index e620d3aca72..fcee60ddac5 100644 --- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp @@ -87,7 +87,7 @@ ReferenceAttribute::addDoc(DocId &doc) if (incGen) { incGeneration(); } else { - removeAllOldGenerations(); + reclaim_unused_memory(); } return true; } diff --git a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp index ac05ab3b7c6..15fc819300c 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp @@ -53,7 +53,7 @@ SingleBoolAttribute::addDoc(DocId & doc) { incNumDocs(); doc = getNumDocs() - 1; updateUncommittedDocIdLimit(doc); - removeAllOldGenerations(); + reclaim_unused_memory(); return true; } @@ -80,7 +80,7 @@ SingleBoolAttribute::onCommit() { } std::atomic_thread_fence(std::memory_order_release); - removeAllOldGenerations(); + reclaim_unused_memory(); _changes.clear(); } diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp index dd400295b3d..52e2d914af1 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp @@ -66,7 +66,7 @@ SingleValueEnumAttribute<B>::addDoc(DocId & doc) if (incGen) { this->incGeneration(); } else - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); return true; } @@ -95,7 +95,7 @@ SingleValueEnumAttribute<B>::onCommit() updater.commit(); freezeEnumDictionary(); std::atomic_thread_fence(std::memory_order_release); - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); auto remapper = this->_enumStore.consider_compact_values(this->getConfig().getCompactionStrategy()); if (remapper) { remap_enum_store_refs(*remapper, *this); diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp index 66af5fe4adc..a105d980986 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp @@ -55,7 +55,7 @@ SingleValueNumericAttribute<B>::onCommit() } } - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); this->_changes.clear(); } @@ -89,7 +89,7 @@ SingleValueNumericAttribute<B>::addDoc(DocId & doc) { if (incGen) { this->incGeneration(); } else - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); return true; } diff --git a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp index b2662a0928d..13bf2f932e8 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp @@ -67,7 +67,7 @@ SingleValueSmallNumericAttribute::onCommit() } std::atomic_thread_fence(std::memory_order_release); - removeAllOldGenerations(); + reclaim_unused_memory(); _changes.clear(); } @@ -84,7 +84,7 @@ SingleValueSmallNumericAttribute::addDoc(DocId & doc) { if (incGen) { this->incGeneration(); } else - this->removeAllOldGenerations(); + this->reclaim_unused_memory(); } else { B::incNumDocs(); doc = B::getNumDocs() - 1; diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp index 0e7e492c954..381bf0715b0 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp @@ -958,7 +958,6 @@ LogDataStore::incGeneration() { _lidInfo.setGeneration(_genHandler.getNextGeneration()); _genHandler.incGeneration(); - _genHandler.update_oldest_used_generation(); _lidInfo.reclaim_memory(_genHandler.get_oldest_used_generation()); } diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp index 6130da6fcf9..f29751cdabe 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp @@ -134,7 +134,7 @@ TensorAttribute::addDoc(DocId &docId) if (incGen) { incGeneration(); } else { - removeAllOldGenerations(); + reclaim_unused_memory(); } return true; } |