Refactored some parts of database configuration to support log_engine=<name> and storage_engine=<name> and generate these when converting a DatabaseConfig JSON object to a `configure` command. Refactored `fileconfigure` and simulation setup to use the same JSON -> configure function as the same code was copy/pasted to both places but only one has been kept up to date with new features. Renamed Redwood to `ssd-redwood-1` canonically but the experimental name is still supported for backward compatibility.
This commit is contained in:
parent
9cbf5c8f0e
commit
50d567b5a5
|
@ -734,14 +734,26 @@
|
|||
"storage_replication_policy":"(zoneid^3x1)",
|
||||
"logs":2, // this field will be absent if a value has not been explicitly set
|
||||
"log_version":2,
|
||||
"log_engine":1,
|
||||
"log_engine":{
|
||||
"$enum":[
|
||||
"ssd",
|
||||
"ssd-1",
|
||||
"ssd-2",
|
||||
"ssd-redwood-1",
|
||||
"ssd-rocksdb-v1",
|
||||
"ssd-sharded-rocksdb",
|
||||
"memory",
|
||||
"memory-1",
|
||||
"memory-2",
|
||||
"memory-radixtree-beta"
|
||||
]},
|
||||
"log_spill":1,
|
||||
"storage_engine":{
|
||||
"$enum":[
|
||||
"ssd",
|
||||
"ssd-1",
|
||||
"ssd-2",
|
||||
"ssd-redwood-1-experimental",
|
||||
"ssd-redwood-1",
|
||||
"ssd-rocksdb-v1",
|
||||
"ssd-sharded-rocksdb",
|
||||
"memory",
|
||||
|
@ -755,7 +767,7 @@
|
|||
"ssd",
|
||||
"ssd-1",
|
||||
"ssd-2",
|
||||
"ssd-redwood-1-experimental",
|
||||
"ssd-redwood-1",
|
||||
"ssd-rocksdb-v1",
|
||||
"ssd-sharded-rocksdb",
|
||||
"memory",
|
||||
|
|
|
@ -31,7 +31,7 @@ Because TSS recruitment only pairs *new* storage processes, you must add process
|
|||
Example commands
|
||||
----------------
|
||||
|
||||
Set the desired TSS processes count to 4, using the redwood storage engine: ``configure tss ssd-redwood-1-experimental count=4``.
|
||||
Set the desired TSS processes count to 4, using the redwood storage engine: ``configure tss ssd-redwood-1 count=4``.
|
||||
|
||||
Change the desired TSS process count to 2: ``configure tss count=2``.
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "fdbcli/FlowLineNoise.h"
|
||||
#include "fdbcli/fdbcli.actor.h"
|
||||
|
||||
#include "fdbclient/DatabaseConfiguration.h"
|
||||
#include "fdbclient/FDBOptions.g.h"
|
||||
#include "fdbclient/IClientApi.h"
|
||||
#include "fdbclient/ManagementAPI.actor.h"
|
||||
|
@ -60,28 +61,19 @@ ACTOR Future<bool> fileConfigureCommandActor(Reference<IDatabase> db,
|
|||
return false;
|
||||
}
|
||||
|
||||
std::string configString;
|
||||
state std::string configString;
|
||||
if (isNewDatabase) {
|
||||
configString = "new";
|
||||
}
|
||||
|
||||
for (const auto& [name, value] : configJSON) {
|
||||
if (!configString.empty()) {
|
||||
configString += " ";
|
||||
}
|
||||
if (value.type() == json_spirit::int_type) {
|
||||
configString += name + ":=" + format("%d", value.get_int());
|
||||
} else if (value.type() == json_spirit::str_type) {
|
||||
configString += value.get_str();
|
||||
} else if (value.type() == json_spirit::array_type) {
|
||||
configString +=
|
||||
name + "=" +
|
||||
json_spirit::write_string(json_spirit::mValue(value.get_array()), json_spirit::Output_options::none);
|
||||
} else {
|
||||
printUsage("fileconfigure"_sr);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
configString += DatabaseConfiguration::configureStringFromJSON(configJSON);
|
||||
} catch (Error& e) {
|
||||
fmt::print("ERROR: {}", e.what());
|
||||
printUsage("fileconfigure"_sr);
|
||||
return false;
|
||||
}
|
||||
|
||||
ConfigurationResult result = wait(ManagementAPI::changeConfig(db, configString, force));
|
||||
// Real errors get thrown from makeInterruptable and printed by the catch block in cli(), but
|
||||
// there are various results specific to changeConfig() that we need to report:
|
||||
|
|
|
@ -434,6 +434,9 @@ void printStatus(StatusObjectReader statusObj,
|
|||
} else
|
||||
outputString += "unknown";
|
||||
|
||||
outputString +=
|
||||
"\n Log engine - " + (statusObjConfig.get("log_engine", strVal) ? strVal : "unknown");
|
||||
|
||||
int intVal = 0;
|
||||
if (statusObjConfig.get("blob_granules_enabled", intVal) && intVal) {
|
||||
blobGranuleEnabled = true;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "fdbclient/FDBTypes.h"
|
||||
#include "fdbclient/SystemData.h"
|
||||
#include "flow/ITrace.h"
|
||||
#include "flow/Platform.h"
|
||||
#include "flow/Trace.h"
|
||||
#include "flow/genericactors.actor.h"
|
||||
#include "flow/UnitTest.h"
|
||||
|
@ -304,52 +305,12 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const {
|
|||
result["log_version"] = (int)tLogVersion;
|
||||
}
|
||||
|
||||
if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V1 &&
|
||||
storageServerStoreType == KeyValueStoreType::SSD_BTREE_V1) {
|
||||
result["storage_engine"] = "ssd-1";
|
||||
} else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 &&
|
||||
storageServerStoreType == KeyValueStoreType::SSD_BTREE_V2) {
|
||||
result["storage_engine"] = "ssd-2";
|
||||
} else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 &&
|
||||
storageServerStoreType == KeyValueStoreType::SSD_REDWOOD_V1) {
|
||||
result["storage_engine"] = "ssd-redwood-1-experimental";
|
||||
} else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 &&
|
||||
storageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) {
|
||||
result["storage_engine"] = "ssd-rocksdb-v1";
|
||||
} else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 &&
|
||||
storageServerStoreType == KeyValueStoreType::SSD_SHARDED_ROCKSDB) {
|
||||
result["storage_engine"] = "ssd-sharded-rocksdb";
|
||||
} else if (tLogDataStoreType == KeyValueStoreType::MEMORY && storageServerStoreType == KeyValueStoreType::MEMORY) {
|
||||
result["storage_engine"] = "memory-1";
|
||||
} else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 &&
|
||||
storageServerStoreType == KeyValueStoreType::MEMORY_RADIXTREE) {
|
||||
result["storage_engine"] = "memory-radixtree-beta";
|
||||
} else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 &&
|
||||
storageServerStoreType == KeyValueStoreType::MEMORY) {
|
||||
result["storage_engine"] = "memory-2";
|
||||
} else {
|
||||
result["storage_engine"] = "custom";
|
||||
}
|
||||
result["log_engine"] = tLogDataStoreType.toString();
|
||||
result["storage_engine"] = storageServerStoreType.toString();
|
||||
|
||||
if (desiredTSSCount > 0) {
|
||||
result["tss_count"] = desiredTSSCount;
|
||||
if (testingStorageServerStoreType == KeyValueStoreType::SSD_BTREE_V1) {
|
||||
result["tss_storage_engine"] = "ssd-1";
|
||||
} else if (testingStorageServerStoreType == KeyValueStoreType::SSD_BTREE_V2) {
|
||||
result["tss_storage_engine"] = "ssd-2";
|
||||
} else if (testingStorageServerStoreType == KeyValueStoreType::SSD_REDWOOD_V1) {
|
||||
result["tss_storage_engine"] = "ssd-redwood-1-experimental";
|
||||
} else if (testingStorageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) {
|
||||
result["tss_storage_engine"] = "ssd-rocksdb-v1";
|
||||
} else if (testingStorageServerStoreType == KeyValueStoreType::SSD_SHARDED_ROCKSDB) {
|
||||
result["tss_storage_engine"] = "ssd-sharded-rocksdb";
|
||||
} else if (testingStorageServerStoreType == KeyValueStoreType::MEMORY_RADIXTREE) {
|
||||
result["tss_storage_engine"] = "memory-radixtree-beta";
|
||||
} else if (testingStorageServerStoreType == KeyValueStoreType::MEMORY) {
|
||||
result["tss_storage_engine"] = "memory-2";
|
||||
} else {
|
||||
result["tss_storage_engine"] = "custom";
|
||||
}
|
||||
result["tss_storage_engine"] = testingStorageServerStoreType.toString();
|
||||
}
|
||||
|
||||
result["log_spill"] = (int)tLogSpillType;
|
||||
|
@ -430,6 +391,65 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const {
|
|||
return result;
|
||||
}
|
||||
|
||||
std::string DatabaseConfiguration::configureStringFromJSON(const StatusObject& json) {
|
||||
std::string result;
|
||||
|
||||
for (auto kv : json) {
|
||||
// These JSON properties are ignored for some reason. This behavior is being maintained in a refactor
|
||||
// of this code and the old code gave no reasoning.
|
||||
static std::set<std::string> ignore = { "tss_storage_engine", "perpetual_storage_wiggle_locality" };
|
||||
if (ignore.contains(kv.first)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result += " ";
|
||||
// All integers are assumed to be actual DatabaseConfig keys and are set with
|
||||
// the hidden "<name>:=<intValue>" syntax of the configure command.
|
||||
if (kv.second.type() == json_spirit::int_type) {
|
||||
result += kv.first + ":=" + format("%d", kv.second.get_int());
|
||||
} else if (kv.second.type() == json_spirit::str_type) {
|
||||
// For string values, some properties can set with a "<name>=<value>" syntax in "configure"
|
||||
// Such properites are listed here:
|
||||
static std::set<std::string> directSet = {
|
||||
"storage_migration_type", "tenant_mode", "encryption_at_rest_mode", "storage_engine", "log_engine"
|
||||
};
|
||||
|
||||
if (directSet.contains(kv.first)) {
|
||||
result += kv.first + "=" + kv.second.get_str();
|
||||
} else {
|
||||
// For the rest, it is assumed that the property name is meaningless and the value string
|
||||
// is a standalone 'configure' command which has the identical effect.
|
||||
// TODO: Fix this terrible legacy behavior which probably isn't compatible with
|
||||
// some of the more recently added configuration and options.
|
||||
result += kv.second.get_str();
|
||||
}
|
||||
} else if (kv.second.type() == json_spirit::array_type) {
|
||||
// Array properties convert to <name>=<json_array>
|
||||
result += kv.first + "=" +
|
||||
json_spirit::write_string(json_spirit::mValue(kv.second.get_array()),
|
||||
json_spirit::Output_options::none);
|
||||
} else {
|
||||
throw invalid_config_db_key();
|
||||
}
|
||||
}
|
||||
|
||||
// The log_engine setting requires some special handling because it was not included in the JSON form of a
|
||||
// DatabaseConfiguration until FDB 7.3. This means that configuring a new database using a JSON config object from
|
||||
// an older version will now fail because it lacks an explicit log_engine setting. Previously, the log_engine would
|
||||
// be set indirectly because the "storage_engine=<engine_name>" property from JSON would convert to a standalone
|
||||
// "<engine_name>" command in the output, and each engine name exists as a command which sets both the
|
||||
// log and storage engines, with the log engine normally being ssd-2.
|
||||
// The storage_engine and log_engine JSON properties now explicitly indicate their engine types and map to configure
|
||||
// commands of the same name. So, to support configuring a new database with an older JSON config without an
|
||||
// explicit log_engine we simply add " log_engine=ssd-2" to the output string if the input JSON did not contain a
|
||||
// log_engine.
|
||||
if (!json.contains("log_engine")) {
|
||||
result += " log_engine=ssd-2";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
StatusArray DatabaseConfiguration::getRegionJSON() const {
|
||||
StatusArray regionArr;
|
||||
for (auto& r : regions) {
|
||||
|
@ -594,12 +614,10 @@ bool DatabaseConfiguration::setInternal(KeyRef key, ValueRef value) {
|
|||
} else if (ck == "log_engine"_sr) {
|
||||
parse((&type), value);
|
||||
tLogDataStoreType = (KeyValueStoreType::StoreType)type;
|
||||
// TODO: Remove this once Redwood works as a log engine
|
||||
if (tLogDataStoreType == KeyValueStoreType::SSD_REDWOOD_V1) {
|
||||
tLogDataStoreType = KeyValueStoreType::SSD_BTREE_V2;
|
||||
}
|
||||
// TODO: Remove this once memroy radix tree works as a log engine
|
||||
if (tLogDataStoreType == KeyValueStoreType::MEMORY_RADIXTREE) {
|
||||
// It makes no sense to use a memory based engine to spill data that doesn't fit in memory
|
||||
// so change these to an ssd-2
|
||||
if (tLogDataStoreType == KeyValueStoreType::MEMORY ||
|
||||
tLogDataStoreType == KeyValueStoreType::MEMORY_RADIXTREE) {
|
||||
tLogDataStoreType = KeyValueStoreType::SSD_BTREE_V2;
|
||||
}
|
||||
} else if (ck == "log_spill"_sr) {
|
||||
|
|
|
@ -235,18 +235,41 @@ std::map<std::string, std::string> configForToken(std::string const& mode) {
|
|||
p = end + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (key == "storage_engine" || key == "log_engine") {
|
||||
StringRef s = value;
|
||||
|
||||
// Parse as engine_name[:p=v]... to handle future storage engine params
|
||||
Value engine = s.eat(":");
|
||||
std::map<Key, Value> params;
|
||||
while (!s.empty()) {
|
||||
params[s.eat("=")] = s.eat(":");
|
||||
}
|
||||
|
||||
try {
|
||||
out[p + key] = format("%d", KeyValueStoreType::fromString(engine.toString()).storeType());
|
||||
} catch (Error& e) {
|
||||
printf("Error: Invalid value for %s (%s): %s\n", key.c_str(), value.c_str(), e.what());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Optional<KeyValueStoreType> logType;
|
||||
Optional<KeyValueStoreType> storeType;
|
||||
|
||||
// These are legacy shorthand commands to set a specific log engine and storage engine
|
||||
// based only on the storage engine name. Most of them assume SQLite should be the
|
||||
// log engine.
|
||||
if (mode == "ssd-1") {
|
||||
logType = KeyValueStoreType::SSD_BTREE_V1;
|
||||
storeType = KeyValueStoreType::SSD_BTREE_V1;
|
||||
} else if (mode == "ssd" || mode == "ssd-2") {
|
||||
logType = KeyValueStoreType::SSD_BTREE_V2;
|
||||
storeType = KeyValueStoreType::SSD_BTREE_V2;
|
||||
} else if (mode == "ssd-redwood-1-experimental") {
|
||||
} else if (mode == "ssd-redwood-1" || mode == "ssd-redwood-1-experimental") {
|
||||
logType = KeyValueStoreType::SSD_BTREE_V2;
|
||||
storeType = KeyValueStoreType::SSD_REDWOOD_V1;
|
||||
} else if (mode == "ssd-rocksdb-v1") {
|
||||
|
@ -269,7 +292,7 @@ std::map<std::string, std::string> configForToken(std::string const& mode) {
|
|||
|
||||
if (storeType.present()) {
|
||||
out[p + "log_engine"] = format("%d", logType.get().storeType());
|
||||
out[p + "storage_engine"] = format("%d", KeyValueStoreType::StoreType(storeType.get()));
|
||||
out[p + "storage_engine"] = format("%d", storeType.get().storeType());
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -406,7 +429,10 @@ ConfigurationResult buildConfiguration(std::vector<StringRef> const& modeTokens,
|
|||
|
||||
for (auto t = m.begin(); t != m.end(); ++t) {
|
||||
if (outConf.count(t->first)) {
|
||||
TraceEvent(SevWarnAlways, "ConflictingOption").detail("Option", t->first);
|
||||
TraceEvent(SevWarnAlways, "ConflictingOption")
|
||||
.detail("Option", t->first)
|
||||
.detail("Value", t->second)
|
||||
.detail("ExistingValue", outConf[t->first]);
|
||||
return ConfigurationResult::CONFLICTING_OPTIONS;
|
||||
}
|
||||
outConf[t->first] = t->second;
|
||||
|
|
|
@ -151,7 +151,7 @@ const KeyRef JSONSchemas::statusSchema = R"statusSchema(
|
|||
"ssd",
|
||||
"ssd-1",
|
||||
"ssd-2",
|
||||
"ssd-redwood-1-experimental",
|
||||
"ssd-redwood-1",
|
||||
"ssd-rocksdb-v1",
|
||||
"ssd-sharded-rocksdb",
|
||||
"memory",
|
||||
|
@ -791,14 +791,26 @@ const KeyRef JSONSchemas::statusSchema = R"statusSchema(
|
|||
"storage_replication_policy":"(zoneid^3x1)",
|
||||
"logs":2,
|
||||
"log_version":2,
|
||||
"log_engine":1,
|
||||
"log_engine":{
|
||||
"$enum":[
|
||||
"ssd",
|
||||
"ssd-1",
|
||||
"ssd-2",
|
||||
"ssd-redwood-1",
|
||||
"ssd-rocksdb-v1",
|
||||
"ssd-sharded-rocksdb",
|
||||
"memory",
|
||||
"memory-1",
|
||||
"memory-2",
|
||||
"memory-radixtree-beta"
|
||||
]},
|
||||
"log_spill":1,
|
||||
"storage_engine":{
|
||||
"$enum":[
|
||||
"ssd",
|
||||
"ssd-1",
|
||||
"ssd-2",
|
||||
"ssd-redwood-1-experimental",
|
||||
"ssd-redwood-1",
|
||||
"ssd-rocksdb-v1",
|
||||
"ssd-sharded-rocksdb",
|
||||
"memory",
|
||||
|
@ -812,7 +824,7 @@ const KeyRef JSONSchemas::statusSchema = R"statusSchema(
|
|||
"ssd",
|
||||
"ssd-1",
|
||||
"ssd-2",
|
||||
"ssd-redwood-1-experimental",
|
||||
"ssd-redwood-1",
|
||||
"ssd-rocksdb-v1",
|
||||
"ssd-sharded-rocksdb",
|
||||
"memory",
|
||||
|
|
|
@ -119,6 +119,10 @@ struct DatabaseConfiguration {
|
|||
StatusObject toJSON(bool noPolicies = false) const;
|
||||
StatusArray getRegionJSON() const;
|
||||
|
||||
// Given a JSON object representing a DatabaseConfiguration, generate a configuration command
|
||||
// that would set a database to those options.
|
||||
static std::string configureStringFromJSON(const StatusObject& json);
|
||||
|
||||
RegionInfo getRegion(Optional<Key> dcId) const {
|
||||
if (!dcId.present()) {
|
||||
return RegionInfo();
|
||||
|
|
|
@ -933,7 +933,7 @@ struct KeyValueStoreType {
|
|||
case SSD_BTREE_V2:
|
||||
return "ssd-2";
|
||||
case SSD_REDWOOD_V1:
|
||||
return "ssd-redwood-1-experimental";
|
||||
return "ssd-redwood-1";
|
||||
case SSD_ROCKSDB_V1:
|
||||
return "ssd-rocksdb-v1";
|
||||
case SSD_SHARDED_ROCKSDB:
|
||||
|
@ -946,6 +946,27 @@ struct KeyValueStoreType {
|
|||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a string to a KeyValueStoreType
|
||||
// This is a many-to-one mapping as there are aliases for some storage engines
|
||||
static KeyValueStoreType fromString(const std::string& str) {
|
||||
static std::map<std::string, StoreType> names = { { "ssd-1", SSD_BTREE_V1 },
|
||||
{ "ssd-2", SSD_BTREE_V2 },
|
||||
{ "ssd", SSD_BTREE_V2 },
|
||||
{ "redwood", SSD_REDWOOD_V1 },
|
||||
{ "ssd-redwood-1", SSD_REDWOOD_V1 },
|
||||
{ "ssd-redwood-1-experimental", SSD_REDWOOD_V1 },
|
||||
{ "ssd-rocksdb-v1", SSD_ROCKSDB_V1 },
|
||||
{ "ssd-sharded-rocksdb", SSD_SHARDED_ROCKSDB },
|
||||
{ "memory", MEMORY },
|
||||
{ "memory-radixtree-beta", MEMORY_RADIXTREE } };
|
||||
auto it = names.find(str);
|
||||
if (it == names.end()) {
|
||||
throw unknown_storage_engine();
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
std::string toString() const { return getStoreTypeStr((StoreType)type); }
|
||||
|
||||
private:
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <sstream>
|
||||
#include <string_view>
|
||||
#include <toml.hpp>
|
||||
#include "fdbclient/DatabaseConfiguration.h"
|
||||
#include "fdbclient/FDBTypes.h"
|
||||
#include "fdbrpc/Locality.h"
|
||||
#include "fdbrpc/simulator.h"
|
||||
|
@ -47,6 +48,7 @@
|
|||
#include "flow/MkCert.h"
|
||||
#include "fdbrpc/WellKnownEndpoints.h"
|
||||
#include "flow/ProtocolVersion.h"
|
||||
#include "flow/flow.h"
|
||||
#include "flow/network.h"
|
||||
#include "flow/TypeTraits.h"
|
||||
#include "flow/FaultInjection.h"
|
||||
|
@ -414,7 +416,7 @@ public:
|
|||
// 0 = "ssd"
|
||||
// 1 = "memory"
|
||||
// 2 = "memory-radixtree-beta"
|
||||
// 3 = "ssd-redwood-1-experimental"
|
||||
// 3 = "ssd-redwood-1"
|
||||
// 4 = "ssd-rocksdb-v1"
|
||||
// 5 = "ssd-sharded-rocksdb"
|
||||
// Requires a comma-separated list of numbers WITHOUT whitespaces
|
||||
|
@ -1672,7 +1674,8 @@ void SimulationConfig::setStorageEngine(const TestConfig& testConfig) {
|
|||
}
|
||||
case 3: {
|
||||
CODE_PROBE(true, "Simulated cluster using redwood storage engine");
|
||||
set_config("ssd-redwood-1-experimental");
|
||||
// The experimental suffix is still supported so test it randomly
|
||||
set_config(BUGGIFY ? "ssd-redwood-1" : "ssd-redwood-1-experimental");
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
|
@ -2151,33 +2154,15 @@ void setupSimulatedSystem(std::vector<Future<Void>>* systemActors,
|
|||
TraceEvent(SevDebug, "DisableRemoteKVS");
|
||||
}
|
||||
auto configDBType = testConfig.getConfigDBType();
|
||||
for (auto kv : startingConfigJSON) {
|
||||
if ("tss_storage_engine" == kv.first) {
|
||||
continue;
|
||||
}
|
||||
if ("perpetual_storage_wiggle_locality" == kv.first) {
|
||||
if (deterministicRandom()->random01() < 0.25) {
|
||||
int dcId = deterministicRandom()->randomInt(0, simconfig.datacenters);
|
||||
startingConfigString += " " + kv.first + "=" + "data_hall:" + std::to_string(dcId);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
startingConfigString += " ";
|
||||
if (kv.second.type() == json_spirit::int_type) {
|
||||
startingConfigString += kv.first + ":=" + format("%d", kv.second.get_int());
|
||||
} else if (kv.second.type() == json_spirit::str_type) {
|
||||
if ("storage_migration_type" == kv.first || "tenant_mode" == kv.first ||
|
||||
"encryption_at_rest_mode" == kv.first) {
|
||||
startingConfigString += kv.first + "=" + kv.second.get_str();
|
||||
} else {
|
||||
startingConfigString += kv.second.get_str();
|
||||
}
|
||||
} else if (kv.second.type() == json_spirit::array_type) {
|
||||
startingConfigString += kv.first + "=" +
|
||||
json_spirit::write_string(json_spirit::mValue(kv.second.get_array()),
|
||||
json_spirit::Output_options::none);
|
||||
} else {
|
||||
ASSERT(false);
|
||||
startingConfigString += DatabaseConfiguration::configureStringFromJSON(startingConfigJSON);
|
||||
|
||||
// Set a random locality for the perpetual wiggle if any locality is set in the config
|
||||
// This behavior is preserved in a refactor but makes no senseUnclear why this is
|
||||
auto ipwLocality = startingConfigJSON.find("perpetual_storage_wiggle_locality");
|
||||
if (ipwLocality != startingConfigJSON.end()) {
|
||||
if (deterministicRandom()->random01() < 0.25) {
|
||||
int dcId = deterministicRandom()->randomInt(0, simconfig.datacenters);
|
||||
startingConfigString += " " + ipwLocality->first + "=" + "data_hall:" + std::to_string(dcId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -448,7 +448,8 @@ struct ConfigureDatabaseWorkload : TestWorkload {
|
|||
storeTypeStr = "memory-radixtree-beta";
|
||||
break;
|
||||
case 3:
|
||||
storeTypeStr = "ssd-redwood-1-experimental";
|
||||
// Experimental suffix is still supported so test it
|
||||
storeTypeStr = BUGGIFY ? "ssd-redwood-1" : "ssd-redwood-1-experimental";
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <ctime>
|
||||
#include <cinttypes>
|
||||
#include "fdbclient/FDBTypes.h"
|
||||
#include "fmt/format.h"
|
||||
#include "fdbserver/workloads/workloads.actor.h"
|
||||
#include "fdbserver/IKeyValueStore.h"
|
||||
|
@ -206,7 +207,7 @@ struct KVStoreTestWorkload : TestWorkload {
|
|||
PerfIntCounter reads, sets, commits;
|
||||
TestHistogram<float> readLatency, commitLatency;
|
||||
double setupTook;
|
||||
std::string storeType;
|
||||
KeyValueStoreType storeType;
|
||||
|
||||
KVStoreTestWorkload(WorkloadContext const& wcx)
|
||||
: TestWorkload(wcx), reads("Reads"), sets("Sets"), commits("Commits"), setupTook(0) {
|
||||
|
@ -223,7 +224,7 @@ struct KVStoreTestWorkload : TestWorkload {
|
|||
doCount = getOption(options, "count"_sr, false);
|
||||
filename = getOption(options, "filename"_sr, Value()).toString();
|
||||
saturation = getOption(options, "saturation"_sr, false);
|
||||
storeType = getOption(options, "storeType"_sr, "ssd"_sr).toString();
|
||||
storeType = KeyValueStoreType::fromString(getOption(options, "storeType"_sr, "ssd"_sr).toString());
|
||||
}
|
||||
Future<Void> setup(Database const& cx) override { return Void(); }
|
||||
Future<Void> start(Database const& cx) override {
|
||||
|
@ -378,25 +379,26 @@ ACTOR Future<Void> testKVStore(KVStoreTestWorkload* workload) {
|
|||
|
||||
UID id = deterministicRandom()->randomUniqueID();
|
||||
std::string fn = workload->filename.size() ? workload->filename : id.toString();
|
||||
if (workload->storeType == "ssd")
|
||||
if (workload->storeType == KeyValueStoreType::SSD_BTREE_V2) {
|
||||
test.store = keyValueStoreSQLite(fn, id, KeyValueStoreType::SSD_BTREE_V2);
|
||||
else if (workload->storeType == "ssd-1")
|
||||
} else if (workload->storeType == KeyValueStoreType::SSD_BTREE_V1) {
|
||||
test.store = keyValueStoreSQLite(fn, id, KeyValueStoreType::SSD_BTREE_V1);
|
||||
else if (workload->storeType == "ssd-2")
|
||||
test.store = keyValueStoreSQLite(fn, id, KeyValueStoreType::SSD_REDWOOD_V1);
|
||||
else if (workload->storeType == "ssd-redwood-1-experimental")
|
||||
} else if (workload->storeType == KeyValueStoreType::SSD_BTREE_V2) {
|
||||
test.store = keyValueStoreSQLite(fn, id, KeyValueStoreType::SSD_BTREE_V2);
|
||||
} else if (workload->storeType == KeyValueStoreType::SSD_REDWOOD_V1) {
|
||||
test.store = keyValueStoreRedwoodV1(fn, id);
|
||||
else if (workload->storeType == "ssd-rocksdb-v1")
|
||||
} else if (workload->storeType == KeyValueStoreType::SSD_ROCKSDB_V1) {
|
||||
test.store = keyValueStoreRocksDB(fn, id, KeyValueStoreType::SSD_ROCKSDB_V1);
|
||||
else if (workload->storeType == "ssd-sharded-rocksdb")
|
||||
} else if (workload->storeType == KeyValueStoreType::SSD_SHARDED_ROCKSDB) {
|
||||
test.store = keyValueStoreRocksDB(
|
||||
fn, id, KeyValueStoreType::SSD_SHARDED_ROCKSDB); // TODO: to replace the KVS in the future
|
||||
else if (workload->storeType == "memory")
|
||||
} else if (workload->storeType == KeyValueStoreType::MEMORY) {
|
||||
test.store = keyValueStoreMemory(fn, id, 500e6);
|
||||
else if (workload->storeType == "memory-radixtree-beta")
|
||||
} else if (workload->storeType == KeyValueStoreType::MEMORY_RADIXTREE) {
|
||||
test.store = keyValueStoreMemory(fn, id, 500e6, "fdr", KeyValueStoreType::MEMORY_RADIXTREE);
|
||||
else
|
||||
} else {
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
wait(test.store->init());
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ ERROR( grv_proxy_memory_limit_exceeded, 1078, "GetReadVersion proxy memory limit
|
|||
ERROR( blob_granule_request_failed, 1079, "BlobGranule request failed" )
|
||||
ERROR( storage_too_many_feed_streams, 1080, "Too many feed streams to a single storage server" )
|
||||
ERROR( storage_engine_not_initialized, 1081, "Storage engine was never successfully initialized." )
|
||||
ERROR( unknown_storage_engine, 1082, "Storage engine type is not recognized." )
|
||||
|
||||
ERROR( broken_promise, 1100, "Broken promise" )
|
||||
ERROR( operation_cancelled, 1101, "Asynchronous operation cancelled" )
|
||||
|
|
|
@ -60,7 +60,7 @@ setup=true
|
|||
clear=false
|
||||
count=false
|
||||
useDB=false
|
||||
storeType=ssd-redwood-1-experimental
|
||||
storeType=ssd-redwood-1
|
||||
filename=bttest-redwood
|
||||
|
||||
testTitle=Scan
|
||||
|
@ -76,7 +76,7 @@ setup=false
|
|||
clear=false
|
||||
count=true
|
||||
useDB=false
|
||||
storeType=ssd-redwood-1-experimental
|
||||
storeType=ssd-redwood-1
|
||||
filename=bttest-redwood
|
||||
|
||||
testTitle=RandomWriteSaturation
|
||||
|
@ -93,5 +93,5 @@ setup=false
|
|||
clear=false
|
||||
count=false
|
||||
useDB=false
|
||||
storeType=ssd-redwood-1-experimental
|
||||
storeType=ssd-redwood-1
|
||||
filename=bttest-redwood
|
||||
|
|
|
@ -425,7 +425,7 @@ logdir = {logdir}
|
|||
def create_database(self, storage="ssd", enable_tenants=True):
|
||||
if self.enable_encryption_at_rest:
|
||||
# only redwood supports EAR
|
||||
storage = "ssd-redwood-1-experimental"
|
||||
storage = "ssd-redwood-1"
|
||||
db_config = "configure new {} {}".format(self.redundancy, storage)
|
||||
if enable_tenants:
|
||||
db_config += " tenant_mode=optional_experimental"
|
||||
|
|
Loading…
Reference in New Issue