aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-04-27 15:46:43 +0200
committerTor Egge <Tor.Egge@online.no>2022-04-27 15:46:43 +0200
commite1f8d2842614f7b7f8be52c0c2fe951b0f48ebe4 (patch)
treefc2f02f1ae6271afbe4b38869e2ac0ecfef7444e /searchlib
parent984622d4a13315c1080f999ca513f7dc1c6dd425 (diff)
Use atomic _compactLidSpaceGeneration in search::AttributeVector.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
index 1edd5d9fe76..73ff91f135c 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
@@ -528,7 +528,7 @@ AttributeVector::compactLidSpace(uint32_t wantedLidLimit) {
}
commit();
_committedDocIdLimit.store(wantedLidLimit, std::memory_order_release);
- _compactLidSpaceGeneration = _genHandler.getCurrentGeneration();
+ _compactLidSpaceGeneration.store(_genHandler.getCurrentGeneration(), std::memory_order_relaxed);
incGeneration();
}
@@ -536,7 +536,7 @@ AttributeVector::compactLidSpace(uint32_t wantedLidLimit) {
bool
AttributeVector::canShrinkLidSpace() const {
return wantShrinkLidSpace() &&
- _compactLidSpaceGeneration < getFirstUsedGeneration();
+ _compactLidSpaceGeneration.load(std::memory_order_relaxed) < getFirstUsedGeneration();
}
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h
index 5f336ab921f..b40f36ad6bd 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.h
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h
@@ -501,7 +501,7 @@ private:
std::atomic<uint32_t> _committedDocIdLimit; // docid limit for search
uint32_t _uncommittedDocIdLimit; // based on queued changes
uint64_t _createSerialNum;
- uint64_t _compactLidSpaceGeneration;
+ std::atomic<uint64_t> _compactLidSpaceGeneration;
bool _hasEnum;
bool _loaded;
bool _isUpdateableInMemoryOnly;