diff --git a/fdbclient/FDBTypes.h b/fdbclient/FDBTypes.h index 31c246ffcb..e78a5f1813 100644 --- a/fdbclient/FDBTypes.h +++ b/fdbclient/FDBTypes.h @@ -601,8 +601,9 @@ struct TLogVersion { // V1 = 1, // 4.6 is dispatched to via 6.0 V2 = 2, // 6.0 V3 = 3, // 6.1 + V4 = 4, // 6.2 MIN_SUPPORTED = V2, - MAX_SUPPORTED = V3, + MAX_SUPPORTED = V4, MIN_RECRUITABLE = V2, DEFAULT = V3, } version; @@ -624,6 +625,7 @@ struct TLogVersion { static ErrorOr FromStringRef( StringRef s ) { if (s == LiteralStringRef("2")) return V2; if (s == LiteralStringRef("3")) return V3; + if (s == LiteralStringRef("4")) return V4; return default_error_or(); } }; diff --git a/fdbserver/SimulatedCluster.actor.cpp b/fdbserver/SimulatedCluster.actor.cpp index 81330eac10..0257563af1 100644 --- a/fdbserver/SimulatedCluster.actor.cpp +++ b/fdbserver/SimulatedCluster.actor.cpp @@ -850,23 +850,15 @@ void SimulationConfig::generateNormalConfig(int minimumReplication, int minimumR } if (deterministicRandom()->random01() < 0.5) { - if (deterministicRandom()->random01() < 0.5) { - set_config("log_spill:=1"); // VALUE - } - int logVersion = deterministicRandom()->randomInt( 0, 3 ); - switch (logVersion) { - case 0: - break; - case 1: - set_config("log_version:=2"); // 6.0 - break; - case 2: - set_config("log_version:=3"); // 6.1 - break; - } + int logSpill = deterministicRandom()->randomInt( TLogSpillType::VALUE, TLogSpillType::END ); + set_config(format("log_spill:=%d", logSpill)); + int logVersion = deterministicRandom()->randomInt( TLogVersion::MIN_RECRUITABLE, TLogVersion::MAX_SUPPORTED+1 ); + set_config(format("log_version:=%d", logVersion)); } else { - set_config("log_version:=3"); // 6.1 - set_config("log_spill:=2"); // REFERENCE + if (deterministicRandom()->random01() < 0.7) + set_config(format("log_version:=%d", TLogVersion::MAX_SUPPORTED)); + if (deterministicRandom()->random01() < 0.5) + set_config(format("log_spill:=%d", TLogSpillType::DEFAULT)); } if(generateFearless || (datacenters == 2 && deterministicRandom()->random01() < 0.5)) { diff --git a/fdbserver/worker.actor.cpp b/fdbserver/worker.actor.cpp index 5f22334b44..0025e0aebc 100644 --- a/fdbserver/worker.actor.cpp +++ b/fdbserver/worker.actor.cpp @@ -278,10 +278,27 @@ struct TLogOptions { TLogFn tLogFnForOptions( TLogOptions options ) { auto tLogFn = tLog; - if ( options.version == TLogVersion::V2 && options.spillType == TLogSpillType::VALUE) return oldTLog_6_0::tLog; - if ( options.version == TLogVersion::V2 && options.spillType == TLogSpillType::REFERENCE) ASSERT(false); - if ( options.version == TLogVersion::V3 && options.spillType == TLogSpillType::VALUE ) return oldTLog_6_0::tLog; - if ( options.version == TLogVersion::V3 && options.spillType == TLogSpillType::REFERENCE) return tLog; + if ( options.spillType == TLogSpillType::VALUE ) { + switch (options.version) { + case TLogVersion::V2: + case TLogVersion::V3: + case TLogVersion::V4: + return oldTLog_6_0::tLog; + default: + ASSERT(false); + } + } + if ( options.spillType == TLogSpillType::REFERENCE ) { + switch (options.version) { + case TLogVersion::V2: + ASSERT(false); + case TLogVersion::V3: + case TLogVersion::V4: + return tLog; + default: + ASSERT(false); + } + } ASSERT(false); return tLogFn; } diff --git a/fdbserver/workloads/ConfigureDatabase.actor.cpp b/fdbserver/workloads/ConfigureDatabase.actor.cpp index b49b7b8f82..6ebabc899c 100644 --- a/fdbserver/workloads/ConfigureDatabase.actor.cpp +++ b/fdbserver/workloads/ConfigureDatabase.actor.cpp @@ -27,7 +27,11 @@ // "ssd" is an alias to the preferred type which skews the random distribution toward it but that's okay. static const char* storeTypes[] = { "ssd", "ssd-1", "ssd-2", "memory", "memory-1", "memory-2" }; -static const char* logTypes[] = { "log_engine:=1", "log_engine:=2", "log_spill:=1", "log_spill:=2", "log_version:=2", "log_version:=3" }; +static const char* logTypes[] = { + "log_engine:=1", "log_engine:=2", + "log_spill:=1", "log_spill:=2", + "log_version:=2", "log_version:=3", "log_version:=4" +}; static const char* redundancies[] = { "single", "double", "triple" }; std::string generateRegions() {