mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
Add config_classes command line option for fdbserver
This commit is contained in:
parent
a5749de6b6
commit
7681f38f45
@ -24,9 +24,6 @@
|
||||
|
||||
#include "fdbclient/FDBTypes.h"
|
||||
|
||||
using ConfigClassSetRef = VectorRef<KeyRef>;
|
||||
using ConfigClassSet = Standalone<ConfigClassSetRef>;
|
||||
|
||||
struct ConfigKeyRef {
|
||||
KeyRef configClass;
|
||||
KeyRef knobName;
|
||||
|
@ -140,7 +140,9 @@ public:
|
||||
|
||||
void addVersionedMutations(Standalone<VectorRef<VersionedConfigMutationRef>> const& versionedMutations,
|
||||
Version mostRecentVersion) {
|
||||
// TODO: Implement
|
||||
this->versionedMutations.insert(
|
||||
this->versionedMutations.end(), versionedMutations.begin(), versionedMutations.end());
|
||||
this->mostRecentVersion = mostRecentVersion;
|
||||
}
|
||||
|
||||
void setSnapshot(std::map<ConfigKey, Value>&& snapshot, Version lastCompactedVersion) {
|
||||
|
@ -44,3 +44,8 @@ bool ConfigFollowerInterface::operator==(ConfigFollowerInterface const& rhs) con
|
||||
bool ConfigFollowerInterface::operator!=(ConfigFollowerInterface const& rhs) const {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
ConfigClassSet ConfigClassSet::fromParamString(std::string const& paramString) {
|
||||
// TODO: Validate input and implement
|
||||
return {};
|
||||
}
|
||||
|
@ -25,6 +25,23 @@
|
||||
#include "fdbclient/FDBTypes.h"
|
||||
#include "fdbrpc/fdbrpc.h"
|
||||
|
||||
class ConfigClassSet {
|
||||
std::set<Key> classes;
|
||||
|
||||
public:
|
||||
static constexpr FileIdentifier file_identifier = 9854021;
|
||||
|
||||
bool operator==(ConfigClassSet const& rhs) const { return classes == rhs.classes; }
|
||||
bool operator!=(ConfigClassSet const& rhs) const { return !(*this == rhs); }
|
||||
|
||||
static ConfigClassSet fromParamString(std::string const& paramString);
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, classes);
|
||||
}
|
||||
};
|
||||
|
||||
struct ConfigFollowerGetVersionReply {
|
||||
static constexpr FileIdentifier file_identifier = 1028349;
|
||||
Version version;
|
||||
@ -65,16 +82,16 @@ struct ConfigFollowerGetFullDatabaseReply {
|
||||
struct ConfigFollowerGetFullDatabaseRequest {
|
||||
static constexpr FileIdentifier file_identifier = 294811;
|
||||
Version version;
|
||||
Standalone<VectorRef<KeyRef>> filter;
|
||||
ConfigClassSet configClassSet;
|
||||
ReplyPromise<ConfigFollowerGetFullDatabaseReply> reply;
|
||||
|
||||
ConfigFollowerGetFullDatabaseRequest() : version(-1) {}
|
||||
explicit ConfigFollowerGetFullDatabaseRequest(Version version, Standalone<VectorRef<KeyRef>> filter)
|
||||
: version(version), filter(filter) {}
|
||||
explicit ConfigFollowerGetFullDatabaseRequest(Version version, ConfigClassSet const& configClassSet)
|
||||
: version(version), configClassSet(configClassSet) {}
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, version, filter, reply);
|
||||
serializer(ar, version, configClassSet, reply);
|
||||
}
|
||||
};
|
||||
|
||||
@ -115,16 +132,16 @@ struct ConfigFollowerGetChangesReply {
|
||||
struct ConfigFollowerGetChangesRequest {
|
||||
static constexpr FileIdentifier file_identifier = 178935;
|
||||
Version lastSeenVersion;
|
||||
Standalone<VectorRef<KeyRef>> filter;
|
||||
ConfigClassSet configClassSet;
|
||||
ReplyPromise<ConfigFollowerGetChangesReply> reply;
|
||||
|
||||
ConfigFollowerGetChangesRequest() : lastSeenVersion(::invalidVersion) {}
|
||||
explicit ConfigFollowerGetChangesRequest(Version lastSeenVersion, Standalone<VectorRef<KeyRef>> filter)
|
||||
: lastSeenVersion(lastSeenVersion), filter(filter) {}
|
||||
explicit ConfigFollowerGetChangesRequest(Version lastSeenVersion, ConfigClassSet const& configClassSet)
|
||||
: lastSeenVersion(lastSeenVersion), configClassSet(configClassSet) {}
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, lastSeenVersion, filter, reply);
|
||||
serializer(ar, lastSeenVersion, configClassSet, reply);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -226,7 +226,8 @@ ACTOR Future<ISimulator::KillType> simulatedFDBDRebooter(Reference<ClusterConnec
|
||||
"",
|
||||
"",
|
||||
-1,
|
||||
whitelistBinPaths));
|
||||
whitelistBinPaths,
|
||||
ConfigClassSet{}));
|
||||
}
|
||||
if (runBackupAgents != AgentNone) {
|
||||
futures.push_back(runBackup(connFile));
|
||||
|
@ -823,7 +823,8 @@ ACTOR Future<Void> fdbd(Reference<ClusterConnectionFile> ccf,
|
||||
std::string metricsConnFile,
|
||||
std::string metricsPrefix,
|
||||
int64_t memoryProfilingThreshold,
|
||||
std::string whitelistBinPaths);
|
||||
std::string whitelistBinPaths,
|
||||
ConfigClassSet configClassSet);
|
||||
|
||||
ACTOR Future<Void> clusterController(Reference<ClusterConnectionFile> ccf,
|
||||
Reference<AsyncVar<Optional<ClusterControllerFullInterface>>> currentCC,
|
||||
|
@ -90,7 +90,7 @@ enum {
|
||||
OPT_DCID, OPT_MACHINE_CLASS, OPT_BUGGIFY, OPT_VERSION, OPT_BUILD_FLAGS, OPT_CRASHONERROR, OPT_HELP, OPT_NETWORKIMPL, OPT_NOBUFSTDOUT, OPT_BUFSTDOUTERR,
|
||||
OPT_TRACECLOCK, OPT_NUMTESTERS, OPT_DEVHELP, OPT_ROLLSIZE, OPT_MAXLOGS, OPT_MAXLOGSSIZE, OPT_KNOB, OPT_TESTSERVERS, OPT_TEST_ON_SERVERS, OPT_METRICSCONNFILE,
|
||||
OPT_METRICSPREFIX, OPT_LOGGROUP, OPT_LOCALITY, OPT_IO_TRUST_SECONDS, OPT_IO_TRUST_WARN_ONLY, OPT_FILESYSTEM, OPT_PROFILER_RSS_SIZE, OPT_KVFILE,
|
||||
OPT_TRACE_FORMAT, OPT_WHITELIST_BINPATH, OPT_BLOB_CREDENTIAL_FILE
|
||||
OPT_TRACE_FORMAT, OPT_WHITELIST_BINPATH, OPT_BLOB_CREDENTIAL_FILE, OPT_CONFIG_CLASSES
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgOptions[] = {
|
||||
@ -172,6 +172,7 @@ CSimpleOpt::SOption g_rgOptions[] = {
|
||||
{ OPT_TRACE_FORMAT , "--trace_format", SO_REQ_SEP },
|
||||
{ OPT_WHITELIST_BINPATH, "--whitelist_binpath", SO_REQ_SEP },
|
||||
{ OPT_BLOB_CREDENTIAL_FILE, "--blob_credential_file", SO_REQ_SEP },
|
||||
{ OPT_CONFIG_CLASSES, "--config_classes", SO_REQ_SEP },
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
@ -968,6 +969,8 @@ struct CLIOptions {
|
||||
std::vector<std::string> blobCredentials; // used for fast restore workers & backup workers
|
||||
const char* blobCredsFromENV = nullptr;
|
||||
|
||||
ConfigClassSet configClassSet;
|
||||
|
||||
Reference<ClusterConnectionFile> connectionFile;
|
||||
Standalone<StringRef> machineId;
|
||||
|
||||
@ -1409,6 +1412,9 @@ private:
|
||||
} while (t.size() != 0);
|
||||
}
|
||||
break;
|
||||
case OPT_CONFIG_CLASSES:
|
||||
configClassSet = ConfigClassSet::fromParamString(args.OptionArg());
|
||||
break;
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
case TLSConfig::OPT_TLS_PLUGIN:
|
||||
@ -1944,7 +1950,8 @@ int main(int argc, char* argv[]) {
|
||||
opts.metricsConnFile,
|
||||
opts.metricsPrefix,
|
||||
opts.rsssize,
|
||||
opts.whitelistBinPaths));
|
||||
opts.whitelistBinPaths,
|
||||
opts.configClassSet));
|
||||
actors.push_back(histogramReport());
|
||||
// actors.push_back( recurring( []{}, .001 ) ); // for ASIO latency measurement
|
||||
|
||||
|
@ -2019,10 +2019,11 @@ ACTOR Future<Void> fdbd(Reference<ClusterConnectionFile> connFile,
|
||||
std::string metricsConnFile,
|
||||
std::string metricsPrefix,
|
||||
int64_t memoryProfileThreshold,
|
||||
std::string whitelistBinPaths) {
|
||||
std::string whitelistBinPaths,
|
||||
ConfigClassSet configClassSet) {
|
||||
state vector<Future<Void>> actors;
|
||||
state Promise<Void> recoveredDiskFiles;
|
||||
state LocalConfiguration localConfig(ConfigClassSet{}, dataFolder, {}, UID{});
|
||||
state LocalConfiguration localConfig(configClassSet, dataFolder, {}, UID{});
|
||||
wait(localConfig.init());
|
||||
|
||||
actors.push_back(serveProtocolInfo());
|
||||
|
Loading…
x
Reference in New Issue
Block a user