mirror of https://gitee.com/bigwinds/arangodb
Small change in getResponsibleServer to silence warnings.
If getResponsibleServer finds an entry _DBServer001 it simply waits for half a second and checks again in the agency. This is the right reaction to a planned leader change.
This commit is contained in:
parent
4714f539cd
commit
0dc3b7dd45
|
@ -2221,7 +2221,17 @@ std::shared_ptr<std::vector<ServerID>> ClusterInfo::getResponsibleServer(
|
|||
auto it = _shardIds.find(shardID);
|
||||
|
||||
if (it != _shardIds.end()) {
|
||||
return (*it).second;
|
||||
auto serverList = (*it).second;
|
||||
if (serverList != nullptr && serverList->size() > 0 &&
|
||||
(*serverList)[0].size() > 0 && (*serverList)[0][0] == '_') {
|
||||
// This is a temporary situation in which the leader has already
|
||||
// resigned, let's wait half a second and try again.
|
||||
--tries;
|
||||
LOG(INFO) << "getResponsibleServer: found resigned leader, waiting for half a second...";
|
||||
usleep(500000);
|
||||
} else {
|
||||
return (*it).second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue