diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-14 13:43:20 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-14 13:45:20 +0200 |
commit | 52ece4e545b53a1946ff2b6d453630d0998a53da (patch) | |
tree | 0188bec4ff33a24acf9da365de63131ece848778 /searchcore | |
parent | 01fd5e64d82224fd5efb72893c8998a1402ca528 (diff) |
Only ignore size computations for weakly consistent reads.
Diffstat (limited to 'searchcore')
3 files changed, 9 insertions, 4 deletions
diff --git a/searchcore/src/vespa/searchcore/config/proton.def b/searchcore/src/vespa/searchcore/config/proton.def index 8ecc32528d8..770c7bd960f 100644 --- a/searchcore/src/vespa/searchcore/config/proton.def +++ b/searchcore/src/vespa/searchcore/config/proton.def @@ -213,6 +213,7 @@ summary.cache.initialentries long default=0 restart summary.cache.compression.type enum {NONE, LZ4, ZSTD} default=LZ4 restart ## Control compression level of the summary while in cache. +## LZ4 has normal range 1..9 while ZSTD has range 1..19 summary.cache.compression.level int default=9 restart ## Control compression type of the summary while in memory during compaction @@ -220,13 +221,14 @@ summary.cache.compression.level int default=9 restart summary.log.compact.compression.type enum {NONE, LZ4, ZSTD} default=ZSTD restart ## Control compression level of the summary while in memory during compaction +## LZ4 has normal range 1..9 while ZSTD has range 1..19 summary.log.compact.compression.level int default=9 restart ## Control compression type of the summary -## NB So far only stragey=LOG honours it. summary.log.chunk.compression.type enum {NONE, LZ4, ZSTD} default=ZSTD restart ## Control compression level of the summary +## LZ4 has normal range 1..9 while ZSTD has range 1..19 summary.log.chunk.compression.level int default=9 restart ## Max size in bytes per chunk. @@ -366,9 +368,11 @@ maxvisibilitydelay double default=1.0 ## You can set this to a number above zero for visit to shortcut expensive serialize size computation. ## This value will be provided instead. ## negative number will compute it accurately. +## This is only used for weakly consistent visiting, like streaming search. visit.defaultserializedsize long default=1 ## This will ignore the maxbytes limit advised from above. +## This is only used for weakly consistent visiting, like streaming search. visit.ignoremaxbytes bool default=true ## Number of initializer threads used for loading structures from disk at proton startup. diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp b/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp index 5050864e25c..8260c0209a9 100644 --- a/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp +++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp @@ -80,10 +80,10 @@ DocumentIterator::DocumentIterator(const storage::spi::Bucket &bucket, _selection(selection), _versions(versions), _fields(fields.clone()), - _defaultSerializedSize(defaultSerializedSize), + _defaultSerializedSize((readConsistency == ReadConsistency::WEAK) ? defaultSerializedSize : -1), _readConsistency(readConsistency), _metaOnly(fields.getType() == document::FieldSet::NONE), - _ignoreMaxBytes(ignoreMaxBytes), + _ignoreMaxBytes((readConsistency == ReadConsistency::WEAK) && ignoreMaxBytes), _fetchedData(false), _sources(), _nextItem(0), @@ -277,7 +277,7 @@ DocumentIterator::fetchCompleteSource(const IDocumentRetriever & source, Iterate } } else { MatchVisitor visitor(matcher, metaData, lidIndexMap, _fields.get(), list, _defaultSerializedSize); - visitor.allowVisitCaching(_readConsistency == ReadConsistency::WEAK); + visitor.allowVisitCaching(isWeakRead()); source.visitDocuments(lidsToFetch, visitor, _readConsistency); } diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.h b/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.h index 1ceee910d91..2b2679a12ee 100644 --- a/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.h +++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.h @@ -36,6 +36,7 @@ private: bool checkDoc(const document::Document &doc) const; bool checkDoc(const SelectContext &sc) const; void fetchCompleteSource(const IDocumentRetriever & source, storage::spi::IterateResult::List & list); + bool isWeakRead() const { return _readConsistency == ReadConsistency::WEAK; } public: DocumentIterator(const storage::spi::Bucket &bucket, |