summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-07-18 14:31:13 +0200
committerHenning Baldersheim <balder@oath.com>2018-07-18 14:31:13 +0200
commit73fbd5848eaa672488731cc1b0f6dff1ba62b297 (patch)
tree8e5614eb7f9e90277e04f6c377c6b7b6a1f8bf64
parent02e46312ea0ec396b0d3ab52a348231518b4ac3d (diff)
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