mirror of https://gitee.com/bigwinds/arangodb
Clean up code without changing behaviour.
This commit is contained in:
parent
95a165d5f4
commit
f62042ef3a
|
@ -2360,14 +2360,10 @@ void ClusterInfo::loadCurrentDBServers() {
|
||||||
|
|
||||||
std::vector<ServerID> ClusterInfo::getCurrentDBServers() {
|
std::vector<ServerID> ClusterInfo::getCurrentDBServers() {
|
||||||
std::vector<ServerID> result;
|
std::vector<ServerID> result;
|
||||||
int tries = 0;
|
|
||||||
|
|
||||||
if (!_DBServersProt.isValid) {
|
if (!_DBServersProt.isValid) {
|
||||||
loadCurrentDBServers();
|
loadCurrentDBServers();
|
||||||
tries++;
|
|
||||||
}
|
}
|
||||||
while (true) {
|
|
||||||
{
|
|
||||||
// return a consistent state of servers
|
// return a consistent state of servers
|
||||||
READ_LOCKER(readLocker, _DBServersProt.lock);
|
READ_LOCKER(readLocker, _DBServersProt.lock);
|
||||||
|
|
||||||
|
@ -2380,18 +2376,6 @@ std::vector<ServerID> ClusterInfo::getCurrentDBServers() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++tries >= 2) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// loadCurrentDBServers needs the write lock
|
|
||||||
loadCurrentDBServers();
|
|
||||||
}
|
|
||||||
|
|
||||||
// note that the result will be empty if we get here
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief find the servers who are responsible for a shard (one leader
|
/// @brief find the servers who are responsible for a shard (one leader
|
||||||
/// and multiple followers)
|
/// and multiple followers)
|
||||||
|
@ -2560,14 +2544,11 @@ int ClusterInfo::getResponsibleShard(LogicalCollection* collInfo,
|
||||||
|
|
||||||
std::vector<ServerID> ClusterInfo::getCurrentCoordinators() {
|
std::vector<ServerID> ClusterInfo::getCurrentCoordinators() {
|
||||||
std::vector<ServerID> result;
|
std::vector<ServerID> result;
|
||||||
int tries = 0;
|
|
||||||
|
|
||||||
if (!_coordinatorsProt.isValid) {
|
if (!_coordinatorsProt.isValid) {
|
||||||
loadCurrentCoordinators();
|
loadCurrentCoordinators();
|
||||||
tries++;
|
|
||||||
}
|
}
|
||||||
while (true) {
|
|
||||||
{
|
|
||||||
// return a consistent state of servers
|
// return a consistent state of servers
|
||||||
READ_LOCKER(readLocker, _coordinatorsProt.lock);
|
READ_LOCKER(readLocker, _coordinatorsProt.lock);
|
||||||
|
|
||||||
|
@ -2580,18 +2561,6 @@ std::vector<ServerID> ClusterInfo::getCurrentCoordinators() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++tries >= 2) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// loadCurrentCoordinators needs the write lock
|
|
||||||
loadCurrentCoordinators();
|
|
||||||
}
|
|
||||||
|
|
||||||
// note that the result will be empty if we get here
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief invalidate plan
|
/// @brief invalidate plan
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue