mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-26 09:22:34 +08:00
Merge pull request #4695 from sfc-gh-etschannen/fix-rewrite-bme
rewrote tlog recruitment logic so that it is deterministic
This commit is contained in:
commit
340f012e1a
documentation/sphinx/source
fdbclient
fdbrpc
fdbserver
flow
@ -27,6 +27,7 @@
|
||||
"storage",
|
||||
"transaction",
|
||||
"resolution",
|
||||
"stateless",
|
||||
"commit_proxy",
|
||||
"grv_proxy",
|
||||
"master",
|
||||
|
@ -47,6 +47,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema(
|
||||
"storage",
|
||||
"transaction",
|
||||
"resolution",
|
||||
"stateless",
|
||||
"commit_proxy",
|
||||
"grv_proxy",
|
||||
"master",
|
||||
|
@ -34,7 +34,6 @@ struct ProcessClass {
|
||||
ResolutionClass,
|
||||
TesterClass,
|
||||
CommitProxyClass,
|
||||
GrvProxyClass,
|
||||
MasterClass,
|
||||
StatelessClass,
|
||||
LogClass,
|
||||
@ -46,6 +45,7 @@ struct ProcessClass {
|
||||
RatekeeperClass,
|
||||
StorageCacheClass,
|
||||
BackupClass,
|
||||
GrvProxyClass,
|
||||
InvalidClass = -1
|
||||
};
|
||||
|
||||
|
@ -151,6 +151,10 @@ struct PolicyAcross final : IReplicationPolicy, public ReferenceCounted<PolicyAc
|
||||
_policy->attributeKeys(set);
|
||||
}
|
||||
|
||||
Reference<IReplicationPolicy> embeddedPolicy() const { return _policy; }
|
||||
|
||||
const std::string& attributeKey() const { return _attribKey; }
|
||||
|
||||
protected:
|
||||
int _count;
|
||||
std::string _attribKey;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -730,9 +730,14 @@ ACTOR Future<Void> restartSimulatedSystem(vector<Future<Void>>* systemActors,
|
||||
zoneId = StringRef(zoneIDini);
|
||||
}
|
||||
|
||||
ProcessClass processClass =
|
||||
ProcessClass((ProcessClass::ClassType)atoi(ini.GetValue(machineIdString.c_str(), "mClass")),
|
||||
ProcessClass::CommandLineSource);
|
||||
ProcessClass::ClassType cType =
|
||||
(ProcessClass::ClassType)(atoi(ini.GetValue(machineIdString.c_str(), "mClass")));
|
||||
// using specialized class types can lead to nondeterministic recruitment
|
||||
if (cType == ProcessClass::MasterClass || cType == ProcessClass::ResolutionClass) {
|
||||
cType = ProcessClass::StatelessClass;
|
||||
}
|
||||
ProcessClass processClass = ProcessClass(cType, ProcessClass::CommandLineSource);
|
||||
|
||||
if (processClass != ProcessClass::TesterClass) {
|
||||
dcIds.push_back(dcUIDini);
|
||||
}
|
||||
@ -1450,8 +1455,7 @@ void setupSimulatedSystem(vector<Future<Void>>* systemActors,
|
||||
bool requiresExtraDBMachines = testConfig.extraDB && g_simulator.extraDB->toString() != conn.toString();
|
||||
int assignedMachines = 0, nonVersatileMachines = 0;
|
||||
std::vector<ProcessClass::ClassType> processClassesSubSet = { ProcessClass::UnsetClass,
|
||||
ProcessClass::ResolutionClass,
|
||||
ProcessClass::MasterClass };
|
||||
ProcessClass::StatelessClass };
|
||||
for (int dc = 0; dc < dataCenters; dc++) {
|
||||
// FIXME: test unset dcID
|
||||
Optional<Standalone<StringRef>> dcUID = StringRef(format("%d", dc));
|
||||
@ -1493,12 +1497,12 @@ void setupSimulatedSystem(vector<Future<Void>>* systemActors,
|
||||
else if (assignedMachines == 4 && !simconfig.db.regions.size())
|
||||
processClass = ProcessClass(
|
||||
processClassesSubSet[deterministicRandom()->randomInt(0, processClassesSubSet.size())],
|
||||
ProcessClass::CommandLineSource); // Unset or Resolution or Master
|
||||
ProcessClass::CommandLineSource); // Unset or Stateless
|
||||
else
|
||||
processClass = ProcessClass((ProcessClass::ClassType)deterministicRandom()->randomInt(0, 3),
|
||||
ProcessClass::CommandLineSource); // Unset, Storage, or Transaction
|
||||
if (processClass ==
|
||||
ProcessClass::ResolutionClass) // *can't* be assigned to other roles, even in an emergency
|
||||
ProcessClass::StatelessClass) // *can't* be assigned to other roles, even in an emergency
|
||||
nonVersatileMachines++;
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,8 @@ struct WorkerDetails {
|
||||
WorkerDetails(const WorkerInterface& interf, ProcessClass processClass, bool degraded)
|
||||
: interf(interf), processClass(processClass), degraded(degraded) {}
|
||||
|
||||
bool operator<(const WorkerDetails& r) const { return interf.id() < r.interf.id(); }
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, interf, processClass, degraded);
|
||||
|
@ -135,7 +135,7 @@ void FlowKnobs::initialize(bool randomize, bool isSimulated) {
|
||||
init( DISABLE_POSIX_KERNEL_AIO, 0 );
|
||||
|
||||
//AsyncFileNonDurable
|
||||
init( NON_DURABLE_MAX_WRITE_DELAY, 5.0 );
|
||||
init( NON_DURABLE_MAX_WRITE_DELAY, 2.0 ); if( randomize && BUGGIFY ) NON_DURABLE_MAX_WRITE_DELAY = 5.0;
|
||||
init( MAX_PRIOR_MODIFICATION_DELAY, 1.0 ); if( randomize && BUGGIFY ) MAX_PRIOR_MODIFICATION_DELAY = 10.0;
|
||||
|
||||
//GenericActors
|
||||
|
Loading…
x
Reference in New Issue
Block a user