Implementation complete (not yet working)

This commit is contained in:
mpilman 2019-01-30 13:53:23 -08:00
parent 1d5572a078
commit 6afce01744
36 changed files with 167 additions and 17 deletions

View File

@ -27,6 +27,7 @@
// ClientDBInfo is all the information needed by a database client to access the database
// It is returned (and kept up to date) by the OpenDatabaseRequest interface of ClusterInterface
struct ClientDBInfo {
constexpr static FileIdentifier file_identifier = 5355080;
UID id; // Changes each time anything else changes
vector< MasterProxyInterface > proxies;
double clientTxnInfoSampleRate;

View File

@ -30,6 +30,7 @@
// Streams from WorkerInterface that are safe and useful to call from a client.
// A ClientWorkerInterface is embedded as the first element of a WorkerInterface.
struct ClientWorkerInterface {
constexpr static FileIdentifier file_identifier = 12418152;
RequestStream< struct RebootRequest > reboot;
RequestStream< struct ProfilerRequest > profiler;
@ -45,6 +46,7 @@ struct ClientWorkerInterface {
};
struct RebootRequest {
constexpr static FileIdentifier file_identifier = 11913957;
bool deleteData;
bool checkData;
@ -57,6 +59,7 @@ struct RebootRequest {
};
struct ProfilerRequest {
constexpr static FileIdentifier file_identifier = 15437862;
ReplyPromise<Void> reply;
enum class Type : std::int8_t {

View File

@ -131,6 +131,7 @@ struct ClientVersionRef {
};
struct OpenDatabaseRequest {
constexpr static FileIdentifier file_identifier = 2799502;
// Sent by the native API to the cluster controller to open a database and track client
// info changes. Returns immediately if the current client info id is different from
// knownClientInfoID; otherwise returns when it next changes (or perhaps after a long interval)
@ -152,6 +153,7 @@ struct OpenDatabaseRequest {
};
struct SystemFailureStatus {
constexpr static FileIdentifier file_identifier = 3194108;
NetworkAddressList addresses;
FailureStatus status;
@ -175,6 +177,7 @@ struct FailureMonitoringRequest {
// The failureInformationVersion returned in reply should be passed back to the
// next request to facilitate delta compression of the failure information.
constexpr static FileIdentifier file_identifier = 5867851;
Optional<FailureStatus> senderStatus;
Version failureInformationVersion;
NetworkAddressList addresses;
@ -187,6 +190,7 @@ struct FailureMonitoringRequest {
};
struct FailureMonitoringReply {
constexpr static FileIdentifier file_identifier = 6820325;
VectorRef< SystemFailureStatus > changes;
Version failureInformationVersion;
bool allOthersFailed; // If true, changes are relative to all servers being failed, otherwise to the version given in the request
@ -201,6 +205,7 @@ struct FailureMonitoringReply {
};
struct StatusRequest {
constexpr static FileIdentifier file_identifier = 14419140;
ReplyPromise< struct StatusReply > reply;
template <class Ar>
@ -210,6 +215,7 @@ struct StatusRequest {
};
struct StatusReply {
constexpr static FileIdentifier file_identifier = 9980504;
StatusObject statusObj;
std::string statusStr;
@ -235,6 +241,7 @@ struct StatusReply {
};
struct GetClientWorkersRequest {
constexpr static FileIdentifier file_identifier = 10771791;
ReplyPromise<vector<ClientWorkerInterface>> reply;
GetClientWorkersRequest() {}
@ -246,6 +253,7 @@ struct GetClientWorkersRequest {
};
struct ForceRecoveryRequest {
constexpr static FileIdentifier file_identifier = 14821350;
Key dcId;
ReplyPromise<Void> reply;

View File

@ -91,6 +91,7 @@ private:
};
struct LeaderInfo {
constexpr static FileIdentifier file_identifier = 8338794;
UID changeID;
static const uint64_t mask = ~(127ll << 57);
Value serializedInfo;
@ -126,6 +127,7 @@ struct LeaderInfo {
};
struct GetLeaderRequest {
constexpr static FileIdentifier file_identifier = 214727;
Key key;
UID knownLeader;
ReplyPromise< Optional<LeaderInfo> > reply;

View File

@ -540,6 +540,7 @@ struct Traceable<RangeResultRef> : std::true_type {
};
struct KeyValueStoreType {
constexpr static FileIdentifier file_identifier = 6560359;
// These enumerated values are stored in the database configuration, so can NEVER be changed. Only add new ones just before END.
enum StoreType {
SSD_BTREE_V1,

View File

@ -30,6 +30,7 @@
#include "flow/Stats.h"
struct MasterProxyInterface {
constexpr static FileIdentifier file_identifier = 8954922;
enum { LocationAwareLoadBalance = 1 };
enum { AlwaysFresh = 1 };
@ -71,6 +72,7 @@ struct MasterProxyInterface {
};
struct CommitID {
constexpr static FileIdentifier file_identifier = 14254927;
Version version; // returns invalidVersion if transaction conflicts
uint16_t txnBatchId;
Optional<Value> metadataVersion;
@ -85,6 +87,7 @@ struct CommitID {
};
struct CommitTransactionRequest : TimedRequest {
constexpr static FileIdentifier file_identifier = 93948;
enum {
FLAG_IS_LOCK_AWARE = 0x1,
FLAG_FIRST_IN_BATCH = 0x2
@ -121,6 +124,7 @@ static inline int getBytes( CommitTransactionRequest const& r ) {
}
struct GetReadVersionReply {
constexpr static FileIdentifier file_identifier = 15709388;
Version version;
bool locked;
Optional<Value> metadataVersion;
@ -132,6 +136,7 @@ struct GetReadVersionReply {
};
struct GetReadVersionRequest : TimedRequest {
constexpr static FileIdentifier file_identifier = 838566;
enum {
PRIORITY_SYSTEM_IMMEDIATE = 15 << 24, // Highest possible priority, always executed even if writes are otherwise blocked
PRIORITY_DEFAULT = 8 << 24,
@ -161,6 +166,7 @@ struct GetReadVersionRequest : TimedRequest {
};
struct GetKeyServerLocationsReply {
constexpr static FileIdentifier file_identifier = 10636023;
Arena arena;
vector<pair<KeyRangeRef, vector<StorageServerInterface>>> results;
@ -171,6 +177,7 @@ struct GetKeyServerLocationsReply {
};
struct GetKeyServerLocationsRequest {
constexpr static FileIdentifier file_identifier = 9144680;
Arena arena;
KeyRef begin;
Optional<KeyRef> end;
@ -188,6 +195,7 @@ struct GetKeyServerLocationsRequest {
};
struct GetRawCommittedVersionRequest {
constexpr static FileIdentifier file_identifier = 12954034;
Optional<UID> debugID;
ReplyPromise<GetReadVersionReply> reply;
@ -200,6 +208,7 @@ struct GetRawCommittedVersionRequest {
};
struct GetStorageServerRejoinInfoReply {
constexpr static FileIdentifier file_identifier = 9469225;
Version version;
Tag tag;
Optional<Tag> newTag;
@ -213,6 +222,7 @@ struct GetStorageServerRejoinInfoReply {
};
struct GetStorageServerRejoinInfoRequest {
constexpr static FileIdentifier file_identifier = 994279;
UID id;
Optional<Value> dcId;
ReplyPromise< GetStorageServerRejoinInfoReply > reply;
@ -227,6 +237,7 @@ struct GetStorageServerRejoinInfoRequest {
};
struct TxnStateRequest {
constexpr static FileIdentifier file_identifier = 15250781;
Arena arena;
VectorRef<KeyValueRef> data;
Sequence sequence;

View File

@ -30,11 +30,8 @@
#include "flow/Stats.h"
struct StorageServerInterface {
enum {
BUSY_ALLOWED = 0,
BUSY_FORCE = 1,
BUSY_LOCAL = 2
};
constexpr static FileIdentifier file_identifier = 15302073;
enum { BUSY_ALLOWED = 0, BUSY_FORCE = 1, BUSY_LOCAL = 2 };
enum { LocationAwareLoadBalance = 1 };
enum { AlwaysFresh = 0 };
@ -114,6 +111,7 @@ struct ServerCacheInfo {
};
struct GetValueReply : public LoadBalancedReply {
constexpr static FileIdentifier file_identifier = 1378929;
Optional<Value> value;
GetValueReply() {}
@ -126,6 +124,7 @@ struct GetValueReply : public LoadBalancedReply {
};
struct GetValueRequest : TimedRequest {
constexpr static FileIdentifier file_identifier = 8454530;
Key key;
Version version;
Optional<UID> debugID;
@ -141,6 +140,7 @@ struct GetValueRequest : TimedRequest {
};
struct WatchValueRequest {
constexpr static FileIdentifier file_identifier = 14747733;
Key key;
Optional<Value> value;
Version version;
@ -157,6 +157,7 @@ struct WatchValueRequest {
};
struct GetKeyValuesReply : public LoadBalancedReply {
constexpr static FileIdentifier file_identifier = 1783066;
Arena arena;
VectorRef<KeyValueRef> data;
Version version; // useful when latestVersion was requested
@ -169,6 +170,7 @@ struct GetKeyValuesReply : public LoadBalancedReply {
};
struct GetKeyValuesRequest : TimedRequest {
constexpr static FileIdentifier file_identifier = 6795746;
Arena arena;
KeySelectorRef begin, end;
Version version; // or latestVersion
@ -185,6 +187,7 @@ struct GetKeyValuesRequest : TimedRequest {
};
struct GetKeyReply : public LoadBalancedReply {
constexpr static FileIdentifier file_identifier = 11226513;
KeySelector sel;
GetKeyReply() {}
@ -197,6 +200,7 @@ struct GetKeyReply : public LoadBalancedReply {
};
struct GetKeyRequest : TimedRequest {
constexpr static FileIdentifier file_identifier = 10457870;
Arena arena;
KeySelectorRef sel;
Version version; // or latestVersion
@ -212,6 +216,7 @@ struct GetKeyRequest : TimedRequest {
};
struct GetShardStateRequest {
constexpr static FileIdentifier file_identifier = 15860168;
enum waitMode {
NO_WAIT = 0,
FETCHING = 1,
@ -231,6 +236,7 @@ struct GetShardStateRequest {
};
struct StorageMetrics {
constexpr static FileIdentifier file_identifier = 13622226;
int64_t bytes; // total storage
int64_t bytesPerKSecond; // network bandwidth (average over 10s)
int64_t iosPerKSecond;
@ -283,6 +289,7 @@ struct StorageMetrics {
struct WaitMetricsRequest {
// Waits for any of the given minimum or maximum metrics to be exceeded, and then returns the current values
// Send a reversed range for min, max to receive an immediate report
constexpr static FileIdentifier file_identifier = 1795961;
Arena arena;
KeyRangeRef keys;
StorageMetrics min, max;
@ -301,6 +308,7 @@ struct WaitMetricsRequest {
};
struct SplitMetricsReply {
constexpr static FileIdentifier file_identifier = 11530792;
Standalone<VectorRef<KeyRef>> splits;
StorageMetrics used;
@ -311,6 +319,7 @@ struct SplitMetricsReply {
};
struct SplitMetricsRequest {
constexpr static FileIdentifier file_identifier = 10463876;
Arena arena;
KeyRangeRef keys;
StorageMetrics limits;
@ -329,6 +338,7 @@ struct SplitMetricsRequest {
};
struct GetPhysicalMetricsReply {
constexpr static FileIdentifier file_identifier = 15491478;
StorageMetrics load;
StorageMetrics free;
StorageMetrics capacity;
@ -340,6 +350,7 @@ struct GetPhysicalMetricsReply {
};
struct GetPhysicalMetricsRequest {
constexpr static FileIdentifier file_identifier = 13290999;
ReplyPromise<GetPhysicalMetricsReply> reply;
template <class Ar>
@ -350,6 +361,7 @@ struct GetPhysicalMetricsRequest {
struct StorageQueuingMetricsRequest {
// SOMEDAY: Send threshold value to avoid polling faster than the information changes?
constexpr static FileIdentifier file_identifier = 3978640;
ReplyPromise<struct StorageQueuingMetricsReply> reply;
template <class Ar>
@ -359,6 +371,7 @@ struct StorageQueuingMetricsRequest {
};
struct StorageQueuingMetricsReply {
constexpr static FileIdentifier file_identifier = 7633366;
double localTime;
int64_t instanceID; // changes if bytesDurable and bytesInput reset
int64_t bytesDurable, bytesInput;

View File

@ -329,7 +329,8 @@ struct Peer : NonCopyable {
}
pkt.connectPacketLength = sizeof(pkt) - sizeof(pkt.connectPacketLength);
pkt.protocolVersion = currentProtocolVersion;
pkt.protocolVersion =
g_network->useObjectSerializer() ? addObjectSerializerFlag(currentProtocolVersion) : currentProtocolVersion;
pkt.connectionId = transport->transportId;
PacketBuffer* pb_first = new PacketBuffer;
@ -1013,19 +1014,26 @@ static PacketID sendPacket( TransportData* self, ISerializeSource const& what, c
TEST(true); // "Loopback" delivery
// SOMEDAY: Would it be better to avoid (de)serialization by doing this check in flow?
Standalone<StringRef> copy;
if (g_network->useObjectSerializer()) {
ObjectWriter wr;
what.serializeBinaryWriter(wr);
copy = wr.toStringRef();
} else {
BinaryWriter wr( AssumeVersion(currentProtocolVersion) );
// we don't need to send using an object writer here. This is a loopback delivery
// and therefore it is guaranteed that both versions will have exactly the
// same structures - so the backwards compatability capabilities are never needed
// here.
what.serializeBinaryWriter(wr);
Standalone<StringRef> copy = wr.toValue();
copy = wr.toStringRef();
}
#if VALGRIND
VALGRIND_CHECK_MEM_IS_DEFINED(copy.begin(), copy.size());
#endif
deliver(self, destination, ArenaReader(copy.arena(), copy, AssumeVersion(currentProtocolVersion)), false,
false);
g_network->useObjectSerializer());
return (PacketID)NULL;
} else {

View File

@ -24,12 +24,14 @@
#include <algorithm>
#include "flow/network.h"
#include "flow/FileIdentifier.h"
#pragma pack(push, 4)
class Endpoint {
public:
// Endpoint represents a particular service (e.g. a serialized Promise<T> or PromiseStream<T>)
// An endpoint is either "local" (used for receiving data) or "remote" (used for sending data)
constexpr static FileIdentifier file_identifier = 10618805;
typedef UID Token;
NetworkAddressList addresses;
Token token;

View File

@ -25,6 +25,7 @@
#include "flow/flow.h"
struct ProcessClass {
constexpr static FileIdentifier file_identifier = 6697257;
// This enum is stored in restartInfo.ini for upgrade tests, so be very careful about changing the existing items!
enum ClassType { UnsetClass, StorageClass, TransactionClass, ResolutionClass, TesterClass, ProxyClass, MasterClass, StatelessClass, LogClass, ClusterControllerClass, LogRouterClass, DataDistributorClass, CoordinatorClass, RatekeeperClass, InvalidClass = -1 };
enum Fitness { BestFit, GoodFit, UnsetFit, OkayFit, WorstFit, ExcludeFit, NeverAssign }; //cannot be larger than 7 because of leader election mask

View File

@ -29,6 +29,7 @@
using std::vector;
struct PerfMetric {
constexpr static FileIdentifier file_identifier = 5980618;
PerfMetric() : m_name(""), m_value(0), m_averaged(false), m_format_code( "%.3g" ) {}
PerfMetric( std::string name, double value, bool averaged ) : m_name(name), m_value(value), m_averaged(averaged), m_format_code( "%.3g" ) {}
PerfMetric( std::string name, double value, bool averaged, std::string format_code ) : m_name(name), m_value(value), m_averaged(averaged), m_format_code(format_code) {}

View File

@ -392,7 +392,7 @@ void serializeReplicationPolicy(Ar& ar, Reference<IReplicationPolicy>& policy) {
policy = Reference<IReplicationPolicy>(pointer);
}
else if(name == LiteralStringRef("And")) {
PolicyAnd* pointer = new PolicyAnd({});
PolicyAnd* pointer = new PolicyAnd{};
pointer->serialize(ar);
policy = Reference<IReplicationPolicy>(pointer);
}

View File

@ -112,8 +112,9 @@ template <class T>
class ReplyPromise sealed
{
public:
constexpr static FileIdentifier file_identifier = (0x2 << 24) | FileIdentifierFor<T>::value;
template <class U>
void send(U && value) const {
void send(U&& value) const {
sav->send(std::forward<U>(value));
}
template <class E>

View File

@ -72,6 +72,7 @@ struct ClusterControllerFullInterface {
};
struct RecruitFromConfigurationRequest {
constexpr static FileIdentifier file_identifier = 2023046;
DatabaseConfiguration configuration;
bool recruitSeedServers;
int maxOldLogRouters;
@ -88,6 +89,7 @@ struct RecruitFromConfigurationRequest {
};
struct RecruitFromConfigurationReply {
constexpr static FileIdentifier file_identifier = 2224085;
vector<WorkerInterface> tLogs;
vector<WorkerInterface> satelliteTLogs;
vector<WorkerInterface> proxies;
@ -106,6 +108,7 @@ struct RecruitFromConfigurationReply {
};
struct RecruitRemoteFromConfigurationRequest {
constexpr static FileIdentifier file_identifier = 3235995;
DatabaseConfiguration configuration;
Optional<Key> dcId;
int logRouterCount;
@ -122,6 +125,7 @@ struct RecruitRemoteFromConfigurationRequest {
};
struct RecruitRemoteFromConfigurationReply {
constexpr static FileIdentifier file_identifier = 9091392;
vector<WorkerInterface> remoteTLogs;
vector<WorkerInterface> logRouters;
@ -132,6 +136,7 @@ struct RecruitRemoteFromConfigurationReply {
};
struct RecruitStorageReply {
constexpr static FileIdentifier file_identifier = 15877089;
WorkerInterface worker;
ProcessClass processClass;
@ -142,6 +147,7 @@ struct RecruitStorageReply {
};
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;
@ -155,6 +161,7 @@ struct RecruitStorageRequest {
};
struct RegisterWorkerReply {
constexpr static FileIdentifier file_identifier = 16475696;
ProcessClass processClass;
ClusterControllerPriorityInfo priorityInfo;
@ -168,6 +175,7 @@ struct RegisterWorkerReply {
};
struct RegisterWorkerRequest {
constexpr static FileIdentifier file_identifier = 14332605;
WorkerInterface wi;
ProcessClass initialClass;
ProcessClass processClass;
@ -189,6 +197,7 @@ struct RegisterWorkerRequest {
};
struct GetWorkersRequest {
constexpr static FileIdentifier file_identifier = 1254174;
enum { TESTER_CLASS_ONLY = 0x1, NON_EXCLUDED_PROCESSES_ONLY = 0x2 };
int flags;
@ -204,6 +213,7 @@ struct GetWorkersRequest {
};
struct RegisterMasterRequest {
constexpr static FileIdentifier file_identifier = 10773445;
UID id;
LocalityData mi;
LogSystemConfig logSystemConfig;
@ -231,6 +241,7 @@ struct RegisterMasterRequest {
};
struct GetServerDBInfoRequest {
constexpr static FileIdentifier file_identifier = 9467438;
UID knownServerInfoID;
Standalone<VectorRef<StringRef>> issues;
std::vector<NetworkAddress> incompatiblePeers;

View File

@ -25,6 +25,7 @@
#include "fdbclient/CoordinationInterface.h"
struct GenerationRegInterface {
constexpr static FileIdentifier file_identifier = 16726744;
RequestStream< struct GenerationRegReadRequest > read;
RequestStream< struct GenerationRegWriteRequest > write;
@ -52,6 +53,7 @@ struct GenerationRegInterface {
};
struct UniqueGeneration {
constexpr static FileIdentifier file_identifier = 16684234;
uint64_t generation;
UID uid;
UniqueGeneration() : generation(0) {}
@ -71,6 +73,7 @@ struct UniqueGeneration {
};
struct GenerationRegReadRequest {
constexpr static FileIdentifier file_identifier = 8975311;
Key key;
UniqueGeneration gen;
ReplyPromise<struct GenerationRegReadReply> reply;
@ -83,6 +86,7 @@ struct GenerationRegReadRequest {
};
struct GenerationRegReadReply {
constexpr static FileIdentifier file_identifier = 12623609;
Optional<Value> value;
UniqueGeneration gen, rgen;
GenerationRegReadReply() {}
@ -94,6 +98,7 @@ struct GenerationRegReadReply {
};
struct GenerationRegWriteRequest {
constexpr static FileIdentifier file_identifier = 3521510;
KeyValue kv;
UniqueGeneration gen;
ReplyPromise< UniqueGeneration > reply;
@ -116,6 +121,7 @@ struct LeaderElectionRegInterface : ClientLeaderRegInterface {
};
struct CandidacyRequest {
constexpr static FileIdentifier file_identifier = 14473958;
Key key;
LeaderInfo myInfo;
UID knownLeader, prevChangeID;
@ -131,6 +137,7 @@ struct CandidacyRequest {
};
struct LeaderHeartbeatRequest {
constexpr static FileIdentifier file_identifier = 9495992;
Key key;
LeaderInfo myInfo;
UID prevChangeID;
@ -146,6 +153,7 @@ struct LeaderHeartbeatRequest {
};
struct ForwardRequest {
constexpr static FileIdentifier file_identifier = 13570359;
Key key;
Value conn; // a cluster connection string
ReplyPromise<Void> reply;

View File

@ -75,8 +75,10 @@ ACTOR Future<Void> changeLeaderCoordinators( ServerCoordinators coordinators, Va
return Void();
}
ACTOR Future<Void> tryBecomeLeaderInternal( ServerCoordinators coordinators, Value proposedSerializedInterface, Reference<AsyncVar<Value>> outSerializedLeader, bool hasConnected, Reference<AsyncVar<ClusterControllerPriorityInfo>> asyncPriorityInfo ) {
state Reference<AsyncVar<vector<Optional<LeaderInfo>>>> nominees( new AsyncVar<vector<Optional<LeaderInfo>>>() );
ACTOR Future<Void> tryBecomeLeaderInternal(ServerCoordinators coordinators, Value proposedSerializedInterface,
Reference<AsyncVar<Value>> outSerializedLeader, bool hasConnected,
Reference<AsyncVar<ClusterControllerPriorityInfo>> asyncPriorityInfo) {
state Reference<AsyncVar<vector<Optional<LeaderInfo>>>> nominees(new AsyncVar<vector<Optional<LeaderInfo>>>());
state LeaderInfo myInfo;
state Future<Void> candidacies;
state bool iAmLeader = false;

View File

@ -31,6 +31,7 @@
typedef uint64_t DBRecoveryCount;
struct MasterInterface {
constexpr static FileIdentifier file_identifier = 5979145;
LocalityData locality;
RequestStream< ReplyPromise<Void> > waitFailure;
RequestStream< struct TLogRejoinRequest > tlogRejoin; // sent by tlog (whether or not rebooted) to communicate with a new master
@ -54,6 +55,7 @@ struct MasterInterface {
};
struct TLogRejoinRequest {
constexpr static FileIdentifier file_identifier = 15692200;
TLogInterface myInterface;
ReplyPromise<bool> reply; // false means someone else registered, so we should re-register. true means this master is recovered, so don't send again to the same master.
@ -66,6 +68,7 @@ struct TLogRejoinRequest {
};
struct ChangeCoordinatorsRequest {
constexpr static FileIdentifier file_identifier = 13605416;
Standalone<StringRef> newConnectionString;
ReplyPromise<Void> reply; // normally throws even on success!
@ -79,6 +82,7 @@ struct ChangeCoordinatorsRequest {
};
struct ResolverMoveRef {
constexpr static FileIdentifier file_identifier = 11945475;
KeyRangeRef range;
int dest;
@ -104,6 +108,7 @@ struct ResolverMoveRef {
};
struct GetCommitVersionReply {
constexpr static FileIdentifier file_identifier = 3568822;
Standalone<VectorRef<ResolverMoveRef>> resolverChanges;
Version resolverChangesVersion;
Version version;
@ -120,6 +125,7 @@ struct GetCommitVersionReply {
};
struct GetCommitVersionRequest {
constexpr static FileIdentifier file_identifier = 16683181;
uint64_t requestNum;
uint64_t mostRecentProcessedRequestNum;
UID requestingProxy;

View File

@ -24,6 +24,7 @@
#include "fdbclient/FDBTypes.h"
#include "fdbrpc/fdbrpc.h"
#include "flow/FileIdentifier.h"
struct NetworkTestInterface {
RequestStream< struct NetworkTestRequest > test;
@ -33,6 +34,7 @@ struct NetworkTestInterface {
};
struct NetworkTestRequest {
constexpr static FileIdentifier file_identifier = 4146513;
Key key;
uint32_t replySize;
ReplyPromise<struct NetworkTestReply> reply;
@ -45,6 +47,7 @@ struct NetworkTestRequest {
};
struct NetworkTestReply {
constexpr static FileIdentifier file_identifier = 14465374;
Value value;
NetworkTestReply() {}
NetworkTestReply( Value value ) : value(value) {}

View File

@ -25,6 +25,7 @@
#include "fdbclient/FDBTypes.h"
struct ResolverInterface {
constexpr static FileIdentifier file_identifier = 1755944;
enum { LocationAwareLoadBalance = 1 };
enum { AlwaysFresh = 1 };
@ -54,6 +55,7 @@ struct ResolverInterface {
};
struct StateTransactionRef {
constexpr static FileIdentifier file_identifier = 6150271;
StateTransactionRef() {}
StateTransactionRef(const bool committed, VectorRef<MutationRef> const& mutations) : committed(committed), mutations(mutations) {}
StateTransactionRef(Arena &p, const StateTransactionRef &toCopy) : committed(toCopy.committed), mutations(p, toCopy.mutations) {}
@ -70,6 +72,7 @@ struct StateTransactionRef {
};
struct ResolveTransactionBatchReply {
constexpr static FileIdentifier file_identifier = 15472264;
Arena arena;
VectorRef<uint8_t> committed;
Optional<UID> debugID;
@ -83,6 +86,7 @@ struct ResolveTransactionBatchReply {
};
struct ResolveTransactionBatchRequest {
constexpr static FileIdentifier file_identifier = 16462858;
Arena arena;
Version prevVersion;
@ -100,6 +104,7 @@ struct ResolveTransactionBatchRequest {
};
struct ResolutionMetricsRequest {
constexpr static FileIdentifier file_identifier = 11663527;
ReplyPromise<int64_t> reply;
template <class Archive>
@ -109,6 +114,7 @@ struct ResolutionMetricsRequest {
};
struct ResolutionSplitReply {
constexpr static FileIdentifier file_identifier = 12137765;
Key key;
int64_t used;
template <class Archive>
@ -119,6 +125,7 @@ struct ResolutionSplitReply {
};
struct ResolutionSplitRequest {
constexpr static FileIdentifier file_identifier = 167535;
KeyRange range;
int64_t offset;
bool front;

View File

@ -28,6 +28,7 @@
#include "fdbrpc/Locality.h"
struct RestoreInterface {
constexpr static FileIdentifier file_identifier = 13398189;
RequestStream< struct TestRequest > test;
bool operator == (RestoreInterface const& r) const { return id() == r.id(); }
@ -46,6 +47,7 @@ struct RestoreInterface {
};
struct TestRequest {
constexpr static FileIdentifier file_identifier = 14404487;
int testData;
ReplyPromise< struct TestReply > reply;
@ -59,6 +61,7 @@ struct TestRequest {
};
struct TestReply {
constexpr static FileIdentifier file_identifier = 12075719;
int replyData;
TestReply() : replyData(0) {}

View File

@ -31,6 +31,7 @@
#include "fdbserver/LatencyBandConfig.h"
struct ServerDBInfo {
constexpr static FileIdentifier file_identifier = 13838807;
// This structure contains transient information which is broadcast to all workers for a database,
// permitting them to communicate with each other. It is not available to the client. This mechanism
// (see GetServerDBInfoRequest) is closely parallel to OpenDatabaseRequest for the client.

View File

@ -29,6 +29,7 @@
#include <iterator>
struct TLogInterface {
constexpr static FileIdentifier file_identifier = 16308510;
enum { LocationAwareLoadBalance = 1 };
enum { AlwaysFresh = 1 };
@ -71,6 +72,7 @@ struct TLogInterface {
};
struct TLogRecoveryFinishedRequest {
constexpr static FileIdentifier file_identifier = 8818668;
ReplyPromise<Void> reply;
TLogRecoveryFinishedRequest() {}
@ -82,6 +84,7 @@ struct TLogRecoveryFinishedRequest {
};
struct TLogLockResult {
constexpr static FileIdentifier file_identifier = 11822027;
Version end;
Version knownCommittedVersion;
@ -92,6 +95,7 @@ struct TLogLockResult {
};
struct TLogConfirmRunningRequest {
constexpr static FileIdentifier file_identifier = 10929130;
Optional<UID> debugID;
ReplyPromise<Void> reply;
@ -136,6 +140,7 @@ struct VerUpdateRef {
};
struct TLogPeekReply {
constexpr static FileIdentifier file_identifier = 11365689;
Arena arena;
StringRef messages;
Version end;
@ -151,6 +156,7 @@ struct TLogPeekReply {
};
struct TLogPeekRequest {
constexpr static FileIdentifier file_identifier = 11001131;
Arena arena;
Version begin;
Tag tag;
@ -168,6 +174,7 @@ struct TLogPeekRequest {
};
struct TLogPopRequest {
constexpr static FileIdentifier file_identifier = 5556423;
Arena arena;
Version to;
Version durableKnownCommittedVersion;
@ -201,6 +208,7 @@ struct TagMessagesRef {
};
struct TLogCommitRequest {
constexpr static FileIdentifier file_identifier = 4022206;
Arena arena;
Version prevVersion, version, knownCommittedVersion, minKnownCommittedVersion;
@ -219,6 +227,7 @@ struct TLogCommitRequest {
};
struct TLogQueuingMetricsRequest {
constexpr static FileIdentifier file_identifier = 7798476;
ReplyPromise<struct TLogQueuingMetricsReply> reply;
template <class Ar>
@ -228,6 +237,7 @@ struct TLogQueuingMetricsRequest {
};
struct TLogQueuingMetricsReply {
constexpr static FileIdentifier file_identifier = 12206626;
double localTime;
int64_t instanceID; // changes if bytesDurable and bytesInput reset
int64_t bytesDurable, bytesInput;

View File

@ -33,6 +33,7 @@
#include "flow/actorcompiler.h" // has to be last include
struct WorkloadInterface {
constexpr static FileIdentifier file_identifier = 4454551;
RequestStream<ReplyPromise<Void>> setup;
RequestStream<ReplyPromise<Void>> start;
RequestStream<ReplyPromise<bool>> check;
@ -48,6 +49,7 @@ struct WorkloadInterface {
};
struct WorkloadRequest {
constexpr static FileIdentifier file_identifier = 8121024;
Arena arena;
StringRef title;
int timeout;
@ -79,6 +81,7 @@ struct WorkloadRequest {
};
struct TesterInterface {
constexpr static FileIdentifier file_identifier = 4465210;
RequestStream<WorkloadRequest> recruitments;
UID id() const { return recruitments.getEndpoint().token; }

View File

@ -41,6 +41,7 @@
#define DUMPTOKEN( name ) TraceEvent("DumpToken", recruited.id()).detail("Name", #name).detail("Token", name.getEndpoint().token)
struct WorkerInterface {
constexpr static FileIdentifier file_identifier = 14712718;
ClientWorkerInterface clientInterface;
LocalityData locality;
RequestStream< struct InitializeTLogRequest > tLog;
@ -89,6 +90,7 @@ struct WorkerDetails {
};
struct InitializeTLogRequest {
constexpr static FileIdentifier file_identifier = 15604392;
UID recruitmentID;
LogSystemConfig recoverFrom;
Version recoverAt;
@ -116,6 +118,7 @@ struct InitializeTLogRequest {
};
struct InitializeLogRouterRequest {
constexpr static FileIdentifier file_identifier = 2976228;
uint64_t recoveryCount;
Tag routerTag;
Version startVersion;
@ -132,6 +135,7 @@ struct InitializeLogRouterRequest {
// FIXME: Rename to InitializeMasterRequest, etc
struct RecruitMasterRequest {
constexpr static FileIdentifier file_identifier = 12684574;
Arena arena;
LifetimeToken lifetime;
bool forceRecovery;
@ -147,6 +151,7 @@ struct RecruitMasterRequest {
};
struct InitializeMasterProxyRequest {
constexpr static FileIdentifier file_identifier = 10344153;
MasterInterface master;
uint64_t recoveryCount;
Version recoveryTransactionVersion;
@ -184,6 +189,7 @@ struct InitializeRatekeeperRequest {
};
struct InitializeResolverRequest {
constexpr static FileIdentifier file_identifier = 7413317;
uint64_t recoveryCount;
int proxyCount;
int resolverCount;
@ -196,6 +202,7 @@ struct InitializeResolverRequest {
};
struct InitializeStorageReply {
constexpr static FileIdentifier file_identifier = 10390645;
StorageServerInterface interf;
Version addedVersion;
@ -206,6 +213,7 @@ struct InitializeStorageReply {
};
struct InitializeStorageRequest {
constexpr static FileIdentifier file_identifier = 16665642;
Tag seedTag; //< If this server will be passed to seedShardServers, this will be a tag, otherwise it is invalidTag
UID reqId;
UID interfaceId;
@ -219,6 +227,7 @@ struct InitializeStorageRequest {
};
struct TraceBatchDumpRequest {
constexpr static FileIdentifier file_identifier = 8184121;
ReplyPromise<Void> reply;
template <class Ar>
@ -228,6 +237,7 @@ struct TraceBatchDumpRequest {
};
struct LoadedReply {
constexpr static FileIdentifier file_identifier = 9956350;
Standalone<StringRef> payload;
UID id;
@ -238,6 +248,7 @@ struct LoadedReply {
};
struct LoadedPingRequest {
constexpr static FileIdentifier file_identifier = 4590979;
UID id;
bool loadReply;
Standalone<StringRef> payload;
@ -250,6 +261,7 @@ struct LoadedPingRequest {
};
struct CoordinationPingMessage {
constexpr static FileIdentifier file_identifier = 9982747;
UID clusterControllerId;
int64_t timeStep;
@ -263,6 +275,7 @@ struct CoordinationPingMessage {
};
struct SetMetricsLogRateRequest {
constexpr static FileIdentifier file_identifier = 4245995;
uint32_t metricsLogsPerSecond;
SetMetricsLogRateRequest() : metricsLogsPerSecond( 1 ) {}
@ -275,6 +288,7 @@ struct SetMetricsLogRateRequest {
};
struct EventLogRequest {
constexpr static FileIdentifier file_identifier = 122319;
bool getLastError;
Standalone<StringRef> eventName;
ReplyPromise< TraceEventFields > reply;
@ -309,6 +323,7 @@ struct DebugEntryRef {
};
struct DiskStoreRequest {
constexpr static FileIdentifier file_identifier = 1986262;
bool includePartialStores;
ReplyPromise<Standalone<VectorRef<UID>>> reply;

View File

@ -15,6 +15,9 @@
*/
#ifndef _BTREE_H_
#define _BTREE_H_
#ifndef NDEBUG
#define NDEBUG
#endif
/* TODO: This definition is just included so other modules compile. It
** needs to be revisited.

View File

@ -1,3 +1,6 @@
#ifndef NDEBUG
#define NDEBUG
#endif
#ifndef NDEBUG
#define SQLITE_DEBUG 1
#endif

View File

@ -24,6 +24,7 @@
#include "flow/actorcompiler.h" // This must be the last #include.
struct SidebandMessage {
constexpr static FileIdentifier file_identifier = 11862046;
uint64_t key;
Version commitVersion;
@ -37,6 +38,7 @@ struct SidebandMessage {
};
struct SidebandInterface {
constexpr static FileIdentifier file_identifier = 15950544;
RequestStream<SidebandMessage> updates;
UID id() const { return updates.getEndpoint().token; }

View File

@ -27,6 +27,7 @@
#include "flow/Error.h"
#include "flow/Trace.h"
#include "flow/ObjectSerializerTraits.h"
#include "flow/FileIdentifier.h"
#include <algorithm>
#include <stdint.h>
#include <string>
@ -512,6 +513,7 @@ extern std::string format(const char* form, ...);
#pragma pack( push, 4 )
class StringRef {
public:
constexpr static FileIdentifier file_identifier = 13300811;
StringRef() : data(0), length(0) {}
StringRef( Arena& p, const StringRef& toCopy ) : data( new (p) uint8_t[toCopy.size()] ), length( toCopy.size() ) {
memcpy( (void*)data, toCopy.data, length );
@ -778,6 +780,7 @@ template <class T>
class VectorRef {
public:
using value_type = T;
static constexpr FileIdentifier file_identifier = (0x8 << 24) | FileIdentifierFor<T>::value;
// T must be trivially destructible (and copyable)!
VectorRef() : data(0), m_size(0), m_capacity(0) {}

View File

@ -29,6 +29,7 @@
#include <boost/preprocessor/control/if.hpp>
#include "flow/Platform.h"
#include "flow/Knobs.h"
#include "flow/FileIdentifier.h"
#include "flow/ObjectSerializerTraits.h"
enum { invalid_error_code = 0xffff };
@ -41,6 +42,7 @@ public:
class Error {
public:
constexpr static FileIdentifier file_identifier = 14065384;
int code() const { return error_code; }
const char* name() const;
const char* what() const;

View File

@ -25,9 +25,7 @@ using FileIdentifier = uint32_t;
template <class T>
struct FileIdentifierFor {
//constexpr static FileIdentifier value = T::file_identifier;
// TODO: use file identifiers for different types
constexpr static FileIdentifier value = 0xffffff;
constexpr static FileIdentifier value = T::file_identifier;
};
template <>

View File

@ -23,6 +23,7 @@
#pragma once
#include "flow/Platform.h"
#include "flow/FileIdentifier.h"
#include "flow/ObjectSerializerTraits.h"
#include <stdint.h>
#if (defined(__APPLE__))
@ -35,6 +36,7 @@
class UID {
uint64_t part[2];
public:
constexpr static FileIdentifier file_identifier = 15597147;
UID() { part[0] = part[1] = 0; }
UID( uint64_t a, uint64_t b ) { part[0]=a; part[1]=b; }
std::string toString() const;

View File

@ -101,7 +101,7 @@ class ObjectWriter {
public:
template <class... Items>
void serialize(FileIdentifier file_identifier, Items const&... items) {
ASSERT(data = nullptr); // object serializer can only serialize one object
ASSERT(data == nullptr); // object serializer can only serialize one object
int allocations = 0;
auto allocator = [this, &allocations](size_t size_) {
++allocations;

View File

@ -57,6 +57,7 @@ enum Severity {
class TraceEventFields {
public:
constexpr static FileIdentifier file_identifier = 11262274;
typedef std::pair<std::string, std::string> Field;
typedef std::vector<Field> FieldContainer;
typedef FieldContainer::const_iterator FieldIterator;

View File

@ -44,6 +44,7 @@
#include "flow/Deque.h"
#include "flow/ThreadPrimitives.h"
#include "flow/network.h"
#include "flow/FileIdentifier.h"
#include <boost/version.hpp>
@ -114,6 +115,7 @@ Standalone<StringRef> concatenate( Iter b, Iter const& e ) {
class Void {
public:
constexpr static FileIdentifier file_identifier = 2010442;
template <class Ar>
void serialize(Ar&) {}
};
@ -123,6 +125,7 @@ class Never {};
template <class T>
class ErrorOr {
public:
constexpr static FileIdentifier file_identifier = (0x1 << 24) | FileIdentifierFor<T>::value;
ErrorOr() : error(default_error_or()) {}
ErrorOr(Error const& error) : error(error) {}
ErrorOr(const ErrorOr<T>& o) : error(o.error) {

View File

@ -715,6 +715,7 @@ private:
struct ISerializeSource {
virtual void serializePacketWriter(PacketWriter&, bool useObjectSerializer) const = 0;
virtual void serializeBinaryWriter(BinaryWriter&) const = 0;
virtual void serializeBinaryWriter(ObjectWriter&) const = 0;
};
template <class T, class V>
@ -737,7 +738,12 @@ struct SerializeSource : MakeSerializeSource<SerializeSource<T>, T> {
using value_type = T;
T const& value;
SerializeSource(T const& value) : value(value) {}
template <class Ar> void serialize(Ar& ar) const { ar << value; }
virtual void serializeBinaryWriter(ObjectWriter& w) const {
w.serialize(value);
}
template <class Ar> void serialize(Ar& ar) const {
ar << value;
}
virtual T const& get() const { return value; }
};
@ -748,6 +754,9 @@ struct SerializeBoolAnd : MakeSerializeSource<SerializeBoolAnd<T>, T> {
T const& value;
SerializeBoolAnd( bool b, T const& value ) : b(b), value(value) {}
template <class Ar> void serialize(Ar& ar) const { ar << b << value; }
virtual void serializeBinaryWriter(ObjectWriter& w) const {
ASSERT(false);
}
virtual T const& get() const {
// This is only used for the streaming serializer
ASSERT(false);

View File

@ -271,6 +271,9 @@ def run_simulation_test(basedir, options):
if options.testtype == 'test':
pargs.append('-C')
pargs.append(os.path.join(args.builddir, 'fdb.cluster'))
else:
pargs.append('-S')
pargs.append('random')
td = TestDirectory(basedir)
if options.buggify:
pargs.append('-b')