You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2016/12/06 18:40:29 UTC

[1/3] kudu git commit: Silence gcc warning on TimeManager::GetSafeTimeUnlocked()

Repository: kudu
Updated Branches:
  refs/heads/master 4201d370a -> aaca775da


Silence gcc warning on TimeManager::GetSafeTimeUnlocked()

gcc is issuing this warning:
../../src/kudu/consensus/time_manager.cc: In member function \u2018kudu::Timestamp kudu::consensus::TimeManager::GetSafeTimeUnlocked()\u2019:
../../src/kudu/consensus/time_manager.cc:232:1: warning: control reaches end of non-void function [-Wreturn-type]

This patch silences it by using '__builtin_unreachable()'.

Change-Id: I7a87b483453115ae34615698017482a0364b5dca
Reviewed-on: http://gerrit.cloudera.org:8080/5381
Reviewed-by: Todd Lipcon <to...@apache.org>
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/3af7ee27
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/3af7ee27
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/3af7ee27

Branch: refs/heads/master
Commit: 3af7ee27b1336c0e075e40d61a4486ccddd34cd1
Parents: 4201d37
Author: David Alves <dr...@apache.org>
Authored: Tue Dec 6 03:37:16 2016 -0800
Committer: David Ribeiro Alves <dr...@apache.org>
Committed: Tue Dec 6 17:32:15 2016 +0000

----------------------------------------------------------------------
 src/kudu/consensus/time_manager.cc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/3af7ee27/src/kudu/consensus/time_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/time_manager.cc b/src/kudu/consensus/time_manager.cc
index eac6ebb..39d627c 100644
--- a/src/kudu/consensus/time_manager.cc
+++ b/src/kudu/consensus/time_manager.cc
@@ -228,6 +228,7 @@ Timestamp TimeManager::GetSafeTimeUnlocked() {
     case NON_LEADER:
       return last_safe_ts_;
   }
+  __builtin_unreachable(); // silence gcc warnings
 }
 
 Timestamp TimeManager::GetSerialTimestamp() {


[3/3] kudu git commit: client: don't log retriable scanner errors

Posted by ad...@apache.org.
client: don't log retriable scanner errors

Retriable scanner errors are a normal part of life. Prior to this patch,
every such error (eg SERVER_TOO_BUSY) resulted in both an INFO and a
WARNING message logged in the client.

In an Impala stress scenario this was producing several hundred logs per
second, even while queries were mostly succeeding.

This downgrades them to a VLOG(1) level.

Change-Id: I32e16dd10f9de8a015d420da4b58b2f363045f67
Reviewed-on: http://gerrit.cloudera.org:8080/5380
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans <jd...@apache.org>
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/aaca775d
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/aaca775d
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/aaca775d

Branch: refs/heads/master
Commit: aaca775da7f5e9d191627159417695848285790d
Parents: 8877b83
Author: Todd Lipcon <to...@apache.org>
Authored: Tue Dec 6 19:28:52 2016 +0800
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Tue Dec 6 18:38:19 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/client.cc           | 10 ++++++----
 src/kudu/client/scanner-internal.cc |  6 +++---
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/aaca775d/src/kudu/client/client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.cc b/src/kudu/client/client.cc
index b634548..9095a4b 100644
--- a/src/kudu/client/client.cc
+++ b/src/kudu/client/client.cc
@@ -1309,11 +1309,13 @@ Status KuduScanner::NextBatch(KuduScanBatch* batch) {
       data_->scan_attempts_++;
 
       // Error handling.
-      LOG(WARNING) << "Scan at tablet server " << data_->ts_->ToString() << " of tablet "
-                   << ToString() << " failed: " << result.status.ToString();
-
       set<string> blacklist;
-      RETURN_NOT_OK(data_->HandleError(result, batch_deadline, &blacklist));
+      Status s = data_->HandleError(result, batch_deadline, &blacklist);
+      if (!s.ok()) {
+        LOG(WARNING) << "Scan at tablet server " << data_->ts_->ToString() << " of tablet "
+                     << ToString() << " failed: " << result.status.ToString();
+        return s;
+      }
 
       if (data_->configuration().is_fault_tolerant()) {
         LOG(WARNING) << "Attempting to retry scan of tablet " << ToString() << " elsewhere.";

http://git-wip-us.apache.org/repos/asf/kudu/blob/aaca775d/src/kudu/client/scanner-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scanner-internal.cc b/src/kudu/client/scanner-internal.cc
index 311a7bf..07f93a7 100644
--- a/src/kudu/client/scanner-internal.cc
+++ b/src/kudu/client/scanner-internal.cc
@@ -131,9 +131,9 @@ Status KuduScanner::Data::HandleError(const ScanRpcStatus& err,
       return last_error_.ok() ?
           ret : ret.CloneAndAppend(last_error_.ToString());
     }
-    LOG(INFO) << "Error scanning on server " << ts_->ToString() << ": "
-              << err.status.ToString() << ". Will retry after "
-              << sleep.ToString() << "; attempt " << scan_attempts_;
+    VLOG(1) << "Error scanning on server " << ts_->ToString() << ": "
+            << err.status.ToString() << ". Will retry after "
+            << sleep.ToString() << "; attempt " << scan_attempts_;
     SleepFor(sleep);
   }
   if (can_retry) {


[2/3] kudu git commit: KUDU-1789. Fix ScannerKeepAlive leaking RPCs when scanner is already expired

Posted by ad...@apache.org.
KUDU-1789. Fix ScannerKeepAlive leaking RPCs when scanner is already expired

Change-Id: Icbd9b01a80ab37efe867d547362df72b019272bd
Reviewed-on: http://gerrit.cloudera.org:8080/5379
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans <jd...@apache.org>
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/8877b83d
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/8877b83d
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/8877b83d

Branch: refs/heads/master
Commit: 8877b83d5916ef2bfbc8168793af8a17b25f80d4
Parents: 3af7ee2
Author: Todd Lipcon <to...@apache.org>
Authored: Tue Dec 6 18:11:32 2016 +0800
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Tue Dec 6 18:37:46 2016 +0000

----------------------------------------------------------------------
 src/kudu/tserver/tablet_server-test.cc | 14 ++++++++++++++
 src/kudu/tserver/tablet_service.cc     |  1 +
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/8877b83d/src/kudu/tserver/tablet_server-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test.cc b/src/kudu/tserver/tablet_server-test.cc
index ed31dda..f65334e 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -1714,6 +1714,20 @@ TEST_F(TabletServerTest, TestScan_InvalidScanSeqId) {
   }
 }
 
+// Regression test for KUDU-1789: when ScannerKeepAlive is called on a non-existent
+// scanner, it should properly respond with an error.
+TEST_F(TabletServerTest, TestScan_KeepAliveExpiredScanner) {
+  ScannerKeepAliveRequestPB req;
+  ScannerKeepAliveResponsePB resp;
+  RpcController rpc;
+
+  rpc.set_timeout(MonoDelta::FromSeconds(5));
+  req.set_scanner_id("does-not-exist");
+  ASSERT_OK(proxy_->ScannerKeepAlive(req, &resp, &rpc));
+  ASSERT_TRUE(resp.has_error());
+  ASSERT_EQ(resp.error().code(), TabletServerErrorPB::SCANNER_EXPIRED);
+}
+
 void TabletServerTest::DoOrderedScanTest(const Schema& projection,
                                          const string& expected_rows_as_string) {
   InsertTestRowsDirect(0, 10);

http://git-wip-us.apache.org/repos/asf/kudu/blob/8877b83d/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index 51b5563..d107bca 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -1013,6 +1013,7 @@ void TabletServiceImpl::ScannerKeepAlive(const ScannerKeepAliveRequestPB *req,
       resp->mutable_error()->set_code(TabletServerErrorPB::SCANNER_EXPIRED);
       StatusToPB(Status::NotFound("Scanner not found"),
                  resp->mutable_error()->mutable_status());
+      context->RespondSuccess();
       return;
   }
   scanner->UpdateAccessTime();