Repository: kudu
Updated Branches:
  refs/heads/master cb90d0b18 -> ade9da717


Check that the set raw snapshot timestamp is > 0

Commit 06bb52d changed the default (invalid) timestamp to 0
which was previously a valid raw snapshot timestamp to set.
This adds a check to make sure we now return Status::IllegalState
in this case.

Change-Id: Ibc5997f226752d59c56104b26e9b58b8640d0298
Reviewed-on: http://gerrit.cloudera.org:8080/5155
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <[email protected]>


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

Branch: refs/heads/master
Commit: b60508a93d25714f060b3e4e38affd8f19afd673
Parents: cb90d0b
Author: David Alves <[email protected]>
Authored: Sat Nov 19 18:09:55 2016 -0800
Committer: David Ribeiro Alves <[email protected]>
Committed: Mon Nov 21 18:50:03 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/client.cc | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b60508a9/src/kudu/client/client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.cc b/src/kudu/client/client.cc
index e2c1cf6..f700efc 100644
--- a/src/kudu/client/client.cc
+++ b/src/kudu/client/client.cc
@@ -1088,6 +1088,9 @@ Status KuduScanner::SetSnapshotRaw(uint64_t 
snapshot_timestamp) {
   if (data_->open_) {
     return Status::IllegalState("Snapshot timestamp must be set before 
Open()");
   }
+  if (snapshot_timestamp == 0) {
+    return Status::IllegalState("Snapshot timestamp must be set bigger than 
0");
+  }
   data_->mutable_configuration()->SetSnapshotRaw(snapshot_timestamp);
   return Status::OK();
 }

Reply via email to