aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirstorli@yahoo.no>2018-07-18 14:47:37 +0200
committerGitHub <noreply@github.com>2018-07-18 14:47:37 +0200
commit27b628f599ca9e3f0432ab849ea83bb6f70ed03b (patch)
tree8e5614eb7f9e90277e04f6c377c6b7b6a1f8bf64
parent02e46312ea0ec396b0d3ab52a348231518b4ac3d (diff)
parent73fbd5848eaa672488731cc1b0f6dff1ba62b297 (diff)
Merge pull request #6421 from vespa-engine/balder/compute-bloat-after-flush
Compute bloat after when it is more accurate.
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
index 6674952d202..1f5a904a514 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
@@ -296,15 +296,17 @@ LogDataStore::compact(uint64_t syncToken)
uint64_t usage = getDiskFootprint();
uint64_t bloat = getDiskBloat();
LOG(debug, "%s", bloatMsg(bloat, usage).c_str());
- if (_fileChunks.size() > 1) {
+ const bool doCompact = (_fileChunks.size() > 1);
+ if (doCompact) {
LOG(info, "%s. Will compact", bloatMsg(bloat, usage).c_str());
compactWorst(_config.getMaxDiskBloatFactor(), _config.getMaxBucketSpread());
+ }
+ flushActiveAndWait(syncToken);
+ if (doCompact) {
usage = getDiskFootprint();
bloat = getDiskBloat();
LOG(info, "Done compacting. %s", bloatMsg(bloat, usage).c_str());
}
-
- flushActiveAndWait(syncToken);
}
size_t