[
https://issues.apache.org/jira/browse/KUDU-1927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15905773#comment-15905773
]
Adar Dembo commented on KUDU-1927:
----------------------------------
bq. I think there is subtle bug in ScopedLeaderSharedLock in which whatever
status is returned by "leader_status()" should be checked after checking
"catalog_status()".
It's not a bug, it's a "feature" :). Look at the comments on those methods:
{noformat}
// General status of the catalog manager. If not OK (e.g. the catalog
// manager is still being initialized), all operations are illegal and
// leader_status() should not be trusted.
const Status& catalog_status() const { return catalog_status_; }
// Leadership status of the catalog manager. If not OK, the catalog
// manager is not the leader, but some operations may still be legal.
const Status& leader_status() const {
DCHECK(catalog_status_.ok());
return leader_status_;
}
// First non-OK status of the catalog manager, adhering to the checking
// order specified above.
const Status& first_failed_status() const {
if (!catalog_status_.ok()) {
return catalog_status_;
}
return leader_status_;
}
{noformat}
As far as ConnectToMaster() is concerned, the CheckIsInitializedOrRespond()
call will lead to an early return if catalog_status() is not OK, which makes
the subsequent leader_status() check safe.
> Potential race handling ConnectToMaster RPCs during leader transition
> ---------------------------------------------------------------------
>
> Key: KUDU-1927
> URL: https://issues.apache.org/jira/browse/KUDU-1927
> Project: Kudu
> Issue Type: Bug
> Components: master, security
> Affects Versions: 1.3.0
> Reporter: Todd Lipcon
>
> MasterServiceImpl::ConnectToMaster currently has a TODO that there might be a
> case where a client issues the RPC exactly as a leader is becoming active.
> The worry is that it may return a response indicating LEADER status, but
> without the ability to issue a key.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)