kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [2/2] kudu git commit: Don't perform compactions when clean time has not been advanced
Date Sat, 03 Mar 2018 06:23:12 GMT
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/9436
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: David Ribeiro Alves <davidralves@gmail.com>
(cherry picked from commit 00815045fc3295c12023fd7ae7ad220645a10c3a)
Reviewed-on: http://gerrit.cloudera.org:8080/9482
Tested-by: Kudu Jenkins
Reviewed-by: David Ribeiro Alves <davidralves@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/e8c68e6c
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/e8c68e6c
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/e8c68e6c

Branch: refs/heads/branch-1.6.x
Commit: e8c68e6c070f5bab2fd5c51cb5d0362ea43b515c
Parents: b9aa69c
Author: David Alves <dralves@apache.org>
Authored: Thu Feb 22 09:38:29 2018 -0800
Committer: Alexey Serbin <aserbin@cloudera.com>
Committed: Sat Mar 3 06:21:03 2018 +0000

----------------------------------------------------------------------
 src/kudu/tablet/tablet.cc | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/e8c68e6c/src/kudu/tablet/tablet.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc
index 4f3231f..29596b2 100644
--- a/src/kudu/tablet/tablet.cc
+++ b/src/kudu/tablet/tablet.cc
@@ -1672,6 +1672,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.


Mime
View raw message