mirror of https://gitee.com/bigwinds/arangodb
Coordinators do not unregister at every shutdown. (#9134)
* Coordinators do not unregister at every shutdown. Instead they create a new short name with every start. This is needed for the transactions. * Always new short id for coordinators. Never for DBServers!
This commit is contained in:
parent
d67513607d
commit
4da1a6afdf
|
@ -245,10 +245,6 @@ void ClusterFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
|
|||
FATAL_ERROR_EXIT();
|
||||
}
|
||||
ServerState::instance()->setRole(_requestedRole);
|
||||
|
||||
if (ServerState::isCoordinator(_requestedRole)) {
|
||||
setUnregisterOnShutdown(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -553,7 +553,7 @@ bool ServerState::registerAtAgencyPhase1(AgencyComm& comm, const ServerState::Ro
|
|||
|
||||
// coordinator is already/still registered from an previous unclean shutdown;
|
||||
// must establish a new short ID
|
||||
bool forceChangeShortId = (!res.successful() && isCoordinator(role));
|
||||
bool forceChangeShortId = isCoordinator(role);
|
||||
|
||||
std::string targetIdPath = "Target/" + latestIdKey;
|
||||
std::string targetUrl = "Target/MapUniqueToShortID/" + _id;
|
||||
|
@ -625,7 +625,7 @@ bool ServerState::registerAtAgencyPhase1(AgencyComm& comm, const ServerState::Ro
|
|||
|
||||
preconditions.push_back(*(latestIdPrecondition.get()));
|
||||
preconditions.push_back(AgencyPrecondition(targetUrl, AgencyPrecondition::Type::EMPTY,
|
||||
!forceChangeShortId));
|
||||
mapSlice.isNone()));
|
||||
|
||||
AgencyWriteTransaction trx(operations, preconditions);
|
||||
result = comm.sendTransactionWithFailover(trx, 0.0);
|
||||
|
|
Loading…
Reference in New Issue