summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2020-05-08 14:17:04 +0000
committerGeir Storli <geirst@verizonmedia.com>2020-05-08 14:17:04 +0000
commitf0605b161d496ff8419d046a6db5f67958aab71f (patch)
treea7703ab24334fc027d846be6c678ee5b9ccfc073 /searchcore
parente32a44adbf547e9cf3c0baa432dfcad696755a26 (diff)
Improve log messages for when job is blocked/un-blocked/disabled/re-enabled.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp20
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.h1
2 files changed, 16 insertions, 5 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp
index bd53810e14b..fece3dce003 100644
--- a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp
@@ -121,7 +121,8 @@ LidSpaceCompactionJob::LidSpaceCompactionJob(const DocumentDBLidSpaceCompactionC
_diskMemUsageNotifier(diskMemUsageNotifier),
_clusterStateChangedNotifier(clusterStateChangedNotifier),
_ops_rate_tracker(std::make_shared<RemoveOperationsRateTracker>(config.get_remove_batch_block_rate(),
- config.get_remove_block_rate()))
+ config.get_remove_block_rate())),
+ _is_disabled(false)
{
_diskMemUsageNotifier.addDiskMemUsageListener(this);
_clusterStateChangedNotifier.addClusterStateChangedHandler(this);
@@ -146,14 +147,23 @@ LidSpaceCompactionJob::run()
LidUsageStats stats = _handler.getLidStatus();
if (remove_batch_is_ongoing()) {
// Note that we don't set the job as blocked as the decision to un-block it is not driven externally.
- LOG(info, "run(): Lid space compaction is disabled while remove batch (delete buckets) is ongoing");
+ LOG(info, "%s: Lid space compaction is disabled while remove batch (delete buckets) is ongoing",
+ _handler.getName().c_str());
+ _is_disabled = true;
return true;
}
if (remove_is_ongoing()) {
// Note that we don't set the job as blocked as the decision to un-block it is not driven externally.
- LOG(info, "run(): Lid space compaction is disabled while remove operations are ongoing");
+ LOG(info, "%s: Lid space compaction is disabled while remove operations are ongoing",
+ _handler.getName().c_str());
+ _is_disabled = true;
return true;
}
+ if (_is_disabled) {
+ LOG(info, "%s: Lid space compaction is re-enabled as remove operations are no longer ongoing",
+ _handler.getName().c_str());
+ _is_disabled = false;
+ }
if (_scanItr) {
return scanDocuments(stats);
} else if (_shouldCompactLidSpace) {
@@ -180,11 +190,11 @@ LidSpaceCompactionJob::notifyClusterStateChanged(const IBucketStateCalculator::S
bool nodeRetired = newCalc->nodeRetired();
if (!nodeRetired) {
if (isBlocked(BlockedReason::CLUSTER_STATE)) {
- LOG(info, "notifyClusterStateChanged(): Node is no longer retired -> lid space compaction job re-enabled");
+ LOG(info, "%s: Lid space compaction is un-blocked as node is no longer retired", _handler.getName().c_str());
unBlock(BlockedReason::CLUSTER_STATE);
}
} else {
- LOG(info, "notifyClusterStateChanged(): Node is retired -> lid space compaction job disabled");
+ LOG(info, "%s: Lid space compaction is blocked as node is retired", _handler.getName().c_str());
setBlocked(BlockedReason::CLUSTER_STATE);
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.h b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.h
index 9171fe7472e..37497eaa998 100644
--- a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.h
+++ b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.h
@@ -39,6 +39,7 @@ private:
IDiskMemUsageNotifier &_diskMemUsageNotifier;
IClusterStateChangedNotifier &_clusterStateChangedNotifier;
std::shared_ptr<RemoveOperationsRateTracker> _ops_rate_tracker;
+ bool _is_disabled;
bool hasTooMuchLidBloat(const search::LidUsageStats &stats) const;
bool shouldRestartScanDocuments(const search::LidUsageStats &stats) const;