Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coroutine refactor of tester and add benchmarks #11609

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fdbserver/ConsistencyScan.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "fdbserver/RatekeeperInterface.h"
#include "fdbserver/ServerDBInfo.h"
#include "fdbserver/WaitFailure.h"
#include "fdbserver/TesterInterface.actor.h"
#include "fdbserver/TesterInterface.h"
#include "flow/DeterministicRandom.h"
#include "flow/Trace.h"
#include "fdbserver/QuietDatabase.h"
Expand Down
2 changes: 1 addition & 1 deletion fdbserver/SimulatedCluster.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "fdbclient/ClusterConnectionFile.h"
#include "fdbclient/ClusterConnectionMemoryRecord.h"
#include "fdbclient/DatabaseContext.h"
#include "fdbserver/TesterInterface.actor.h"
#include "fdbserver/TesterInterface.h"
#include "fdbserver/WorkerInterface.actor.h"
#include "fdbclient/ClusterInterface.h"
#include "fdbserver/Knobs.h"
Expand Down
2 changes: 1 addition & 1 deletion fdbserver/fdbserver.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#include "fdbserver/ServerDBInfo.h"
#include "fdbserver/SimulatedCluster.h"
#include "fdbserver/Status.actor.h"
#include "fdbserver/TesterInterface.actor.h"
#include "fdbserver/TesterInterface.h"
#include "fdbserver/WorkerInterface.actor.h"
#include "fdbserver/pubsub.h"
#include "fdbserver/OnDemandStore.h"
Expand Down
2 changes: 1 addition & 1 deletion fdbserver/include/fdbserver/QuietDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "fdbclient/NativeAPI.actor.h"
#include "fdbclient/DatabaseContext.h" // for clone()
#include "fdbclient/FDBTypes.h"
#include "fdbserver/TesterInterface.actor.h"
#include "fdbserver/TesterInterface.h"
#include "fdbserver/WorkerInterface.actor.h"

Future<int64_t> getDataInFlight(Database const& cx, Reference<AsyncVar<struct ServerDBInfo> const> const&);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* TesterInterface.actor.h
* TesterInterface.h
*
* This source file is part of the FoundationDB open source project
*
Expand All @@ -20,17 +20,14 @@

#pragma once

#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_TESTERINTERFACE_ACTOR_G_H)
#define FDBSERVER_TESTERINTERFACE_ACTOR_G_H
#include "fdbserver/TesterInterface.actor.g.h"
#elif !defined(FDBSERVER_TESTERINTERFACE_ACTOR_H)
#define FDBSERVER_TESTERINTERFACE_ACTOR_H
#ifndef FDBSERVER_TESTERINTERFACE_H
#define FDBSERVER_TESTERINTERFACE_H

#include "fdbrpc/fdbrpc.h"
#include "fdbrpc/PerfMetric.h"
#include "fdbclient/NativeAPI.actor.h"
#include "flow/UnitTest.h"
#include "flow/actorcompiler.h" // has to be last include

struct CheckReply {
constexpr static FileIdentifier file_identifier = 11;

Expand Down Expand Up @@ -121,11 +118,11 @@ struct TesterInterface {
}
};

ACTOR Future<Void> testerServerCore(TesterInterface interf,
Reference<IClusterConnectionRecord> ccr,
Reference<AsyncVar<struct ServerDBInfo> const> serverDBInfo,
LocalityData locality,
Optional<std::string> expectedWorkLoad = Optional<std::string>());
Future<Void> testerServerCore(const TesterInterface& interf,
Reference<IClusterConnectionRecord> ccr,
Reference<AsyncVar<struct ServerDBInfo> const> serverDBInfo,
LocalityData locality,
Optional<std::string> expectedWorkLoad = Optional<std::string>());

enum test_location_t { TEST_HERE, TEST_ON_SERVERS, TEST_ON_TESTERS };
enum test_type_t {
Expand All @@ -135,18 +132,17 @@ enum test_type_t {
TEST_TYPE_CONSISTENCY_CHECK_URGENT
};

ACTOR Future<Void> runTests(
Reference<IClusterConnectionRecord> connRecord,
Future<Void> runTests(
const Reference<IClusterConnectionRecord>& connRecord,
test_type_t whatToRun,
test_location_t whereToRun,
int minTestersExpected,
std::string fileName = std::string(),
const std::string& fileName = std::string(),
StringRef startingConfiguration = StringRef(),
LocalityData locality = LocalityData(),
UnitTestParameters testOptions = UnitTestParameters(),
Optional<TenantName> defaultTenant = Optional<TenantName>(),
Standalone<VectorRef<TenantNameRef>> tenantsToCreate = Standalone<VectorRef<TenantNameRef>>(),
const LocalityData& locality = LocalityData(),
const UnitTestParameters& testOptions = UnitTestParameters(),
const Optional<TenantName>& defaultTenant = Optional<TenantName>(),
const Standalone<VectorRef<TenantNameRef>>& tenantsToCreate = Standalone<VectorRef<TenantNameRef>>(),
bool restartingTest = false);

#include "flow/unactorcompiler.h"
#endif
#endif // FDBSERVER_TESTERINTERFACE_H
2 changes: 1 addition & 1 deletion fdbserver/include/fdbserver/WorkerInterface.actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "fdbclient/BlobWorkerInterface.h"
#include "fdbclient/ClientBooleanParams.h"
#include "fdbclient/StorageServerInterface.h"
#include "fdbserver/TesterInterface.actor.h"
#include "fdbserver/TesterInterface.h"
#include "fdbclient/FDBTypes.h"
#include "fdbserver/LogSystemConfig.h"
#include "fdbrpc/MultiInterface.h"
Expand Down
16 changes: 8 additions & 8 deletions fdbserver/include/fdbserver/workloads/workloads.actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "fdbclient/NativeAPI.actor.h"
#include "fdbclient/DatabaseContext.h" // for clone()
#include "fdbserver/KnobProtectiveGroups.h"
#include "fdbserver/TesterInterface.actor.h"
#include "fdbserver/TesterInterface.h"
#include "fdbrpc/simulator.h"

#include <functional>
Expand Down Expand Up @@ -342,23 +342,23 @@ class TestSpec {
std::vector<std::string> disabledFailureInjectionWorkloads;
};

ACTOR Future<DistributedTestResults> runWorkload(Database cx,
std::vector<TesterInterface> testers,
TestSpec spec,
Optional<TenantName> defaultTenant);
Future<DistributedTestResults> runWorkload(Database cx,
std::vector<TesterInterface> testers,
TestSpec spec,
Optional<TenantName> defaultTenant);

void logMetrics(std::vector<PerfMetric> metrics);

ACTOR Future<Void> poisson(double* last, double meanInterval);
ACTOR Future<Void> uniform(double* last, double meanInterval);
Future<Void> poisson(double* last, double meanInterval);
Future<Void> uniform(double* last, double meanInterval);

void emplaceIndex(uint8_t* data, int offset, int64_t index);
Key doubleToTestKey(double p);
double testKeyToDouble(const KeyRef& p);
Key doubleToTestKey(double p, const KeyRef& prefix);
double testKeyToDouble(const KeyRef& p, const KeyRef& prefix);

ACTOR Future<Void> databaseWarmer(Database cx);
Future<Void> databaseWarmer(Database cx);

Future<Void> quietDatabase(Database const& cx,
Reference<AsyncVar<struct ServerDBInfo> const> const&,
Expand Down
Loading