Repository: incubator-impala
Updated Branches:
  refs/heads/master e3566ac04 -> 6251d8b4d


IMPALA-4829: Change default Kudu read behavior for "RYW"

Currently the default Kudu read mode is set to "READ_LATEST",
which essentially provides no guarantees on reading except
that any read issued will read the latest value that the
target replica happens to have. This is not necessarily a
time after a previous write operation in the same session.
By changing the read mode to the misleadingly named
"READ_AT_SNAPSHOT", we can ensure that Kudu reads will all
be at times at least or greater than the latest "observed"
time (which Impala already sets on the client). Note that
this does not mean all reads are performed at the same
timestamp (i.e. a snapshot read) because that requires
setting a snapshot timestamp, but doing this will require
more work in the future in both Impala and (mostly) Kudu.
The Kudu team calls this "Read Your Writes".

This means that, after this change, values written within a
session will always be visible to subsequent reads. Before
this change, this was usually the case but not guaranteed.

Testing: Private test run, running an exhaustive job now.
This is otherwise difficult to validate in new tests. This
has plenty of time to bake for 2.9 in case we discover
performance or functional issues.

Change-Id: I4011f8277083982aee2c6c2bfca2f4ae2f8cb31e
Reviewed-on: http://gerrit.cloudera.org:8080/5802
Reviewed-by: Thomas Tauber-Marshall <[email protected]>
Reviewed-by: Dan Hecht <[email protected]>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/32ff9598
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/32ff9598
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/32ff9598

Branch: refs/heads/master
Commit: 32ff959814646458a34278500bd01fc7741951ce
Parents: e3566ac
Author: Matthew Jacobs <[email protected]>
Authored: Thu Jan 26 12:56:19 2017 -0800
Committer: Impala Public Jenkins <[email protected]>
Committed: Wed Feb 1 23:42:50 2017 +0000

----------------------------------------------------------------------
 be/src/exec/kudu-scanner.cc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/32ff9598/be/src/exec/kudu-scanner.cc
----------------------------------------------------------------------
diff --git a/be/src/exec/kudu-scanner.cc b/be/src/exec/kudu-scanner.cc
index 9ec5201..8b6778f 100644
--- a/be/src/exec/kudu-scanner.cc
+++ b/be/src/exec/kudu-scanner.cc
@@ -44,9 +44,9 @@ using kudu::client::KuduScanBatch;
 using kudu::client::KuduSchema;
 using kudu::client::KuduTable;
 
-DEFINE_string(kudu_read_mode, "READ_LATEST", "(Advanced) Sets the Kudu scan 
ReadMode. "
-    "Supported Kudu read modes are READ_LATEST and READ_AT_SNAPSHOT. Invalid 
values "
-    "result in using READ_LATEST.");
+DEFINE_string(kudu_read_mode, "READ_AT_SNAPSHOT", "(Advanced) Sets the Kudu 
scan "
+    "ReadMode. Supported Kudu read modes are READ_LATEST and READ_AT_SNAPSHOT. 
Invalid "
+    "values result in using READ_AT_SNAPSHOT.");
 DEFINE_bool(pick_only_leaders_for_tests, false,
             "Whether to pick only leader replicas, for tests purposes only.");
 DEFINE_int32(kudu_scanner_keep_alive_period_sec, 15,
@@ -57,7 +57,7 @@ DECLARE_int32(kudu_operation_timeout_ms);
 
 namespace impala {
 
-const string MODE_READ_AT_SNAPSHOT = "READ_AT_SNAPSHOT";
+const string MODE_READ_LATEST = "READ_LATEST";
 
 KuduScanner::KuduScanner(KuduScanNode* scan_node, RuntimeState* state)
   : scan_node_(scan_node),
@@ -138,9 +138,9 @@ Status KuduScanner::OpenNextScanToken(const string& 
scan_token)  {
                          "Could not set replica selection.");
   }
   kudu::client::KuduScanner::ReadMode mode =
-      MODE_READ_AT_SNAPSHOT == FLAGS_kudu_read_mode ?
-          kudu::client::KuduScanner::READ_AT_SNAPSHOT :
-          kudu::client::KuduScanner::READ_LATEST;
+      MODE_READ_LATEST == FLAGS_kudu_read_mode ?
+          kudu::client::KuduScanner::READ_LATEST :
+          kudu::client::KuduScanner::READ_AT_SNAPSHOT;
   KUDU_RETURN_IF_ERROR(scanner_->SetReadMode(mode), "Could not set scanner 
ReadMode");
   
KUDU_RETURN_IF_ERROR(scanner_->SetTimeoutMillis(FLAGS_kudu_operation_timeout_ms),
       "Could not set scanner timeout");

Reply via email to