Merge pull request #4838 from sfc-gh-xwang/ppwiggle
perpetual storage wiggling command line support
This commit is contained in:
commit
e1254d38a0
|
@ -7,7 +7,7 @@ bindings/java/foundationdb-client*.jar
|
|||
bindings/java/foundationdb-tests*.jar
|
||||
bindings/java/fdb-java-*-sources.jar
|
||||
packaging/msi/FDBInstaller.msi
|
||||
|
||||
builds/
|
||||
# Generated source, build, and packaging files
|
||||
*.g.cpp
|
||||
*.g.h
|
||||
|
|
|
@ -496,7 +496,8 @@ void initHelp() {
|
|||
helpMap["configure"] = CommandHelp(
|
||||
"configure [new] "
|
||||
"<single|double|triple|three_data_hall|three_datacenter|ssd|memory|memory-radixtree-beta|proxies=<PROXIES>|"
|
||||
"commit_proxies=<COMMIT_PROXIES>|grv_proxies=<GRV_PROXIES>|logs=<LOGS>|resolvers=<RESOLVERS>>*",
|
||||
"commit_proxies=<COMMIT_PROXIES>|grv_proxies=<GRV_PROXIES>|logs=<LOGS>|resolvers=<RESOLVERS>>*|"
|
||||
"perpetual_storage_wiggle=<WIGGLE_SPEED>",
|
||||
"change the database configuration",
|
||||
"The `new' option, if present, initializes a new database with the given configuration rather than changing "
|
||||
"the configuration of an existing one. When used, both a redundancy mode and a storage engine must be "
|
||||
|
@ -517,8 +518,11 @@ void initHelp() {
|
|||
"1, or set to -1 which restores the number of GRV proxies to the default value.\n\nlogs=<LOGS>: Sets the "
|
||||
"desired number of log servers in the cluster. Must be at least 1, or set to -1 which restores the number of "
|
||||
"logs to the default value.\n\nresolvers=<RESOLVERS>: Sets the desired number of resolvers in the cluster. "
|
||||
"Must be at least 1, or set to -1 which restores the number of resolvers to the default value.\n\nSee the "
|
||||
"FoundationDB Administration Guide for more information.");
|
||||
"Must be at least 1, or set to -1 which restores the number of resolvers to the default value.\n\n"
|
||||
"perpetual_storage_wiggle=<WIGGLE_SPEED>: Set the value speed (a.k.a., the number of processes that the Data "
|
||||
"Distributor should wiggle at a time). Currently, only 0 and 1 are supported. The value 0 means to disable the "
|
||||
"perpetual storage wiggle.\n\n"
|
||||
"See the FoundationDB Administration Guide for more information.");
|
||||
helpMap["fileconfigure"] = CommandHelp(
|
||||
"fileconfigure [new] <FILENAME>",
|
||||
"change the database configuration from a file",
|
||||
|
@ -2766,6 +2770,7 @@ void configureGenerator(const char* text, const char* line, std::vector<std::str
|
|||
"grv_proxies=",
|
||||
"logs=",
|
||||
"resolvers=",
|
||||
"perpetual_storage_wiggle=",
|
||||
nullptr };
|
||||
arrayGenerator(text, line, opts, lc);
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ void DatabaseConfiguration::resetInternal() {
|
|||
remoteDesiredTLogCount = -1;
|
||||
remoteTLogReplicationFactor = repopulateRegionAntiQuorum = 0;
|
||||
backupWorkerEnabled = false;
|
||||
perpetualStorageWiggleSpeed = 0;
|
||||
}
|
||||
|
||||
void parse(int* i, ValueRef const& v) {
|
||||
|
@ -194,9 +195,9 @@ bool DatabaseConfiguration::isValid() const {
|
|||
getDesiredRemoteLogs() >= 1 && remoteTLogReplicationFactor >= 0 && repopulateRegionAntiQuorum >= 0 &&
|
||||
repopulateRegionAntiQuorum <= 1 && usableRegions >= 1 && usableRegions <= 2 && regions.size() <= 2 &&
|
||||
(usableRegions == 1 || regions.size() == 2) && (regions.size() == 0 || regions[0].priority >= 0) &&
|
||||
(regions.size() == 0 ||
|
||||
tLogPolicy->info() !=
|
||||
"dcid^2 x zoneid^2 x 1"))) { // We cannot specify regions with three_datacenter replication
|
||||
(regions.size() == 0 || tLogPolicy->info() != "dcid^2 x zoneid^2 x 1") &&
|
||||
// We cannot specify regions with three_datacenter replication
|
||||
(perpetualStorageWiggleSpeed == 0 || perpetualStorageWiggleSpeed == 1))) {
|
||||
return false;
|
||||
}
|
||||
std::set<Key> dcIds;
|
||||
|
@ -352,7 +353,7 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const {
|
|||
}
|
||||
|
||||
result["backup_worker_enabled"] = (int32_t)backupWorkerEnabled;
|
||||
|
||||
result["perpetual_storage_wiggle"] = perpetualStorageWiggleSpeed;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -499,6 +500,8 @@ bool DatabaseConfiguration::setInternal(KeyRef key, ValueRef value) {
|
|||
parse(&repopulateRegionAntiQuorum, value);
|
||||
} else if (ck == LiteralStringRef("regions")) {
|
||||
parse(®ions, value);
|
||||
} else if (ck == LiteralStringRef("perpetual_storage_wiggle")) {
|
||||
parse(&perpetualStorageWiggleSpeed, value);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -239,6 +239,9 @@ struct DatabaseConfiguration {
|
|||
int32_t repopulateRegionAntiQuorum;
|
||||
std::vector<RegionInfo> regions;
|
||||
|
||||
// Perpetual Storage Setting
|
||||
int32_t perpetualStorageWiggleSpeed;
|
||||
|
||||
// Excluded servers (no state should be here)
|
||||
bool isExcludedServer(NetworkAddressList) const;
|
||||
std::set<AddressExclusion> getExcludedServers() const;
|
||||
|
|
|
@ -134,6 +134,14 @@ std::map<std::string, std::string> configForToken(std::string const& mode) {
|
|||
BinaryWriter::toValue(regionObj, IncludeVersion(ProtocolVersion::withRegionConfiguration())).toString();
|
||||
}
|
||||
|
||||
if (key == "perpetual_storage_wiggle" && isInteger(value)) {
|
||||
int ppWiggle = atoi(value.c_str());
|
||||
if (ppWiggle >= 2 || ppWiggle < 0) {
|
||||
printf("Error: Only 0 and 1 are valid values of perpetual_storage_wiggle at present.\n");
|
||||
return out;
|
||||
}
|
||||
out[p + key] = value;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -741,7 +741,8 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema(
|
|||
"auto_logs":3,
|
||||
"commit_proxies":5,
|
||||
"grv_proxies":1,
|
||||
"backup_worker_enabled":1
|
||||
"backup_worker_enabled":1,
|
||||
"perpetual_storage_wiggle":0
|
||||
},
|
||||
"data":{
|
||||
"least_operating_space_bytes_log_server":0,
|
||||
|
|
|
@ -594,6 +594,9 @@ ProcessClass decodeProcessClassValue(ValueRef const& value) {
|
|||
const KeyRangeRef configKeys(LiteralStringRef("\xff/conf/"), LiteralStringRef("\xff/conf0"));
|
||||
const KeyRef configKeysPrefix = configKeys.begin;
|
||||
|
||||
const KeyRef perpetualStorageWiggleKey(LiteralStringRef("\xff/conf/perpetual_storage_wiggle"));
|
||||
const KeyRef wigglingStorageServerKey(LiteralStringRef("\xff/storageWigglePID"));
|
||||
|
||||
const KeyRef triggerDDTeamInfoPrintKey(LiteralStringRef("\xff/triggerDDTeamInfoPrint"));
|
||||
|
||||
const KeyRangeRef excludedServersKeys(LiteralStringRef("\xff/conf/excluded/"), LiteralStringRef("\xff/conf/excluded0"));
|
||||
|
|
|
@ -196,6 +196,8 @@ UID decodeProcessClassKeyOld(KeyRef const& key);
|
|||
extern const KeyRangeRef configKeys;
|
||||
extern const KeyRef configKeysPrefix;
|
||||
|
||||
extern const KeyRef perpetualStorageWiggleKey;
|
||||
extern const KeyRef wigglingStorageServerKey;
|
||||
// Change the value of this key to anything and that will trigger detailed data distribution team info log.
|
||||
extern const KeyRef triggerDDTeamInfoPrintKey;
|
||||
|
||||
|
|
Loading…
Reference in New Issue