Sahil Takiar has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/14824 )

Change subject: IMPALA-9199: Add support for single query retries on cluster 
membership changes
......................................................................


Patch Set 9:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/14824/13/be/src/runtime/query-driver.h
File be/src/runtime/query-driver.h:

http://gerrit.cloudera.org:8080/#/c/14824/13/be/src/runtime/query-driver.h@169
PS13, Line 169: _state_;
> I should have mentioned that the shared_ptr approach also requires special
i decided just to create a struct called QueryHandle that contains a shared_ptr 
to the QueryDriver and a naked pointer to the ClientRequestState. I reviewed 
all the places where a QueryDriver / ClientRequestState are used and make sure 
the ClientRequestState is only used when the QueryDriver is still in scope. I 
used new QueryDriver struct where I thought it was useful (e.g. 
ImpalaServer::GetQueryHandle).
i added some docs that explain the ClientRequestState should only be used when 
a valid QueryDriver is in scope.
since the QueryDriver must be in scope while the ClientRequestState is being 
used, I changed the ownership of the ClientRequestState back to unique_ptr and 
changed the Get*ClientRequestState() methods to return a naked pointer.


http://gerrit.cloudera.org:8080/#/c/14824/9/be/src/service/impala-hs2-server.cc
File be/src/service/impala-hs2-server.cc:

http://gerrit.cloudera.org:8080/#/c/14824/9/be/src/service/impala-hs2-server.cc@763
PS9, Line 763:   ClientRequestState* request_state = nullptr;
> yeah, thats a good point, thanks for catching that. changed it to use a sha
i ended it up changing it back to unique_ptr. I changed the semantics a bit so 
that whenever you use a ClientRequestState, the corresponding QueryDriver 
shared_ptr must have an active reference on the stack. I added a new struct 
called QueryHandle that contains a shared_ptr to a QueryDriver and a naked 
pointer to a ClientRequestState. the idea is that the QueryHandle will help 
insure a QueryDriver reference is alive when accessing a ClientRequestState.
there are a few places where it didn't make sense to use the new QueryHandle, 
so I just spot checked that whenever a ClientRequestState is used, the 
corresponding QueryDriver is still in scope.



--
To view, visit http://gerrit.cloudera.org:8080/14824
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2e4a0e72a9bf8ec10b91639aefd81bef17886ddd
Gerrit-Change-Number: 14824
Gerrit-PatchSet: 9
Gerrit-Owner: Sahil Takiar <stak...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com>
Gerrit-Reviewer: Sahil Takiar <stak...@cloudera.com>
Gerrit-Reviewer: Thomas Tauber-Marshall <tmarsh...@cloudera.com>
Gerrit-Comment-Date: Mon, 04 May 2020 01:06:31 +0000
Gerrit-HasComments: Yes

Reply via email to