You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2018/06/14 23:40:56 UTC

[1/4] kudu git commit: [docs] Update ksck documentation

Repository: kudu
Updated Branches:
  refs/heads/master 8bec7d35a -> b5f3d1a10


[docs] Update ksck documentation

Change-Id: I14919a1dc552468a7edb49039c1e4a2af8f515ad
Reviewed-on: http://gerrit.cloudera.org:8080/10708
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


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

Branch: refs/heads/master
Commit: c00873171cca50414676219720f194747aa89a92
Parents: 8bec7d3
Author: Will Berkeley <wd...@apache.org>
Authored: Wed Jun 13 13:47:13 2018 -0700
Committer: Will Berkeley <wd...@gmail.com>
Committed: Wed Jun 13 21:30:29 2018 +0000

----------------------------------------------------------------------
 docs/administration.adoc | 104 ++++++++++++++++++++++++++++--------------
 1 file changed, 69 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/c0087317/docs/administration.adoc
----------------------------------------------------------------------
diff --git a/docs/administration.adoc b/docs/administration.adoc
index 4c28669..6ff54a4 100644
--- a/docs/administration.adoc
+++ b/docs/administration.adoc
@@ -647,13 +647,13 @@ To verify that all masters are working properly, perform the following sanity ch
 [[ksck]]
 === Checking Cluster Health with `ksck`
 
-The `kudu` CLI includes a tool named `ksck` which can be used for checking
-cluster health and data integrity. `ksck` will identify issues such as
-under-replicated tablets, unreachable tablet servers, or tablets without a
-leader.
+The `kudu` CLI includes a tool named `ksck` that can be used for gathering
+information about the state of a Kudu cluster, including checking its health.
+`ksck` will identify issues such as under-replicated tablets, unreachable
+tablet servers, or tablets without a leader.
 
-`ksck` should be run from the command line, and requires the full list of master
-addresses to be specified:
+`ksck` should be run from the command line as the Kudu admin user, and requires
+the full list of master addresses to be specified:
 
 [source,bash]
 ----
@@ -661,55 +661,89 @@ $ sudo -u kudu kudu cluster ksck master-01.example.com,master-02.example.com,mas
 ----
 
 To see a full list of the options available with `ksck`, use the `--help` flag.
-If the cluster is healthy, `ksck` will print a success message, and return a
-zero (success) exit status.
-
-----
-Connected to the Master
-Fetched info from all 1 Tablet Servers
-Table IntegrationTestBigLinkedList is HEALTHY (1 tablet(s) checked)
-
-The metadata for 1 table(s) is HEALTHY
+If the cluster is healthy, `ksck` will print information about the cluster, a
+success message, and return a zero (success) exit status.
+
+----
+Master Summary
+               UUID               |       Address         | Status
+----------------------------------+-----------------------+---------
+ a811c07b99394df799e6650e7310f282 | master-01.example.com | HEALTHY
+ b579355eeeea446e998606bcb7e87844 | master-02.example.com | HEALTHY
+ cfdcc8592711485fad32ec4eea4fbfcd | master-02.example.com | HEALTHY
+
+Tablet Server Summary
+               UUID               |        Address         | Status
+----------------------------------+------------------------+---------
+ a598f75345834133a39c6e51163245db | tserver-01.example.com | HEALTHY
+ e05ca6b6573b4e1f9a518157c0c0c637 | tserver-02.example.com | HEALTHY
+ e7e53a91fe704296b3a59ad304e7444a | tserver-03.example.com | HEALTHY
+
+Version Summary
+ Version |      Servers
+---------+-------------------------
+  1.7.1  | all 6 server(s) checked
+
+Summary by table
+   Name   | RF | Status  | Total Tablets | Healthy | Recovering | Under-replicated | Unavailable
+----------+----+---------+---------------+---------+------------+------------------+-------------
+ my_table | 3  | HEALTHY | 8             | 8       | 0          | 0                | 0
+
+                | Total Count
+----------------+-------------
+ Masters        | 3
+ Tablet Servers | 3
+ Tables         | 1
+ Tablets        | 8
+ Replicas       | 24
 OK
 ----
 
 If the cluster is unhealthy, for instance if a tablet server process has
-stopped, `ksck` will report the issue(s) and return a non-zero exit status:
+stopped, `ksck` will report the issue(s) and return a non-zero exit status, as
+shown in the abbreviated snippet of `ksck` output below:
 
 ----
-Connected to the Master
-WARNING: Unable to connect to Tablet Server 8a0b66a756014def82760a09946d1fce
-(tserver-01.example.com:7050): Network error: could not send Ping RPC to server: Client connection negotiation failed: client connection to 192.168.0.2:7050: connect: Connection refused (error 61)
-WARNING: Fetched info from 0 Tablet Servers, 1 weren't reachable
-Tablet ce3c2d27010d4253949a989b9d9bf43c of table 'IntegrationTestBigLinkedList'
-is unavailable: 1 replica(s) not RUNNING
-  8a0b66a756014def82760a09946d1fce (tserver-01.example.com:7050): TS unavailable [LEADER]
+Tablet Server Summary
+               UUID               |        Address         |   Status
+----------------------------------+------------------------+-------------
+ a598f75345834133a39c6e51163245db | tserver-01.example.com | HEALTHY
+ e05ca6b6573b4e1f9a518157c0c0c637 | tserver-02.example.com | HEALTHY
+ e7e53a91fe704296b3a59ad304e7444a | tserver-03.example.com | UNAVAILABLE
+Error from 127.0.0.1:7150: Network error: could not get status from server: Client connection negotiation failed: client connection to 127.0.0.1:7150: connect: Connection refused (error 61) (UNAVAILABLE)
 
-  Table IntegrationTestBigLinkedList has 1 unavailable tablet(s)
+... (full output elided)
 
-  WARNING: 1 out of 1 table(s) are not in a healthy state
-  ==================
-  Errors:
-  ==================
-  error fetching info from tablet servers: Network error: Not all Tablet Servers are reachable
-  table consistency check error: Corruption: 1 table(s) are bad
+==================
+Errors:
+==================
+Network error: error fetching info from tablet servers: failed to gather info for all tablet servers: 1 of 3 had errors
+Corruption: table consistency check error: 1 out of 1 table(s) are not healthy
 
-  FAILED
-  Runtime error: ksck discovered errors
+FAILED
+Runtime error: ksck discovered errors
 ----
 
 To verify data integrity, the optional `--checksum_scan` flag can be set, which
 will ensure the cluster has consistent data by scanning each tablet replica and
 comparing results. The `--tables` or `--tablets` flags can be used to limit the
 scope of the checksum scan to specific tables or tablets, respectively. For
-example, checking data integrity on the `IntegrationTestBigLinkedList` table can
-be done with the following command:
+example, checking data integrity on the `my_table` table can be done with the
+following command:
 
 [source,bash]
 ----
-$ sudo -u kudu kudu cluster ksck --checksum_scan --tables IntegrationTestBigLinkedList master-01.example.com,master-02.example.com,master-03.example.com
+$ sudo -u kudu kudu cluster ksck --checksum_scan --tables my_table master-01.example.com,master-02.example.com,master-03.example.com
 ----
 
+By default, `ksck` will attempt to use a snapshot scan of the table, so the
+checksum scan can be done while writes continue.
+
+Finally, `ksck` also supports output in JSON format using the `--ksck_format`
+flag. JSON output contains the same information as the plain text output, but
+in a format that can be used by other tools. See `kudu cluster ksck --help` for
+more information.
+
 [[change_dir_config]]
 === Changing Directory Configurations
 


[4/4] kudu git commit: python client: Fix typo in method name

Posted by mp...@apache.org.
python client: Fix typo in method name

Rename ScanTokenBuilder.set_timout_millis() to set_timeout_millis().

The original method has not been removed, but noted as deprecated. It
should be removed in a future release.

Change-Id: I88d640ab4184ba750796b4c929de4b8a762b6570
Reviewed-on: http://gerrit.cloudera.org:8080/10721
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: b5f3d1a10aa51c623f074eb6852149d304676c7b
Parents: c12e635
Author: Mike Percy <mp...@apache.org>
Authored: Thu Jun 14 15:11:41 2018 -0700
Committer: Mike Percy <mp...@apache.org>
Committed: Thu Jun 14 23:39:26 2018 +0000

----------------------------------------------------------------------
 python/kudu/client.pyx | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b5f3d1a1/python/kudu/client.pyx
----------------------------------------------------------------------
diff --git a/python/kudu/client.pyx b/python/kudu/client.pyx
index 5997bee..afa7e8d 100644
--- a/python/kudu/client.pyx
+++ b/python/kudu/client.pyx
@@ -2162,9 +2162,9 @@ cdef class ScanTokenBuilder:
 
         return self
 
-    def set_timout_millis(self, millis):
+    def set_timeout_millis(self, millis):
         """
-        Sets the timeout in milliseconds.
+        Sets the scan request timeout in milliseconds.
         Returns a reference to itself to facilitate chaining.
 
         Parameters
@@ -2179,6 +2179,15 @@ cdef class ScanTokenBuilder:
         check_status(self._builder.SetTimeoutMillis(millis))
         return self
 
+    def set_timout_millis(self, millis):
+        """
+        See set_timeout_millis().
+
+        This method is deprecated due to having a typo in the method name and
+        will be removed in a future release.
+        """
+        return self.set_timeout_millis(millis)
+
     def set_fault_tolerant(self):
         """
         Makes the underlying KuduScanner fault tolerant.


[3/4] kudu git commit: [tools] Add simple util for version parsing

Posted by mp...@apache.org.
[tools] Add simple util for version parsing

This adds a struct and parsing function to parse versions of the form

<major>.<minor>.<maintenance>-<extra>

This can be used along with ksck's version reporting or ad hoc
version-gathering to determine how a tool should function when operating
against a cluster running certain Kudu versions.

Its first application will be in a follow-up.

Change-Id: I0bcf3b10b699e89ad489144611990702dec8af19
Reviewed-on: http://gerrit.cloudera.org:8080/10698
Tested-by: Will Berkeley <wd...@gmail.com>
Reviewed-by: Adar Dembo <ad...@cloudera.com>


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

Branch: refs/heads/master
Commit: c12e63528a2f2c265136e702a48cbc6c93b7f2fd
Parents: 5e70553
Author: Will Berkeley <wd...@apache.org>
Authored: Mon Jun 11 16:49:43 2018 -0700
Committer: Will Berkeley <wd...@gmail.com>
Committed: Thu Jun 14 19:55:57 2018 +0000

----------------------------------------------------------------------
 src/kudu/util/CMakeLists.txt       |  2 +
 src/kudu/util/version_util-test.cc | 66 ++++++++++++++++++++++++++
 src/kudu/util/version_util.cc      | 83 +++++++++++++++++++++++++++++++++
 src/kudu/util/version_util.h       | 58 +++++++++++++++++++++++
 4 files changed, 209 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/c12e6352/src/kudu/util/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/util/CMakeLists.txt b/src/kudu/util/CMakeLists.txt
index afaef7d..044660c 100644
--- a/src/kudu/util/CMakeLists.txt
+++ b/src/kudu/util/CMakeLists.txt
@@ -199,6 +199,7 @@ set(UTIL_SRCS
   user.cc
   url-coding.cc
   version_info.cc
+  version_util.cc
   website_util.cc
   zlib.cc
 )
@@ -403,6 +404,7 @@ ADD_KUDU_TEST(throttler-test)
 ADD_KUDU_TEST(trace-test PROCESSORS 4)
 ADD_KUDU_TEST(url-coding-test)
 ADD_KUDU_TEST(user-test)
+ADD_KUDU_TEST(version_util-test)
 
 if (NOT APPLE)
   ADD_KUDU_TEST(minidump-test)

http://git-wip-us.apache.org/repos/asf/kudu/blob/c12e6352/src/kudu/util/version_util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/version_util-test.cc b/src/kudu/util/version_util-test.cc
new file mode 100644
index 0000000..54e8e76
--- /dev/null
+++ b/src/kudu/util/version_util-test.cc
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+#include "kudu/util/version_util.h"
+
+#include <string>
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
+#include "kudu/util/test_util.h"
+
+using std::string;
+using std::vector;
+
+namespace kudu {
+
+class VersionUtilTest : public KuduTest {};
+
+TEST_F(VersionUtilTest, TestVersion) {
+  const vector<Version> good_test_cases = {
+    { "0.0.0", 0, 0, 0, "" },
+    { "1.0.0", 1, 0, 0, "" },
+    { "1.1.0", 1, 1, 0, "" },
+    { "1.1.1", 1, 1, 1, "" },
+    { "1.10.100-1000", 1, 10, 100, "1000" },
+    { "1.2.3-SNAPSHOT", 1, 2, 3, "SNAPSHOT" },
+  };
+
+  Version v;
+  for (const auto& test_case : good_test_cases) {
+    ASSERT_OK(ParseVersion(test_case.raw_version, &v));
+    EXPECT_EQ(test_case, v);
+  }
+
+  const vector<string> bad_test_cases = {
+    "",
+    "foo",
+    "foo.1.0",
+    "1.bar.0",
+    "1.0.foo",
+    "1.0foo.bar",
+    "foo5-1.4.3",
+  };
+
+  for (const auto& test_case : bad_test_cases) {
+    ASSERT_TRUE(ParseVersion(test_case, &v).IsInvalidArgument());
+  }
+}
+
+} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/c12e6352/src/kudu/util/version_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/version_util.cc b/src/kudu/util/version_util.cc
new file mode 100644
index 0000000..bd298f8
--- /dev/null
+++ b/src/kudu/util/version_util.cc
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "kudu/util/version_util.h"
+
+#include <iostream>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <glog/logging.h>
+
+#include "kudu/gutil/strings/numbers.h"
+#include "kudu/gutil/strings/split.h"
+#include "kudu/gutil/strings/substitute.h"
+#include "kudu/util/status.h"
+
+using std::ostream;
+using std::string;
+using std::vector;
+using strings::Split;
+using strings::Substitute;
+
+namespace kudu {
+
+bool Version::operator==(const Version& other) const {
+  return this->major == other.major &&
+         this->minor == other.minor &&
+         this->maintenance == other.maintenance &&
+         this->extra == other.extra;
+}
+
+string Version::ToString() const {
+  return raw_version;
+}
+
+ostream& operator<<(ostream& os, const Version& v) {
+  return os << v.ToString();
+}
+
+Status ParseVersion(const string& version_str,
+                    Version* v) {
+  CHECK(v);
+  const Status invalid_ver_err =
+      Status::InvalidArgument("invalid version string", version_str);
+  Version temp_v;
+  const vector<string> main_and_extra = Split(version_str, "-");
+  if (main_and_extra.empty() || main_and_extra.size() > 2) {
+    return invalid_ver_err;
+  }
+  if (main_and_extra.size() == 2) {
+    temp_v.extra = main_and_extra[1];
+  }
+  const auto& main_ver_str = main_and_extra[0];
+  const vector<string> maj_min_maint = Split(main_ver_str, ".");
+  if (maj_min_maint.size() != 3) {
+    return invalid_ver_err;
+  }
+  if (!SimpleAtoi(maj_min_maint[0], &temp_v.major) ||
+      !SimpleAtoi(maj_min_maint[1], &temp_v.minor) ||
+      !SimpleAtoi(maj_min_maint[2], &temp_v.maintenance)) {
+    return invalid_ver_err;
+  }
+  temp_v.raw_version = version_str;
+  *v = std::move(temp_v);
+  return Status::OK();
+}
+
+} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/c12e6352/src/kudu/util/version_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/version_util.h b/src/kudu/util/version_util.h
new file mode 100644
index 0000000..5cde6cc
--- /dev/null
+++ b/src/kudu/util/version_util.h
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+#pragma once
+
+#include <iostream>
+#include <string>
+
+#include "kudu/util/status.h"
+
+namespace kudu {
+
+// A struct representing a parsed version. Versions are expected to look like
+//
+//  <major>.<minor>.<maintenance>[-<extra>]
+//
+// e.g. 1.6.0 or 1.7.1-SNAPSHOT.
+//
+// This struct can be used with versions reported by ksck to determine if and
+// how certain tools should function depending on what versions are running in
+// the cluster.
+struct Version {
+  bool operator==(const Version& other) const;
+
+  std::string ToString() const;
+
+  // The original version string.
+  std::string raw_version;
+
+  // The parsed version numbers.
+  int major;
+  int minor;
+  int maintenance;
+
+  // The extra component. Empty if there was no extra component.
+  std::string extra;
+};
+
+std::ostream& operator<<(std::ostream& os, const Version& v);
+
+// Parse 'version_str' into 'v'. 'v' must not be null.
+Status ParseVersion(const std::string& version_str,
+                    Version* v);
+
+} // namespace kudu


[2/4] kudu git commit: Fix ksck checksum_scan printing

Posted by mp...@apache.org.
Fix ksck checksum_scan printing

I removed the checksum progress summary line when the ksck_format is
json_pretty or json_compact so that the checksum_scan output is
completely JSON-parsable. I also added a method and refactored the
code to do the checking of non-JSON format.

Example command:
kudu cluster ksck --checksum_scan --checksum_snapshot=false
--ksck_format=json_compact localhost:7052,localhost:7051,
localhost:7053

Before:
Checksum finished in 0s: 0/8 replicas remaining (0B from disk, 2.00k
rows summed)
{"master_summaries"..}

After:
{"master_summaries"..}

Change-Id: I25fe6d0f14d1713b848d0a79f4d92b056924a5a5
Reviewed-on: http://gerrit.cloudera.org:8080/10535
Tested-by: Kudu Jenkins
Reviewed-by: Will Berkeley <wd...@gmail.com>


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

Branch: refs/heads/master
Commit: 5e705530cc34bedde1215dd5f50a624cabd658e8
Parents: c008731
Author: fwang29 <fw...@cloudera.com>
Authored: Tue Jun 12 16:33:14 2018 -0700
Committer: Will Berkeley <wd...@gmail.com>
Committed: Thu Jun 14 17:29:32 2018 +0000

----------------------------------------------------------------------
 src/kudu/tools/ksck-test.cc | 10 ++++++++++
 src/kudu/tools/ksck.cc      | 21 +++++++++++++++------
 2 files changed, 25 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/5e705530/src/kudu/tools/ksck-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck-test.cc b/src/kudu/tools/ksck-test.cc
index 22d737f..273be4b 100644
--- a/src/kudu/tools/ksck-test.cc
+++ b/src/kudu/tools/ksck-test.cc
@@ -52,6 +52,7 @@
 
 DECLARE_bool(checksum_scan);
 DECLARE_string(color);
+DECLARE_string(ksck_format);
 DECLARE_uint32(truncate_server_csv_length);
 
 namespace kudu {
@@ -1493,5 +1494,14 @@ TEST_F(KsckTest, TestVersionCheck) {
   CheckJsonStringVsKsckResults(KsckResultsToJsonString(), ksck_->results());
 }
 
+TEST_F(KsckTest, TestChecksumScanJson) {
+  CreateOneTableOneTablet();
+  FLAGS_checksum_scan = true;
+  FLAGS_ksck_format = "json_compact";
+  ASSERT_OK(RunKsck());
+  JsonReader r(err_stream_.str());
+  ASSERT_OK(r.Init());
+}
+
 } // namespace tools
 } // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/5e705530/src/kudu/tools/ksck.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index c895059..eab1ac1 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -26,6 +26,7 @@
 #include <set>
 #include <vector>
 
+#include <boost/algorithm/string/predicate.hpp>
 #include <boost/optional.hpp> // IWYU pragma: keep
 #include <gflags/gflags.h>
 #include <glog/logging.h>
@@ -143,6 +144,12 @@ bool IsNotAuthorizedMethodAccess(const Status& s) {
          s.ToString().find("Not authorized: unauthorized access to method") != string::npos;
 }
 
+// Return whether the format of the ksck results is non-JSON.
+bool IsNonJSONFormat() {
+  return boost::iequals(FLAGS_ksck_format, "plain_full") ||
+         boost::iequals(FLAGS_ksck_format, "plain_concise");
+}
+
 } // anonymous namespace
 
 ChecksumOptions::ChecksumOptions()
@@ -613,12 +620,14 @@ class ChecksumResultReporter : public RefCountedThreadSafe<ChecksumResultReporte
 
       done = responses_.WaitFor(MonoDelta::FromMilliseconds(std::min(rem_ms, 5000)));
       string status = done ? "finished in " : "running for ";
-      int run_time_sec = (MonoTime::Now() - start).ToSeconds();
-      (*out) << "Checksum " << status << run_time_sec << "s: "
-             << responses_.count() << "/" << expected_count_ << " replicas remaining ("
-             << HumanReadableNumBytes::ToString(disk_bytes_summed_.Load()) << " from disk, "
-             << HumanReadableInt::ToString(rows_summed_.Load()) << " rows summed)"
-             << endl;
+      if (IsNonJSONFormat()) {
+        int run_time_sec = (MonoTime::Now() - start).ToSeconds();
+        (*out) << "Checksum " << status << run_time_sec << "s: "
+               << responses_.count() << "/" << expected_count_ << " replicas remaining ("
+               << HumanReadableNumBytes::ToString(disk_bytes_summed_.Load()) << " from disk, "
+               << HumanReadableInt::ToString(rows_summed_.Load()) << " rows summed)"
+               << endl;
+      }
     }
     return true;
   }