2017-05-26 04:48:44 +08:00
|
|
|
/*
|
2019-02-18 11:13:26 +08:00
|
|
|
* WorkerInterface.actor.h
|
2017-05-26 04:48:44 +08:00
|
|
|
*
|
|
|
|
* This source file is part of the FoundationDB open source project
|
|
|
|
*
|
|
|
|
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
|
2018-02-22 02:25:11 +08:00
|
|
|
*
|
2017-05-26 04:48:44 +08:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2018-02-22 02:25:11 +08:00
|
|
|
*
|
2017-05-26 04:48:44 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2018-02-22 02:25:11 +08:00
|
|
|
*
|
2017-05-26 04:48:44 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-02-18 11:13:26 +08:00
|
|
|
#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_WORKERINTERFACE_ACTOR_G_H)
|
|
|
|
#define FDBSERVER_WORKERINTERFACE_ACTOR_G_H
|
|
|
|
#include "fdbserver/WorkerInterface.actor.g.h"
|
|
|
|
#elif !defined(FDBSERVER_WORKERINTERFACE_ACTOR_H)
|
|
|
|
#define FDBSERVER_WORKERINTERFACE_ACTOR_H
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2019-04-25 06:12:37 +08:00
|
|
|
#include "fdbserver/BackupInterface.h"
|
2018-12-14 05:31:37 +08:00
|
|
|
#include "fdbserver/DataDistributorInterface.h"
|
2018-10-20 01:30:13 +08:00
|
|
|
#include "fdbserver/MasterInterface.h"
|
|
|
|
#include "fdbserver/TLogInterface.h"
|
2019-02-15 08:24:46 +08:00
|
|
|
#include "fdbserver/RatekeeperInterface.h"
|
2018-10-20 01:30:13 +08:00
|
|
|
#include "fdbserver/ResolverInterface.h"
|
2017-05-26 04:48:44 +08:00
|
|
|
#include "fdbclient/StorageServerInterface.h"
|
2019-02-18 11:25:16 +08:00
|
|
|
#include "fdbserver/TesterInterface.actor.h"
|
2017-05-26 04:48:44 +08:00
|
|
|
#include "fdbclient/FDBTypes.h"
|
2018-10-20 01:30:13 +08:00
|
|
|
#include "fdbserver/LogSystemConfig.h"
|
2017-05-26 04:48:44 +08:00
|
|
|
#include "fdbrpc/MultiInterface.h"
|
|
|
|
#include "fdbclient/ClientWorkerInterface.h"
|
2020-04-07 11:58:43 +08:00
|
|
|
#include "fdbserver/RecoveryState.h"
|
2019-02-18 11:13:26 +08:00
|
|
|
#include "flow/actorcompiler.h"
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
struct WorkerInterface {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 14712718;
|
2017-05-26 04:48:44 +08:00
|
|
|
ClientWorkerInterface clientInterface;
|
|
|
|
LocalityData locality;
|
|
|
|
RequestStream< struct InitializeTLogRequest > tLog;
|
|
|
|
RequestStream< struct RecruitMasterRequest > master;
|
|
|
|
RequestStream< struct InitializeMasterProxyRequest > masterProxy;
|
2020-07-15 15:37:41 +08:00
|
|
|
RequestStream< struct InitializeGrvProxyRequest > grvProxy;
|
2018-12-14 05:31:37 +08:00
|
|
|
RequestStream< struct InitializeDataDistributorRequest > dataDistributor;
|
2019-02-15 08:24:46 +08:00
|
|
|
RequestStream< struct InitializeRatekeeperRequest > ratekeeper;
|
2017-05-26 04:48:44 +08:00
|
|
|
RequestStream< struct InitializeResolverRequest > resolver;
|
|
|
|
RequestStream< struct InitializeStorageRequest > storage;
|
2017-06-30 06:50:19 +08:00
|
|
|
RequestStream< struct InitializeLogRouterRequest > logRouter;
|
2019-04-25 06:12:37 +08:00
|
|
|
RequestStream< struct InitializeBackupRequest > backup;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
RequestStream< struct LoadedPingRequest > debugPing;
|
|
|
|
RequestStream< struct CoordinationPingMessage > coordinationPing;
|
|
|
|
RequestStream< ReplyPromise<Void> > waitFailure;
|
|
|
|
RequestStream< struct SetMetricsLogRateRequest > setMetricsRate;
|
|
|
|
RequestStream< struct EventLogRequest > eventLogRequest;
|
|
|
|
RequestStream< struct TraceBatchDumpRequest > traceBatchDumpRequest;
|
|
|
|
RequestStream< struct DiskStoreRequest > diskStoreRequest;
|
2020-04-06 14:09:36 +08:00
|
|
|
RequestStream< struct ExecuteRequest> execReq;
|
|
|
|
RequestStream< struct WorkerSnapRequest> workerSnapReq;
|
|
|
|
RequestStream< struct UpdateServerDBInfoRequest > updateServerDBInfo;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
TesterInterface testerInterface;
|
|
|
|
|
|
|
|
UID id() const { return tLog.getEndpoint().token; }
|
2018-10-31 04:44:37 +08:00
|
|
|
NetworkAddress address() const { return tLog.getEndpoint().getPrimaryAddress(); }
|
2020-04-11 04:45:16 +08:00
|
|
|
NetworkAddress stableAddress() const { return tLog.getEndpoint().getStableAddress(); }
|
2020-03-11 14:38:30 +08:00
|
|
|
Optional<NetworkAddress> secondaryAddress() const { return tLog.getEndpoint().addresses.secondaryAddress; }
|
2020-04-11 04:45:16 +08:00
|
|
|
NetworkAddressList addresses() const { return tLog.getEndpoint().addresses; }
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
WorkerInterface() {}
|
2019-02-01 14:23:49 +08:00
|
|
|
WorkerInterface( const LocalityData& locality ) : locality( locality ) {}
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2019-11-12 07:17:11 +08:00
|
|
|
void initEndpoints() {
|
|
|
|
clientInterface.initEndpoints();
|
|
|
|
tLog.getEndpoint( TaskPriority::Worker );
|
|
|
|
master.getEndpoint( TaskPriority::Worker );
|
|
|
|
masterProxy.getEndpoint( TaskPriority::Worker );
|
2020-07-15 15:37:41 +08:00
|
|
|
grvProxy.getEndpoint( TaskPriority::Worker );
|
2019-11-12 07:17:11 +08:00
|
|
|
resolver.getEndpoint( TaskPriority::Worker );
|
|
|
|
logRouter.getEndpoint( TaskPriority::Worker );
|
|
|
|
debugPing.getEndpoint( TaskPriority::Worker );
|
|
|
|
coordinationPing.getEndpoint( TaskPriority::Worker );
|
2020-04-06 14:09:36 +08:00
|
|
|
updateServerDBInfo.getEndpoint( TaskPriority::Worker );
|
2020-04-23 05:24:59 +08:00
|
|
|
eventLogRequest.getEndpoint( TaskPriority::Worker );
|
2019-11-12 07:17:11 +08:00
|
|
|
}
|
|
|
|
|
2017-05-26 04:48:44 +08:00
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2020-07-15 15:37:41 +08:00
|
|
|
serializer(ar, clientInterface, locality, tLog, master, masterProxy, grvProxy, dataDistributor, ratekeeper, resolver, storage, logRouter, debugPing, coordinationPing, waitFailure, setMetricsRate, eventLogRequest, traceBatchDumpRequest, testerInterface, diskStoreRequest, execReq, workerSnapReq, backup, updateServerDBInfo);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-09 00:25:07 +08:00
|
|
|
struct WorkerDetails {
|
2019-04-10 05:29:21 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 9973980;
|
2019-03-09 00:25:07 +08:00
|
|
|
WorkerInterface interf;
|
|
|
|
ProcessClass processClass;
|
|
|
|
bool degraded;
|
|
|
|
|
|
|
|
WorkerDetails() : degraded(false) {}
|
|
|
|
WorkerDetails(const WorkerInterface& interf, ProcessClass processClass, bool degraded) : interf(interf), processClass(processClass), degraded(degraded) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
|
|
|
serializer(ar, interf, processClass, degraded);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-04-07 11:58:43 +08:00
|
|
|
// This interface and its serialization depend on slicing, since the client will deserialize only the first part of this structure
|
|
|
|
struct ClusterControllerFullInterface {
|
|
|
|
constexpr static FileIdentifier file_identifier =
|
|
|
|
ClusterControllerClientInterface::file_identifier;
|
|
|
|
ClusterInterface clientInterface;
|
|
|
|
RequestStream< struct RecruitFromConfigurationRequest > recruitFromConfiguration;
|
|
|
|
RequestStream< struct RecruitRemoteFromConfigurationRequest > recruitRemoteFromConfiguration;
|
|
|
|
RequestStream< struct RecruitStorageRequest > recruitStorage;
|
|
|
|
RequestStream< struct RegisterWorkerRequest > registerWorker;
|
|
|
|
RequestStream< struct GetWorkersRequest > getWorkers;
|
|
|
|
RequestStream< struct RegisterMasterRequest > registerMaster;
|
2020-04-18 06:05:01 +08:00
|
|
|
RequestStream< struct GetServerDBInfoRequest > getServerDBInfo; //only used by testers; the cluster controller will send the serverDBInfo to workers
|
2020-04-07 11:58:43 +08:00
|
|
|
|
|
|
|
UID id() const { return clientInterface.id(); }
|
|
|
|
bool operator == (ClusterControllerFullInterface const& r) const { return id() == r.id(); }
|
|
|
|
bool operator != (ClusterControllerFullInterface const& r) const { return id() != r.id(); }
|
|
|
|
|
|
|
|
bool hasMessage() {
|
|
|
|
return clientInterface.hasMessage() ||
|
|
|
|
recruitFromConfiguration.getFuture().isReady() ||
|
|
|
|
recruitRemoteFromConfiguration.getFuture().isReady() ||
|
|
|
|
recruitStorage.getFuture().isReady() ||
|
|
|
|
registerWorker.getFuture().isReady() ||
|
|
|
|
getWorkers.getFuture().isReady() ||
|
|
|
|
registerMaster.getFuture().isReady() ||
|
|
|
|
getServerDBInfo.getFuture().isReady();
|
|
|
|
}
|
|
|
|
|
|
|
|
void initEndpoints() {
|
|
|
|
clientInterface.initEndpoints();
|
|
|
|
recruitFromConfiguration.getEndpoint( TaskPriority::ClusterControllerRecruit );
|
|
|
|
recruitRemoteFromConfiguration.getEndpoint( TaskPriority::ClusterControllerRecruit );
|
|
|
|
recruitStorage.getEndpoint( TaskPriority::ClusterController );
|
|
|
|
registerWorker.getEndpoint( TaskPriority::ClusterControllerWorker );
|
|
|
|
getWorkers.getEndpoint( TaskPriority::ClusterController );
|
|
|
|
registerMaster.getEndpoint( TaskPriority::ClusterControllerRegister );
|
|
|
|
getServerDBInfo.getEndpoint( TaskPriority::ClusterController );
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
|
|
|
if constexpr (!is_fb_function<Ar>) {
|
|
|
|
ASSERT(ar.protocolVersion().isValid());
|
|
|
|
}
|
|
|
|
serializer(ar, clientInterface, recruitFromConfiguration, recruitRemoteFromConfiguration, recruitStorage,
|
|
|
|
registerWorker, getWorkers, registerMaster, getServerDBInfo);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RegisterWorkerReply {
|
|
|
|
constexpr static FileIdentifier file_identifier = 16475696;
|
|
|
|
ProcessClass processClass;
|
|
|
|
ClusterControllerPriorityInfo priorityInfo;
|
|
|
|
|
|
|
|
RegisterWorkerReply() : priorityInfo(ProcessClass::UnsetFit, false, ClusterControllerPriorityInfo::FitnessUnknown) {}
|
2020-05-05 08:29:43 +08:00
|
|
|
RegisterWorkerReply(ProcessClass processClass, ClusterControllerPriorityInfo priorityInfo) : processClass(processClass), priorityInfo(priorityInfo) {}
|
2020-04-07 11:58:43 +08:00
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
2020-05-05 08:29:43 +08:00
|
|
|
serializer(ar, processClass, priorityInfo);
|
2020-04-07 11:58:43 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RegisterMasterRequest {
|
|
|
|
constexpr static FileIdentifier file_identifier = 10773445;
|
|
|
|
UID id;
|
|
|
|
LocalityData mi;
|
|
|
|
LogSystemConfig logSystemConfig;
|
2020-07-23 03:20:22 +08:00
|
|
|
std::vector<MasterProxyInterface> masterProxies;
|
2020-07-15 15:37:41 +08:00
|
|
|
std::vector<GrvProxyInterface> grvProxies;
|
2020-04-07 11:58:43 +08:00
|
|
|
std::vector<ResolverInterface> resolvers;
|
|
|
|
DBRecoveryCount recoveryCount;
|
|
|
|
int64_t registrationCount;
|
|
|
|
Optional<DatabaseConfiguration> configuration;
|
|
|
|
std::vector<UID> priorCommittedLogServers;
|
|
|
|
RecoveryState recoveryState;
|
|
|
|
bool recoveryStalled;
|
|
|
|
|
|
|
|
ReplyPromise<Void> reply;
|
|
|
|
|
|
|
|
RegisterMasterRequest() : logSystemConfig(0) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
|
|
|
if constexpr (!is_fb_function<Ar>) {
|
|
|
|
ASSERT(ar.protocolVersion().isValid());
|
|
|
|
}
|
2020-07-23 03:20:22 +08:00
|
|
|
serializer(ar, id, mi, logSystemConfig, masterProxies, grvProxies, resolvers, recoveryCount, registrationCount,
|
2020-07-15 15:37:41 +08:00
|
|
|
configuration, priorCommittedLogServers, recoveryState, recoveryStalled, reply);
|
2020-04-07 11:58:43 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RecruitFromConfigurationReply {
|
|
|
|
constexpr static FileIdentifier file_identifier = 2224085;
|
|
|
|
std::vector<WorkerInterface> backupWorkers;
|
|
|
|
std::vector<WorkerInterface> tLogs;
|
|
|
|
std::vector<WorkerInterface> satelliteTLogs;
|
2020-07-23 03:20:22 +08:00
|
|
|
std::vector<WorkerInterface> masterProxies;
|
2020-07-15 15:37:41 +08:00
|
|
|
std::vector<WorkerInterface> grvProxies;
|
2020-04-07 11:58:43 +08:00
|
|
|
std::vector<WorkerInterface> resolvers;
|
|
|
|
std::vector<WorkerInterface> storageServers;
|
|
|
|
std::vector<WorkerInterface> oldLogRouters;
|
|
|
|
Optional<Key> dcId;
|
|
|
|
bool satelliteFallback;
|
|
|
|
|
|
|
|
RecruitFromConfigurationReply() : satelliteFallback(false) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2020-07-23 03:20:22 +08:00
|
|
|
serializer(ar, tLogs, satelliteTLogs, masterProxies, grvProxies, resolvers, storageServers, oldLogRouters, dcId,
|
2020-04-07 11:58:43 +08:00
|
|
|
satelliteFallback, backupWorkers);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RecruitFromConfigurationRequest {
|
|
|
|
constexpr static FileIdentifier file_identifier = 2023046;
|
|
|
|
DatabaseConfiguration configuration;
|
|
|
|
bool recruitSeedServers;
|
|
|
|
int maxOldLogRouters;
|
|
|
|
ReplyPromise< RecruitFromConfigurationReply > reply;
|
|
|
|
|
|
|
|
RecruitFromConfigurationRequest() {}
|
|
|
|
explicit RecruitFromConfigurationRequest(DatabaseConfiguration const& configuration, bool recruitSeedServers, int maxOldLogRouters)
|
|
|
|
: configuration(configuration), recruitSeedServers(recruitSeedServers), maxOldLogRouters(maxOldLogRouters) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
|
|
|
serializer(ar, configuration, recruitSeedServers, maxOldLogRouters, reply);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RecruitRemoteFromConfigurationReply {
|
|
|
|
constexpr static FileIdentifier file_identifier = 9091392;
|
|
|
|
std::vector<WorkerInterface> remoteTLogs;
|
|
|
|
std::vector<WorkerInterface> logRouters;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
|
|
|
serializer(ar, remoteTLogs, logRouters);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RecruitRemoteFromConfigurationRequest {
|
|
|
|
constexpr static FileIdentifier file_identifier = 3235995;
|
|
|
|
DatabaseConfiguration configuration;
|
|
|
|
Optional<Key> dcId;
|
|
|
|
int logRouterCount;
|
|
|
|
std::vector<UID> exclusionWorkerIds;
|
|
|
|
ReplyPromise< RecruitRemoteFromConfigurationReply > reply;
|
|
|
|
|
|
|
|
RecruitRemoteFromConfigurationRequest() {}
|
|
|
|
RecruitRemoteFromConfigurationRequest(DatabaseConfiguration const& configuration, Optional<Key> const& dcId, int logRouterCount, const std::vector<UID> &exclusionWorkerIds) : configuration(configuration), dcId(dcId), logRouterCount(logRouterCount), exclusionWorkerIds(exclusionWorkerIds){}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
|
|
|
serializer(ar, configuration, dcId, logRouterCount, exclusionWorkerIds, reply);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RecruitStorageReply {
|
|
|
|
constexpr static FileIdentifier file_identifier = 15877089;
|
|
|
|
WorkerInterface worker;
|
|
|
|
ProcessClass processClass;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
|
|
|
serializer(ar, worker, processClass);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RecruitStorageRequest {
|
|
|
|
constexpr static FileIdentifier file_identifier = 905920;
|
|
|
|
std::vector<Optional<Standalone<StringRef>>> excludeMachines; //< Don't recruit any of these machines
|
|
|
|
std::vector<AddressExclusion> excludeAddresses; //< Don't recruit any of these addresses
|
|
|
|
std::vector<Optional<Standalone<StringRef>>> includeDCs;
|
|
|
|
bool criticalRecruitment; //< True if machine classes are to be ignored
|
|
|
|
ReplyPromise< RecruitStorageReply > reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
|
|
|
serializer(ar, excludeMachines, excludeAddresses, includeDCs, criticalRecruitment, reply);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RegisterWorkerRequest {
|
|
|
|
constexpr static FileIdentifier file_identifier = 14332605;
|
|
|
|
WorkerInterface wi;
|
|
|
|
ProcessClass initialClass;
|
|
|
|
ProcessClass processClass;
|
|
|
|
ClusterControllerPriorityInfo priorityInfo;
|
|
|
|
Generation generation;
|
|
|
|
Optional<DataDistributorInterface> distributorInterf;
|
|
|
|
Optional<RatekeeperInterface> ratekeeperInterf;
|
|
|
|
Standalone<VectorRef<StringRef>> issues;
|
|
|
|
std::vector<NetworkAddress> incompatiblePeers;
|
|
|
|
ReplyPromise<RegisterWorkerReply> reply;
|
|
|
|
bool degraded;
|
|
|
|
|
|
|
|
RegisterWorkerRequest() : priorityInfo(ProcessClass::UnsetFit, false, ClusterControllerPriorityInfo::FitnessUnknown), degraded(false) {}
|
2020-05-05 08:29:43 +08:00
|
|
|
RegisterWorkerRequest(WorkerInterface wi, ProcessClass initialClass, ProcessClass processClass, ClusterControllerPriorityInfo priorityInfo, Generation generation, Optional<DataDistributorInterface> ddInterf, Optional<RatekeeperInterface> rkInterf, bool degraded) :
|
|
|
|
wi(wi), initialClass(initialClass), processClass(processClass), priorityInfo(priorityInfo), generation(generation), distributorInterf(ddInterf), ratekeeperInterf(rkInterf), degraded(degraded) {}
|
2020-04-07 11:58:43 +08:00
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
2020-05-05 08:29:43 +08:00
|
|
|
serializer(ar, wi, initialClass, processClass, priorityInfo, generation, distributorInterf, ratekeeperInterf, issues, incompatiblePeers, reply, degraded);
|
2020-04-07 11:58:43 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GetWorkersRequest {
|
|
|
|
constexpr static FileIdentifier file_identifier = 1254174;
|
|
|
|
enum { TESTER_CLASS_ONLY = 0x1, NON_EXCLUDED_PROCESSES_ONLY = 0x2 };
|
|
|
|
|
|
|
|
int flags;
|
|
|
|
ReplyPromise<vector<WorkerDetails>> reply;
|
|
|
|
|
|
|
|
GetWorkersRequest() : flags(0) {}
|
|
|
|
explicit GetWorkersRequest(int fl) : flags(fl) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
|
|
|
serializer(ar, flags, reply);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-05-26 04:48:44 +08:00
|
|
|
struct InitializeTLogRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 15604392;
|
2017-05-26 04:48:44 +08:00
|
|
|
UID recruitmentID;
|
|
|
|
LogSystemConfig recoverFrom;
|
|
|
|
Version recoverAt;
|
|
|
|
Version knownCommittedVersion;
|
|
|
|
LogEpoch epoch;
|
|
|
|
std::vector<Tag> recoverTags;
|
2018-04-01 07:47:56 +08:00
|
|
|
std::vector<Tag> allTags;
|
2019-02-23 04:15:23 +08:00
|
|
|
TLogVersion logVersion;
|
2017-05-26 04:48:44 +08:00
|
|
|
KeyValueStoreType storeType;
|
2019-02-08 09:02:47 +08:00
|
|
|
TLogSpillType spillType;
|
2018-03-30 06:12:38 +08:00
|
|
|
Tag remoteTag;
|
|
|
|
int8_t locality;
|
|
|
|
bool isPrimary;
|
2018-04-09 12:24:05 +08:00
|
|
|
Version startVersion;
|
|
|
|
int logRouterTags;
|
2019-06-20 09:15:09 +08:00
|
|
|
int txsTags;
|
2018-03-30 06:12:38 +08:00
|
|
|
|
2017-05-26 04:48:44 +08:00
|
|
|
ReplyPromise< struct TLogInterface > reply;
|
|
|
|
|
2019-06-01 07:14:58 +08:00
|
|
|
InitializeTLogRequest() : recoverFrom(0) {}
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
2019-06-20 09:15:09 +08:00
|
|
|
serializer(ar, recruitmentID, recoverFrom, recoverAt, knownCommittedVersion, epoch, recoverTags, allTags, storeType, remoteTag, locality, isPrimary, startVersion, logRouterTags, reply, logVersion, spillType, txsTags);
|
2017-06-30 06:50:19 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InitializeLogRouterRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 2976228;
|
2017-06-30 06:50:19 +08:00
|
|
|
uint64_t recoveryCount;
|
|
|
|
Tag routerTag;
|
2018-04-09 12:24:05 +08:00
|
|
|
Version startVersion;
|
2018-04-29 09:04:57 +08:00
|
|
|
std::vector<LocalityData> tLogLocalities;
|
2019-03-14 04:14:39 +08:00
|
|
|
Reference<IReplicationPolicy> tLogPolicy;
|
2018-04-30 04:47:32 +08:00
|
|
|
int8_t locality;
|
2017-06-30 06:50:19 +08:00
|
|
|
ReplyPromise<struct TLogInterface> reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, recoveryCount, routerTag, startVersion, tLogLocalities, tLogPolicy, locality, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-01-17 11:16:23 +08:00
|
|
|
struct InitializeBackupReply {
|
2020-07-15 07:26:16 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 13511909;
|
2020-01-17 11:16:23 +08:00
|
|
|
struct BackupInterface interf;
|
|
|
|
LogEpoch backupEpoch;
|
|
|
|
|
|
|
|
InitializeBackupReply() = default;
|
|
|
|
InitializeBackupReply(BackupInterface interface, LogEpoch e) : interf(interface), backupEpoch(e) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
|
|
|
serializer(ar, interf, backupEpoch);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-25 06:12:37 +08:00
|
|
|
struct InitializeBackupRequest {
|
2020-07-15 07:26:16 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 1245415;
|
2019-04-25 06:12:37 +08:00
|
|
|
UID reqId;
|
2019-08-13 10:10:46 +08:00
|
|
|
LogEpoch recruitedEpoch; // The epoch the worker is recruited.
|
|
|
|
LogEpoch backupEpoch; // The epoch the worker should work on. If different from the recruitedEpoch, then it refers
|
|
|
|
// to some previous epoch with unfinished work.
|
2019-05-24 07:06:23 +08:00
|
|
|
Tag routerTag;
|
2020-02-21 08:28:27 +08:00
|
|
|
int totalTags;
|
2019-05-16 07:13:04 +08:00
|
|
|
Version startVersion;
|
2019-06-01 07:14:58 +08:00
|
|
|
Optional<Version> endVersion;
|
2020-01-17 11:16:23 +08:00
|
|
|
ReplyPromise<struct InitializeBackupReply> reply;
|
2019-04-25 06:12:37 +08:00
|
|
|
|
|
|
|
InitializeBackupRequest() = default;
|
|
|
|
explicit InitializeBackupRequest(UID id) : reqId(id) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2020-02-21 08:28:27 +08:00
|
|
|
serializer(ar, reqId, recruitedEpoch, backupEpoch, routerTag, totalTags, startVersion, endVersion, reply);
|
2019-04-25 06:12:37 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-05-26 04:48:44 +08:00
|
|
|
// FIXME: Rename to InitializeMasterRequest, etc
|
|
|
|
struct RecruitMasterRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 12684574;
|
2017-05-26 04:48:44 +08:00
|
|
|
Arena arena;
|
|
|
|
LifetimeToken lifetime;
|
2018-07-01 21:39:04 +08:00
|
|
|
bool forceRecovery;
|
2017-05-26 04:48:44 +08:00
|
|
|
ReplyPromise< struct MasterInterface> reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2019-01-29 11:38:13 +08:00
|
|
|
if constexpr (!is_fb_function<Ar>) {
|
2019-06-19 08:55:27 +08:00
|
|
|
ASSERT(ar.protocolVersion().isValid());
|
2019-01-29 11:38:13 +08:00
|
|
|
}
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, lifetime, forceRecovery, reply, arena);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InitializeMasterProxyRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 10344153;
|
2017-05-26 04:48:44 +08:00
|
|
|
MasterInterface master;
|
|
|
|
uint64_t recoveryCount;
|
|
|
|
Version recoveryTransactionVersion;
|
|
|
|
bool firstProxy;
|
|
|
|
ReplyPromise<MasterProxyInterface> reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, master, recoveryCount, recoveryTransactionVersion, firstProxy, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-07-15 15:37:41 +08:00
|
|
|
struct InitializeGrvProxyRequest {
|
2020-07-23 14:35:46 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 8265613;
|
2020-07-15 15:37:41 +08:00
|
|
|
MasterInterface master;
|
2020-07-23 14:35:46 +08:00
|
|
|
uint64_t recoveryCount;
|
2020-07-15 15:37:41 +08:00
|
|
|
ReplyPromise<GrvProxyInterface> reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2020-07-23 14:35:46 +08:00
|
|
|
serializer(ar, master, recoveryCount, reply);
|
2020-07-15 15:37:41 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-12-14 05:31:37 +08:00
|
|
|
struct InitializeDataDistributorRequest {
|
2019-02-21 03:52:47 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 8858952;
|
2018-12-14 05:31:37 +08:00
|
|
|
UID reqId;
|
|
|
|
ReplyPromise<DataDistributorInterface> reply;
|
|
|
|
|
2019-02-21 07:47:55 +08:00
|
|
|
InitializeDataDistributorRequest() {}
|
|
|
|
explicit InitializeDataDistributorRequest(UID uid) : reqId(uid) {}
|
2018-12-14 05:31:37 +08:00
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
|
|
|
serializer(ar, reqId, reply);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-02-15 08:24:46 +08:00
|
|
|
struct InitializeRatekeeperRequest {
|
2019-04-10 05:29:21 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 6416816;
|
2019-02-15 08:24:46 +08:00
|
|
|
UID reqId;
|
|
|
|
ReplyPromise<RatekeeperInterface> reply;
|
|
|
|
|
2019-02-21 07:47:55 +08:00
|
|
|
InitializeRatekeeperRequest() {}
|
|
|
|
explicit InitializeRatekeeperRequest(UID uid) : reqId(uid) {}
|
2019-02-15 08:24:46 +08:00
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
|
|
|
serializer(ar, reqId, reply);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-05-26 04:48:44 +08:00
|
|
|
struct InitializeResolverRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 7413317;
|
2017-05-26 04:48:44 +08:00
|
|
|
uint64_t recoveryCount;
|
|
|
|
int proxyCount;
|
|
|
|
int resolverCount;
|
|
|
|
ReplyPromise<ResolverInterface> reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, recoveryCount, proxyCount, resolverCount, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-05-06 09:16:28 +08:00
|
|
|
struct InitializeStorageReply {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 10390645;
|
2018-05-06 09:16:28 +08:00
|
|
|
StorageServerInterface interf;
|
|
|
|
Version addedVersion;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, interf, addedVersion);
|
2018-05-06 09:16:28 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-05-26 04:48:44 +08:00
|
|
|
struct InitializeStorageRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 16665642;
|
2017-05-26 04:48:44 +08:00
|
|
|
Tag seedTag; //< If this server will be passed to seedShardServers, this will be a tag, otherwise it is invalidTag
|
|
|
|
UID reqId;
|
|
|
|
UID interfaceId;
|
|
|
|
KeyValueStoreType storeType;
|
2018-05-06 09:16:28 +08:00
|
|
|
ReplyPromise< InitializeStorageReply > reply;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, seedTag, reqId, interfaceId, storeType, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TraceBatchDumpRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 8184121;
|
2017-05-26 04:48:44 +08:00
|
|
|
ReplyPromise<Void> reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize( Ar& ar ) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-02-28 07:40:33 +08:00
|
|
|
struct ExecuteRequest {
|
2019-05-22 04:55:30 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 8184128;
|
2019-02-28 07:40:33 +08:00
|
|
|
ReplyPromise<Void> reply;
|
|
|
|
|
|
|
|
Arena arena;
|
2019-04-13 04:23:02 +08:00
|
|
|
StringRef execPayload;
|
2019-02-28 07:40:33 +08:00
|
|
|
|
2019-04-13 04:23:02 +08:00
|
|
|
ExecuteRequest(StringRef execPayload) : execPayload(execPayload) {}
|
2019-02-28 07:40:33 +08:00
|
|
|
|
2019-04-13 04:23:02 +08:00
|
|
|
ExecuteRequest() : execPayload() {}
|
2019-02-28 07:40:33 +08:00
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2019-04-13 04:23:02 +08:00
|
|
|
serializer(ar, reply, execPayload, arena);
|
2019-02-28 07:40:33 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-06-20 02:20:44 +08:00
|
|
|
struct WorkerSnapRequest {
|
|
|
|
constexpr static FileIdentifier file_identifier = 8194122;
|
|
|
|
ReplyPromise<Void> reply;
|
|
|
|
Arena arena;
|
|
|
|
StringRef snapPayload;
|
|
|
|
UID snapUID;
|
|
|
|
StringRef role;
|
|
|
|
|
|
|
|
WorkerSnapRequest(StringRef snapPayload, UID snapUID, StringRef role) : snapPayload(snapPayload), snapUID(snapUID), role(role) {}
|
2019-07-21 16:00:29 +08:00
|
|
|
WorkerSnapRequest() = default;
|
2019-06-20 02:20:44 +08:00
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
|
|
|
serializer(ar, reply, snapPayload, snapUID, role, arena);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-05-26 04:48:44 +08:00
|
|
|
struct LoadedReply {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 9956350;
|
2017-05-26 04:48:44 +08:00
|
|
|
Standalone<StringRef> payload;
|
|
|
|
UID id;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, payload, id);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LoadedPingRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 4590979;
|
2017-05-26 04:48:44 +08:00
|
|
|
UID id;
|
|
|
|
bool loadReply;
|
|
|
|
Standalone<StringRef> payload;
|
|
|
|
ReplyPromise<LoadedReply> reply;
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, id, loadReply, payload, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CoordinationPingMessage {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 9982747;
|
2017-05-26 04:48:44 +08:00
|
|
|
UID clusterControllerId;
|
|
|
|
int64_t timeStep;
|
|
|
|
|
|
|
|
CoordinationPingMessage() : timeStep(0) {}
|
|
|
|
CoordinationPingMessage(UID ccId, uint64_t step) : clusterControllerId( ccId ), timeStep( step ) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, clusterControllerId, timeStep);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SetMetricsLogRateRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 4245995;
|
2017-05-26 04:48:44 +08:00
|
|
|
uint32_t metricsLogsPerSecond;
|
|
|
|
|
|
|
|
SetMetricsLogRateRequest() : metricsLogsPerSecond( 1 ) {}
|
|
|
|
explicit SetMetricsLogRateRequest(uint32_t logsPerSecond) : metricsLogsPerSecond( logsPerSecond ) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, metricsLogsPerSecond);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct EventLogRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 122319;
|
2017-05-26 04:48:44 +08:00
|
|
|
bool getLastError;
|
|
|
|
Standalone<StringRef> eventName;
|
2018-05-03 01:44:38 +08:00
|
|
|
ReplyPromise< TraceEventFields > reply;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
EventLogRequest() : getLastError(true) {}
|
|
|
|
explicit EventLogRequest( Standalone<StringRef> eventName ) : eventName( eventName ), getLastError( false ) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, getLastError, eventName, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DebugEntryRef {
|
|
|
|
double time;
|
|
|
|
NetworkAddress address;
|
|
|
|
StringRef context;
|
|
|
|
Version version;
|
|
|
|
MutationRef mutation;
|
|
|
|
DebugEntryRef() {}
|
2020-06-29 02:19:39 +08:00
|
|
|
DebugEntryRef(const char* c, Version v, MutationRef const& m)
|
|
|
|
: context((const uint8_t*)c, strlen(c)), version(v), mutation(m), time(now()),
|
|
|
|
address(g_network->getLocalAddress()) {}
|
|
|
|
DebugEntryRef(Arena& a, DebugEntryRef const& d)
|
|
|
|
: time(d.time), address(d.address), context(d.context), version(d.version), mutation(a, d.mutation) {}
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2020-06-29 02:19:39 +08:00
|
|
|
size_t expectedSize() const { return context.expectedSize() + mutation.expectedSize(); }
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, time, address, context, version, mutation);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DiskStoreRequest {
|
2019-01-31 05:53:23 +08:00
|
|
|
constexpr static FileIdentifier file_identifier = 1986262;
|
2017-05-26 04:48:44 +08:00
|
|
|
bool includePartialStores;
|
|
|
|
ReplyPromise<Standalone<VectorRef<UID>>> reply;
|
|
|
|
|
|
|
|
DiskStoreRequest(bool includePartialStores=false) : includePartialStores(includePartialStores) {}
|
|
|
|
|
|
|
|
template <class Ar>
|
|
|
|
void serialize(Ar& ar) {
|
2018-12-29 02:49:26 +08:00
|
|
|
serializer(ar, includePartialStores, reply);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-09-06 06:06:14 +08:00
|
|
|
struct Role {
|
|
|
|
static const Role WORKER;
|
|
|
|
static const Role STORAGE_SERVER;
|
|
|
|
static const Role TRANSACTION_LOG;
|
|
|
|
static const Role SHARED_TRANSACTION_LOG;
|
|
|
|
static const Role MASTER_PROXY;
|
2020-07-15 15:37:41 +08:00
|
|
|
static const Role GRV_PROXY;
|
2018-09-06 06:06:14 +08:00
|
|
|
static const Role MASTER;
|
|
|
|
static const Role RESOLVER;
|
|
|
|
static const Role CLUSTER_CONTROLLER;
|
|
|
|
static const Role TESTER;
|
|
|
|
static const Role LOG_ROUTER;
|
2018-12-14 05:31:37 +08:00
|
|
|
static const Role DATA_DISTRIBUTOR;
|
2019-03-27 23:15:19 +08:00
|
|
|
static const Role RATEKEEPER;
|
2019-11-13 05:01:29 +08:00
|
|
|
static const Role STORAGE_CACHE;
|
2019-07-04 02:09:36 +08:00
|
|
|
static const Role COORDINATOR;
|
2019-04-25 06:12:37 +08:00
|
|
|
static const Role BACKUP;
|
2018-09-06 06:06:14 +08:00
|
|
|
|
|
|
|
std::string roleName;
|
|
|
|
std::string abbreviation;
|
2018-09-06 06:53:12 +08:00
|
|
|
bool includeInTraceRoles;
|
2018-09-06 06:06:14 +08:00
|
|
|
|
2018-09-07 04:47:00 +08:00
|
|
|
bool operator==(const Role &r) const {
|
|
|
|
return roleName == r.roleName;
|
|
|
|
}
|
|
|
|
bool operator!=(const Role &r) const {
|
|
|
|
return !(*this == r);
|
2018-09-06 06:06:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2018-09-06 06:53:12 +08:00
|
|
|
Role(std::string roleName, std::string abbreviation, bool includeInTraceRoles=true) : roleName(roleName), abbreviation(abbreviation), includeInTraceRoles(includeInTraceRoles) {
|
2018-09-06 06:06:14 +08:00
|
|
|
ASSERT(abbreviation.size() == 2); // Having a fixed size makes log queries more straightforward
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-02-15 04:33:43 +08:00
|
|
|
void startRole(const Role &role, UID roleId, UID workerId, const std::map<std::string, std::string> &details = std::map<std::string, std::string>(), const std::string &origination = "Recruited");
|
2018-09-06 06:06:14 +08:00
|
|
|
void endRole(const Role &role, UID id, std::string reason, bool ok = true, Error e = Error());
|
2020-05-09 07:27:57 +08:00
|
|
|
ACTOR Future<Void> traceRole(Role role, UID roleId);
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
struct ServerDBInfo;
|
|
|
|
|
2019-06-25 17:47:35 +08:00
|
|
|
class Database openDBOnServer( Reference<AsyncVar<ServerDBInfo>> const& db, TaskPriority taskID = TaskPriority::DefaultEndpoint, bool enableLocalityLoadBalance = true, bool lockAware = false );
|
2019-02-18 11:13:26 +08:00
|
|
|
ACTOR Future<Void> extractClusterInterface(Reference<AsyncVar<Optional<struct ClusterControllerFullInterface>>> a,
|
|
|
|
Reference<AsyncVar<Optional<struct ClusterInterface>>> b);
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2019-02-18 13:59:55 +08:00
|
|
|
ACTOR Future<Void> fdbd(Reference<ClusterConnectionFile> ccf, LocalityData localities, ProcessClass processClass,
|
2019-02-18 11:13:26 +08:00
|
|
|
std::string dataFolder, std::string coordFolder, int64_t memoryLimit,
|
2019-04-03 20:27:11 +08:00
|
|
|
std::string metricsConnFile, std::string metricsPrefix, int64_t memoryProfilingThreshold,
|
2019-04-13 04:23:02 +08:00
|
|
|
std::string whitelistBinPaths);
|
2019-04-03 20:27:11 +08:00
|
|
|
|
2019-02-18 13:59:55 +08:00
|
|
|
ACTOR Future<Void> clusterController(Reference<ClusterConnectionFile> ccf,
|
2019-02-18 11:13:26 +08:00
|
|
|
Reference<AsyncVar<Optional<ClusterControllerFullInterface>>> currentCC,
|
|
|
|
Reference<AsyncVar<ClusterControllerPriorityInfo>> asyncPriorityInfo,
|
|
|
|
Future<Void> recoveredDiskFiles, LocalityData locality);
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
// These servers are started by workerServer
|
2019-02-18 13:59:55 +08:00
|
|
|
class IKeyValueStore;
|
|
|
|
class ServerCoordinators;
|
|
|
|
class IDiskQueue;
|
|
|
|
ACTOR Future<Void> storageServer(IKeyValueStore* persistentData, StorageServerInterface ssi, Tag seedTag,
|
2019-02-18 11:13:26 +08:00
|
|
|
ReplyPromise<InitializeStorageReply> recruitReply,
|
|
|
|
Reference<AsyncVar<ServerDBInfo>> db, std::string folder);
|
2019-02-18 13:59:55 +08:00
|
|
|
ACTOR Future<Void> storageServer(IKeyValueStore* persistentData, StorageServerInterface ssi,
|
2019-02-18 11:13:26 +08:00
|
|
|
Reference<AsyncVar<ServerDBInfo>> db, std::string folder,
|
2018-11-29 08:01:40 +08:00
|
|
|
Promise<Void> recovered,
|
2019-06-17 10:39:11 +08:00
|
|
|
Reference<ClusterConnectionFile> connFile ); // changes pssi->id() to be the recovered ID); // changes pssi->id() to be the recovered ID
|
2019-02-18 13:59:55 +08:00
|
|
|
ACTOR Future<Void> masterServer(MasterInterface mi, Reference<AsyncVar<ServerDBInfo>> db,
|
|
|
|
ServerCoordinators serverCoordinators, LifetimeToken lifetime, bool forceRecovery);
|
2019-02-18 11:13:26 +08:00
|
|
|
ACTOR Future<Void> masterProxyServer(MasterProxyInterface proxy, InitializeMasterProxyRequest req,
|
2019-04-13 04:23:02 +08:00
|
|
|
Reference<AsyncVar<ServerDBInfo>> db, std::string whitelistBinPaths);
|
2020-07-23 14:35:46 +08:00
|
|
|
ACTOR Future<Void> grvProxyServer(GrvProxyInterface proxy, InitializeGrvProxyRequest req, Reference<AsyncVar<ServerDBInfo>> db);
|
2019-02-18 13:59:55 +08:00
|
|
|
ACTOR Future<Void> tLog(IKeyValueStore* persistentData, IDiskQueue* persistentQueue,
|
2019-02-18 11:13:26 +08:00
|
|
|
Reference<AsyncVar<ServerDBInfo>> db, LocalityData locality,
|
2020-02-13 07:11:38 +08:00
|
|
|
PromiseStream<InitializeTLogRequest> tlogRequests, UID tlogId, UID workerID,
|
|
|
|
bool restoreFromDisk, Promise<Void> oldLog, Promise<Void> recovered, std::string folder,
|
2019-10-04 16:30:14 +08:00
|
|
|
Reference<AsyncVar<bool>> degraded, Reference<AsyncVar<UID>> activeSharedTLog);
|
2020-07-15 15:37:41 +08:00
|
|
|
ACTOR Future<Void> resolver(ResolverInterface resolver, InitializeResolverRequest initReq,
|
2019-02-18 13:59:55 +08:00
|
|
|
Reference<AsyncVar<ServerDBInfo>> db);
|
2019-02-18 11:13:26 +08:00
|
|
|
ACTOR Future<Void> logRouter(TLogInterface interf, InitializeLogRouterRequest req,
|
|
|
|
Reference<AsyncVar<ServerDBInfo>> db);
|
|
|
|
ACTOR Future<Void> dataDistributor(DataDistributorInterface ddi, Reference<AsyncVar<ServerDBInfo>> db);
|
2019-03-27 23:24:25 +08:00
|
|
|
ACTOR Future<Void> ratekeeper(RatekeeperInterface rki, Reference<AsyncVar<ServerDBInfo>> db);
|
2019-12-07 05:28:44 +08:00
|
|
|
ACTOR Future<Void> storageCacheServer(StorageServerInterface interf, uint16_t id, Reference<AsyncVar<ServerDBInfo>> db);
|
2019-04-25 06:12:37 +08:00
|
|
|
ACTOR Future<Void> backupWorker(BackupInterface bi, InitializeBackupRequest req, Reference<AsyncVar<ServerDBInfo>> db);
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
void registerThreadForProfiling();
|
|
|
|
void updateCpuProfiler(ProfilerRequest req);
|
|
|
|
|
2019-02-08 09:02:28 +08:00
|
|
|
namespace oldTLog_4_6 {
|
2019-02-18 11:13:26 +08:00
|
|
|
ACTOR Future<Void> tLog(IKeyValueStore* persistentData, IDiskQueue* persistentQueue,
|
2020-02-13 07:11:38 +08:00
|
|
|
Reference<AsyncVar<ServerDBInfo>> db, LocalityData locality, UID tlogId, UID workerID);
|
2017-05-26 04:48:44 +08:00
|
|
|
}
|
2019-02-08 09:02:29 +08:00
|
|
|
namespace oldTLog_6_0 {
|
2019-02-20 14:02:07 +08:00
|
|
|
ACTOR Future<Void> tLog(IKeyValueStore* persistentData, IDiskQueue* persistentQueue,
|
|
|
|
Reference<AsyncVar<ServerDBInfo>> db, LocalityData locality,
|
2020-02-13 07:11:38 +08:00
|
|
|
PromiseStream<InitializeTLogRequest> tlogRequests, UID tlogId, UID workerID,
|
|
|
|
bool restoreFromDisk, Promise<Void> oldLog, Promise<Void> recovered, std::string folder,
|
2019-10-04 16:30:14 +08:00
|
|
|
Reference<AsyncVar<bool>> degraded, Reference<AsyncVar<UID>> activeSharedTLog);
|
2019-02-20 14:02:07 +08:00
|
|
|
}
|
2019-10-03 07:41:00 +08:00
|
|
|
namespace oldTLog_6_2 {
|
|
|
|
ACTOR Future<Void> tLog(IKeyValueStore* persistentData, IDiskQueue* persistentQueue,
|
|
|
|
Reference<AsyncVar<ServerDBInfo>> db, LocalityData locality,
|
2020-02-22 11:09:16 +08:00
|
|
|
PromiseStream<InitializeTLogRequest> tlogRequests, UID tlogId, UID workerID,
|
|
|
|
bool restoreFromDisk, Promise<Void> oldLog, Promise<Void> recovered, std::string folder,
|
2019-10-04 16:30:14 +08:00
|
|
|
Reference<AsyncVar<bool>> degraded, Reference<AsyncVar<UID>> activeSharedTLog);
|
2019-10-03 07:41:00 +08:00
|
|
|
}
|
2019-02-20 14:02:07 +08:00
|
|
|
|
2019-02-23 04:15:23 +08:00
|
|
|
typedef decltype(&tLog) TLogFn;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2020-04-07 11:58:43 +08:00
|
|
|
#include "fdbserver/ServerDBInfo.h"
|
2019-02-18 11:13:26 +08:00
|
|
|
#include "flow/unactorcompiler.h"
|
2017-05-26 04:48:44 +08:00
|
|
|
#endif
|