diff --git a/arangod/Cluster/ClusterInfo.cpp b/arangod/Cluster/ClusterInfo.cpp index c76c6177b0..f3d30f0bb8 100644 --- a/arangod/Cluster/ClusterInfo.cpp +++ b/arangod/Cluster/ClusterInfo.cpp @@ -1277,9 +1277,7 @@ int ClusterInfo::createCollectionCoordinator(std::string const& databaseName, } } - AgencyGeneralTransaction transaction; - transaction.transactions.push_back( - AgencyGeneralTransaction::TransactionType(opers,precs)); + AgencyWriteTransaction transaction(opers,precs); { // we hold this mutex from now on until we have updated our cache // using loadPlan, this is necessary for the callback closure to diff --git a/arangod/Cluster/HeartbeatThread.cpp b/arangod/Cluster/HeartbeatThread.cpp index aa363395d5..ebb4e18438 100644 --- a/arangod/Cluster/HeartbeatThread.cpp +++ b/arangod/Cluster/HeartbeatThread.cpp @@ -419,12 +419,12 @@ static AgencyCommResult CasWithResult(AgencyComm agency, std::string const& key, if (oldValue.isNone()) { // for some reason this doesn't work // precondition: the key must equal old value AgencyPrecondition pre(key, AgencyPrecondition::Type::EMPTY, true); - AgencyGeneralTransaction trx(write, pre); + AgencyWriteTransaction trx(write, pre); return agency.sendTransactionWithFailover(trx, timeout); } else { // precondition: the key must equal old value AgencyPrecondition pre(key, AgencyPrecondition::Type::VALUE, oldValue); - AgencyGeneralTransaction trx(write, pre); + AgencyWriteTransaction trx(write, pre); return agency.sendTransactionWithFailover(trx, timeout); } } diff --git a/arangod/Cluster/ServerState.cpp b/arangod/Cluster/ServerState.cpp index 434abacc15..5644afcd78 100644 --- a/arangod/Cluster/ServerState.cpp +++ b/arangod/Cluster/ServerState.cpp @@ -516,7 +516,6 @@ bool ServerState::registerAtAgency(AgencyComm& comm, const ServerState::RoleEnum& role, std::string const& id) { - typedef std::pair operationType; std::string agencyListKey = roleToAgencyListKey(role); std::string idKey = "Latest" + roleToAgencyKey(role) + "Id"; @@ -545,19 +544,16 @@ bool ServerState::registerAtAgency(AgencyComm& comm, std::string planUrl = "Plan/" + agencyListKey + "/" + id; std::string currentUrl = "Current/" + agencyListKey + "/" + id; - AgencyGeneralTransaction reg; - reg.push_back( // Plan entry if not exists - operationType( - AgencyOperation(planUrl, AgencyValueOperationType::SET, builder.slice()), - AgencyPrecondition(planUrl, AgencyPrecondition::Type::EMPTY, true))); - - reg.push_back( // Current entry if not exists - operationType( - AgencyOperation(currentUrl, AgencyValueOperationType::SET, builder.slice()), - AgencyPrecondition(currentUrl, AgencyPrecondition::Type::EMPTY, true))); - + AgencyWriteTransaction preg( + AgencyOperation(planUrl, AgencyValueOperationType::SET, builder.slice()), + AgencyPrecondition(planUrl, AgencyPrecondition::Type::EMPTY, true)); // ok to fail..if it failed we are already registered - comm.sendTransactionWithFailover(reg, 0.0); + comm.sendTransactionWithFailover(preg, 0.0); + AgencyWriteTransaction creg( + AgencyOperation(currentUrl, AgencyValueOperationType::SET, builder.slice()), + AgencyPrecondition(currentUrl, AgencyPrecondition::Type::EMPTY, true)); + // ok to fail..if it failed we are already registered + comm.sendTransactionWithFailover(creg, 0.0); std::string targetIdStr = "Target/" + idKey; std::string targetUrl = "Target/MapUniqueToShortID/" + id; @@ -892,4 +888,4 @@ Result ServerState::propagateClusterServerMode(Mode mode) { } return Result(); -} \ No newline at end of file +}