mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 10:22:20 +08:00
Fix compiling errors
This commit is contained in:
parent
40c7cfec0c
commit
65443b6541
@ -215,10 +215,10 @@ struct SimClogging {
|
|||||||
t = std::max(t, clogPairUntil[pair]);
|
t = std::max(t, clogPairUntil[pair]);
|
||||||
|
|
||||||
auto p = std::make_pair(from, to);
|
auto p = std::make_pair(from, to);
|
||||||
if (!g_simulator.speedUpSimulation && !stableConnection && clogProcessPairUntil.count(p))
|
if (!g_simulator->speedUpSimulation && !stableConnection && clogProcessPairUntil.count(p))
|
||||||
t = std::max(t, clogProcessPairUntil[p]);
|
t = std::max(t, clogProcessPairUntil[p]);
|
||||||
|
|
||||||
if (!g_simulator.speedUpSimulation && !stableConnection && clogRecvUntil.count(to.ip))
|
if (!g_simulator->speedUpSimulation && !stableConnection && clogRecvUntil.count(to.ip))
|
||||||
t = std::max(t, clogRecvUntil[to.ip]);
|
t = std::max(t, clogRecvUntil[to.ip]);
|
||||||
|
|
||||||
return t - tnow;
|
return t - tnow;
|
||||||
|
@ -22,11 +22,14 @@
|
|||||||
#include "fdbclient/ManagementAPI.actor.h"
|
#include "fdbclient/ManagementAPI.actor.h"
|
||||||
#include "fdbclient/NativeAPI.actor.h"
|
#include "fdbclient/NativeAPI.actor.h"
|
||||||
#include "fdbrpc/Locality.h"
|
#include "fdbrpc/Locality.h"
|
||||||
|
#include "fdbrpc/SimulatorProcessInfo.h"
|
||||||
#include "fdbserver/RecoveryState.h"
|
#include "fdbserver/RecoveryState.h"
|
||||||
#include "fdbserver/ServerDBInfo.actor.h"
|
#include "fdbserver/ServerDBInfo.actor.h"
|
||||||
#include "fdbserver/TesterInterface.actor.h"
|
#include "fdbserver/TesterInterface.actor.h"
|
||||||
#include "fdbserver/workloads/workloads.actor.h"
|
#include "fdbserver/workloads/workloads.actor.h"
|
||||||
#include "fdbrpc/simulator.h"
|
#include "fdbrpc/simulator.h"
|
||||||
|
#include "flow/CodeProbe.h"
|
||||||
|
#include "flow/NetworkAddress.h"
|
||||||
#include "flow/Error.h"
|
#include "flow/Error.h"
|
||||||
#include "flow/Trace.h"
|
#include "flow/Trace.h"
|
||||||
#include "flow/flow.h"
|
#include "flow/flow.h"
|
||||||
@ -34,6 +37,7 @@
|
|||||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||||
|
|
||||||
struct ClogTlogWorkload : TestWorkload {
|
struct ClogTlogWorkload : TestWorkload {
|
||||||
|
static constexpr auto NAME = "ClogTlog";
|
||||||
bool enabled;
|
bool enabled;
|
||||||
double testDuration;
|
double testDuration;
|
||||||
bool clogged = false;
|
bool clogged = false;
|
||||||
@ -42,19 +46,12 @@ struct ClogTlogWorkload : TestWorkload {
|
|||||||
|
|
||||||
ClogTlogWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {
|
ClogTlogWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {
|
||||||
enabled = !clientId; // only do this on the "first" client
|
enabled = !clientId; // only do this on the "first" client
|
||||||
testDuration = getOption(options, LiteralStringRef("testDuration"), 100.0);
|
testDuration = getOption(options, "testDuration"_sr, 1000.0);
|
||||||
}
|
|
||||||
|
|
||||||
std::string description() const override {
|
|
||||||
if (&g_simulator == g_network)
|
|
||||||
return "ClogTlog";
|
|
||||||
else
|
|
||||||
return "NoRC";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Void> setup(Database const& cx) override { return Void(); }
|
Future<Void> setup(Database const& cx) override { return Void(); }
|
||||||
Future<Void> start(Database const& cx) override {
|
Future<Void> start(Database const& cx) override {
|
||||||
if (&g_simulator == g_network && enabled)
|
if (g_network->isSimulated() && enabled)
|
||||||
return timeout(reportErrors(clogClient(this, cx), "ClogTlogError"), testDuration, Void());
|
return timeout(reportErrors(clogClient(this, cx), "ClogTlogError"), testDuration, Void());
|
||||||
else
|
else
|
||||||
return Void();
|
return Void();
|
||||||
@ -62,11 +59,6 @@ struct ClogTlogWorkload : TestWorkload {
|
|||||||
Future<bool> check(Database const& cx) override { return true; }
|
Future<bool> check(Database const& cx) override { return true; }
|
||||||
void getMetrics(std::vector<PerfMetric>& m) override {}
|
void getMetrics(std::vector<PerfMetric>& m) override {}
|
||||||
|
|
||||||
ACTOR void doClog(ISimulator::ProcessInfo* machine, double t, double delay = 0.0) {
|
|
||||||
wait(::delay(delay));
|
|
||||||
g_simulator.clogInterface(machine->address.ip, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clog a random tlog with all other processes so that this triggers a recovery
|
// Clog a random tlog with all other processes so that this triggers a recovery
|
||||||
// and the recovery may become stuck if the clogged tlog is recruited again.
|
// and the recovery may become stuck if the clogged tlog is recruited again.
|
||||||
void clogTlog(double seconds) {
|
void clogTlog(double seconds) {
|
||||||
@ -74,7 +66,7 @@ struct ClogTlogWorkload : TestWorkload {
|
|||||||
|
|
||||||
IPAddress cc = dbInfo->get().clusterInterface.address().ip;
|
IPAddress cc = dbInfo->get().clusterInterface.address().ip;
|
||||||
std::vector<IPAddress> ips; // all FDB process IPs
|
std::vector<IPAddress> ips; // all FDB process IPs
|
||||||
for (const auto& process : g_simulator.getAllProcesses()) {
|
for (const auto& process : g_simulator->getAllProcesses()) {
|
||||||
const auto& ip = process->address.ip;
|
const auto& ip = process->address.ip;
|
||||||
if (process->startingClass != ProcessClass::TesterClass) {
|
if (process->startingClass != ProcessClass::TesterClass) {
|
||||||
ips.push_back(ip);
|
ips.push_back(ip);
|
||||||
@ -103,8 +95,8 @@ struct ClogTlogWorkload : TestWorkload {
|
|||||||
// clog pairs
|
// clog pairs
|
||||||
for (const auto& ip : ips) {
|
for (const auto& ip : ips) {
|
||||||
if (ip != tlog.get().ip && ip != cc) {
|
if (ip != tlog.get().ip && ip != cc) {
|
||||||
g_simulator.clogPair(ip, tlog.get().ip, seconds);
|
g_simulator->clogPair(ip, tlog.get().ip, seconds);
|
||||||
g_simulator.clogPair(tlog.get().ip, ip, seconds);
|
g_simulator->clogPair(tlog.get().ip, ip, seconds);
|
||||||
cloggedPairs.emplace_back(ip, tlog.get().ip);
|
cloggedPairs.emplace_back(ip, tlog.get().ip);
|
||||||
cloggedPairs.emplace_back(tlog.get().ip, ip);
|
cloggedPairs.emplace_back(tlog.get().ip, ip);
|
||||||
}
|
}
|
||||||
@ -115,7 +107,7 @@ struct ClogTlogWorkload : TestWorkload {
|
|||||||
void unclogAll() {
|
void unclogAll() {
|
||||||
// unclog previously clogged connections
|
// unclog previously clogged connections
|
||||||
for (const auto& pair : cloggedPairs) {
|
for (const auto& pair : cloggedPairs) {
|
||||||
g_simulator.unclogPair(pair.first, pair.second);
|
g_simulator->unclogPair(pair.first, pair.second);
|
||||||
}
|
}
|
||||||
cloggedPairs.clear();
|
cloggedPairs.clear();
|
||||||
}
|
}
|
||||||
@ -135,7 +127,7 @@ struct ClogTlogWorkload : TestWorkload {
|
|||||||
std::vector<StringRef> tokens;
|
std::vector<StringRef> tokens;
|
||||||
state Optional<ConfigureAutoResult> conf;
|
state Optional<ConfigureAutoResult> conf;
|
||||||
|
|
||||||
TEST(true); // Exclude failed tlog
|
CODE_PROBE(true, "Exclude failed tlog");
|
||||||
TraceEvent("ExcludeFailedLog")
|
TraceEvent("ExcludeFailedLog")
|
||||||
.detail("TLog", self->tlog.get())
|
.detail("TLog", self->tlog.get())
|
||||||
.detail("RecoveryState", self->dbInfo->get().recoveryState);
|
.detail("RecoveryState", self->dbInfo->get().recoveryState);
|
||||||
@ -188,4 +180,4 @@ struct ClogTlogWorkload : TestWorkload {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
WorkloadFactory<ClogTlogWorkload> ClogTlogWorkloadFactory("ClogTlog");
|
WorkloadFactory<ClogTlogWorkload> ClogTlogWorkloadFactory;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user