Alexey Serbin has posted comments on this change. Change subject: Add snapshot scans to fuzz-itest ......................................................................
Patch Set 12: (16 comments) http://gerrit.cloudera.org:8080/#/c/4996/12/src/kudu/integration-tests/fuzz-itest.cc File src/kudu/integration-tests/fuzz-itest.cc: PS12, Line 292: found nit: consider renaming it into something more tied to the scope of this method, e.g., 'rows' or 'rows_found' PS12, Line 298: for (auto& found_row : found) { : errors->push_back(Substitute("Found unexpected row: $0", found_row.ToString())); : } nit: there is a piece of syntactic sugar for this, if you wish: transform(found.begin(), found.end(), back_inserter(*errors), [](const ExpectedKeyValueRow& e){ return Substitute("unexpected row: $0", e.ToString()); }); PS12, Line 303: (*iter). nit: using 'iter->first' instead could save 2 characters and easier to read, IMO :) PS12, Line 304: vector<optional<ExpectedKeyValueRow>> nit: could 'auto' work here as well? PS12, Line 319: nit: misaligned indent PS12, Line 324: nit: misaligned indent PS12, Line 331: nit: misaligned indent PS12, Line 533: std::greater<int>() > we pop from the back later, would prefer not to change to std::list ah, I see -- I missed the pop part. Sure, that makes sense then. PS12, Line 574: down_cast<kudu::server::LogicalClock*>( : tablet()->clock().get()) nit: on the note of failing gracefully in case of unexpected things in the test environment, would it make sense to use just standard dynamic_cast<> and then call ASSERT_TRUE(result != nullptr) ? PS12, Line 577: If it is nit: update a bit for better readability If it is, then store ... http://gerrit.cloudera.org:8080/#/c/4996/12/src/kudu/tablet/key_value_test_schema.h File src/kudu/tablet/key_value_test_schema.h: PS12, Line 24: #include <boost/optional/optional_io.hpp> nit: is it really needed after the change? PS12, Line 47: string ret = strings::Substitute("{$0,", key); : if (val == boost::none) { : ret.append("NULL}"); : } else { : ret.append(strings::Substitute("$0}", *val)); : } : return ret; nit: consider replacing with: return strings::Substitute("{$0,$1}", key, val ? *val : "NULL"); http://gerrit.cloudera.org:8080/#/c/4996/12/src/kudu/tserver/tablet_service.cc File src/kudu/tserver/tablet_service.cc: PS12, Line 1754: tmp_snap_timestamp.FromUint64(scan_pb.snap_timestamp()); nit: consider moving this after the if (!s.ok() && ...) check. PS12, Line 1757: !s.ok() && PREDICT_TRUE(!FLAGS_scanner_allow_snapshot_scans_with_logical_timestamps nit: does it make sense to check for the type of the error returned before deducing the nature of the clock? PS12, Line 1758: Snapshot scans not supported on this server nit: does it make sense to update the error message to give a hint on the nature of the expected timestamp? PS12, Line 1761: tmp_snap_timestamp > max_allowed_ts I might miss something here, but it seems it's always true if GetGlobalLatest() call returns non-OK status. If so, in what regard the flag helps here? -- To view, visit http://gerrit.cloudera.org:8080/4996 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d15129e83c5c9afa9b643e674c8a23e18a2fa0e Gerrit-PatchSet: 12 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: David Ribeiro Alves <dral...@apache.org> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org> Gerrit-Reviewer: Jean-Daniel Cryans <jdcry...@apache.org> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes