You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2018/02/23 00:54:45 UTC
kudu git commit: Don't perform compactions when clean time has not
been advanced
Repository: kudu
Updated Branches:
refs/heads/branch-1.5.x 4b3a5a5f4 -> 8c9dcc0ee
Don't perform compactions when clean time has not been advanced
Due to KUDU-2233 we might not advance safe time, and thus clean
time, at bootstrap causing possible corruption or crashes.
This patch adds a check to make sure that clean time has been
advanced at all before performing a compaction.
This is temporary fix until we have a more strict check like the
one proposed in https://gerrit.cloudera.org/#/c/8887/.
Change-Id: Ia74abdf7d806efc4239dc9cff4a5da28621d331a
Reviewed-on: http://gerrit.cloudera.org:8080/9397
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: David Ribeiro Alves <da...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/8c9dcc0e
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/8c9dcc0e
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/8c9dcc0e
Branch: refs/heads/branch-1.5.x
Commit: 8c9dcc0ee03db35340d2b85f4c1b95c51685784f
Parents: 4b3a5a5
Author: David Alves <dr...@apache.org>
Authored: Thu Feb 22 09:38:29 2018 -0800
Committer: David Ribeiro Alves <da...@gmail.com>
Committed: Fri Feb 23 00:45:21 2018 +0000
----------------------------------------------------------------------
src/kudu/tablet/tablet.cc | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/8c9dcc0e/src/kudu/tablet/tablet.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc
index 33a969d..59c9044 100644
--- a/src/kudu/tablet/tablet.cc
+++ b/src/kudu/tablet/tablet.cc
@@ -1560,6 +1560,13 @@ Status Tablet::Compact(CompactFlags flags) {
void Tablet::UpdateCompactionStats(MaintenanceOpStats* stats) {
+ if (mvcc_.GetCleanTimestamp() == Timestamp::kInitialTimestamp) {
+ KLOG_EVERY_N_SECS(WARNING, 30) << LogPrefix() << "Can't schedule compaction. Clean time has "
+ << "not been advanced past its initial value.";
+ stats->set_runnable(false);
+ return;
+ }
+
// TODO: use workload statistics here to find out how "hot" the tablet has
// been in the last 5 minutes, and somehow scale the compaction quality
// based on that, so we favor hot tablets.