summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
index 3af7338d73a..f2c4e12488a 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
@@ -330,21 +330,6 @@ LogDataStore::initFlush(uint64_t syncToken)
return syncToken;
}
-double
-LogDataStore::getMaxBucketSpread() const
-{
- double maxSpread(1.0);
- MonitorGuard guard(_updateLock);
- for (const auto & fc : _fileChunks) {
- if (fc) {
- if (_bucketizer && fc->frozen()) {
- maxSpread = std::max(maxSpread, fc->getBucketSpread());
- }
- }
- }
- return maxSpread;
-}
-
std::pair<bool, LogDataStore::FileId>
LogDataStore::findNextToCompact(bool dueToBloat)
{
@@ -579,6 +564,22 @@ LogDataStore::getDiskHeaderFootprint() const
return sz;
}
+double
+LogDataStore::getMaxBucketSpread() const
+{
+ double maxSpread(1.0);
+ MonitorGuard guard(_updateLock);
+ for (FileId i(0); i < FileId(_fileChunks.size()); i = i.next()) {
+ /// Ignore the the active file as it is never considered for reordering until completed and frozen.
+ if (i != _active) {
+ const auto & fc = _fileChunks[i.getId()];
+ if (fc && _bucketizer && fc->frozen()) {
+ maxSpread = std::max(maxSpread, fc->getBucketSpread());
+ }
+ }
+ }
+ return maxSpread;
+}
size_t
LogDataStore::getDiskBloat() const
@@ -586,7 +587,8 @@ LogDataStore::getDiskBloat() const
MonitorGuard guard(_updateLock);
size_t sz(0);
for (FileId i(0); i < FileId(_fileChunks.size()); i = i.next()) {
- /// Do not count the holes in the last file as bloat
+ /// Do not count the holes in the last file as bloat as it is
+ /// never considered for compaction until completed and frozen.
if (i != _active) {
const auto & chunk = _fileChunks[i.getId()];
if (chunk) {