Hello Adar Dembo, I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/12840 to review the following change. Change subject: tablet_service: improve error handling specificity ...................................................................... tablet_service: improve error handling specificity The error handling in TabletServiceImpl::HandleNewScanRequest() was convoluted. It's still not particularly inspired, but this patch makes several clarity and maintainability improvements: * Instead of making it the default error returned from HandleNewScanRequest(), localize the return of TabletServerErrorPB::MISMATCHED_SCHEMA to where Iterator::Init() returns an InvalidArgument, since that comes from a GetMappedReadProjection() failure. * Use an INVALID_SCAN_SPEC error for the case where the user specifies an unrecognized order mode, which is consistent with when the user specifies an unknown read mode or when the user specifies order mode without specifying a snapshot scan. Also, update the comments in the .proto file to reflect the current usage. * Localize assignment of TabletServerErrorPB::Code as much as possible in HandleNewScanRequest() by plumbing an `error_code` pointer into HandleScanAtSnapshot() so that errors in that method can be specific to the type of problem observed. This patch also introduces a RETURN_NOT_OK() macro variant that takes a functor which is called on error before returning the non-OK Status. Change-Id: I1e6f7b01336e78ea8f37cb17b2c4485138e23581 --- M src/kudu/tserver/tablet_server-test-base.cc M src/kudu/tserver/tablet_server-test-base.h M src/kudu/tserver/tablet_server-test.cc M src/kudu/tserver/tablet_service.cc M src/kudu/tserver/tablet_service.h M src/kudu/tserver/tserver.proto M src/kudu/util/status.h 7 files changed, 89 insertions(+), 55 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/40/12840/1 -- To view, visit http://gerrit.cloudera.org:8080/12840 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1e6f7b01336e78ea8f37cb17b2c4485138e23581 Gerrit-Change-Number: 12840 Gerrit-PatchSet: 1 Gerrit-Owner: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>