mirror of
https://github.com/apple/foundationdb.git
synced 2026-01-25 04:18:18 +00:00
Remove blob failure injections (#12620)
* Remove blob failure injections Follow-up for the cleanup done at #12435. These functions are unused now. * Fix an assertion failure in simulation sim2 has "ASSERT(seconds >= -0.0001);" in delay() function, which was triggering from the tlog code. Reproduction: -f ./tests/fast/SidebandSingle.toml -s 3567205446 -b on
This commit is contained in:
@@ -131,8 +131,6 @@ public:
|
||||
bool forceKill = false,
|
||||
KillType* ktFinal = nullptr) = 0;
|
||||
virtual bool killAll(KillType kt, bool forceKill = false, KillType* ktFinal = nullptr) = 0;
|
||||
virtual void processInjectBlobFault(ProcessInfo* machine, double failureRate) = 0;
|
||||
virtual void processStopInjectBlobFault(ProcessInfo* machine) = 0;
|
||||
virtual bool canKillProcesses(std::vector<ProcessInfo*> const& availableProcesses,
|
||||
std::vector<ProcessInfo*> const& deadProcesses,
|
||||
KillType kt,
|
||||
|
||||
@@ -117,29 +117,6 @@ bool simulator_should_inject_fault(const char* context, const char* file, int li
|
||||
return false;
|
||||
}
|
||||
|
||||
bool simulator_should_inject_blob_fault(const char* context, const char* file, int line, int error_code) {
|
||||
if (!g_network->isSimulated() || !faultInjectionActivated)
|
||||
return false;
|
||||
|
||||
auto p = g_simulator->getCurrentProcess();
|
||||
|
||||
if (!g_simulator->speedUpSimulation && deterministicRandom()->random01() < p->blob_inject_failure_rate) {
|
||||
CODE_PROBE(true, "A blob fault was injected", probe::assert::simOnly, probe::context::sim2);
|
||||
CODE_PROBE(error_code == error_code_http_request_failed,
|
||||
"A failed http request was injected",
|
||||
probe::assert::simOnly,
|
||||
probe::context::sim2);
|
||||
TraceEvent("BlobFaultInjected")
|
||||
.detail("Context", context)
|
||||
.detail("File", file)
|
||||
.detail("Line", line)
|
||||
.detail("ErrorCode", error_code);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ISimulator::disableFor(const std::string& desc, double time) {
|
||||
disabledMap[desc] = time;
|
||||
}
|
||||
@@ -2398,18 +2375,6 @@ public:
|
||||
g_clogging.reconnectPair(from, to);
|
||||
}
|
||||
|
||||
void processInjectBlobFault(ProcessInfo* machine, double failureRate) override {
|
||||
CODE_PROBE(true, "Simulated process beginning blob fault", probe::context::sim2, probe::assert::simOnly);
|
||||
should_inject_blob_fault = simulator_should_inject_blob_fault;
|
||||
ASSERT(machine->blob_inject_failure_rate == 0.0);
|
||||
machine->blob_inject_failure_rate = failureRate;
|
||||
}
|
||||
|
||||
void processStopInjectBlobFault(ProcessInfo* machine) override {
|
||||
CODE_PROBE(true, "Simulated process stopping blob fault", probe::context::sim2, probe::assert::simOnly);
|
||||
machine->blob_inject_failure_rate = 0.0;
|
||||
}
|
||||
|
||||
std::vector<ProcessInfo*> getAllProcesses() const override {
|
||||
std::vector<ProcessInfo*> processes;
|
||||
for (auto& c : machines) {
|
||||
|
||||
@@ -2981,6 +2981,8 @@ ACTOR Future<Void> pullAsyncData(TLogData* self,
|
||||
// When we just processed some data, we reset the warning start time.
|
||||
state double lastPullAsyncDataWarningTime = now();
|
||||
loop {
|
||||
double waitTime = std::max(
|
||||
0.0, lastPullAsyncDataWarningTime + SERVER_KNOBS->TLOG_PULL_ASYNC_DATA_WARNING_TIMEOUT_SECS - now());
|
||||
choose {
|
||||
when(wait(r ? r->getMore(TaskPriority::TLogCommit) : Never())) {
|
||||
break;
|
||||
@@ -2993,8 +2995,7 @@ ACTOR Future<Void> pullAsyncData(TLogData* self,
|
||||
}
|
||||
dbInfoChange = logData->logSystem->onChange();
|
||||
}
|
||||
when(wait(delay(lastPullAsyncDataWarningTime + SERVER_KNOBS->TLOG_PULL_ASYNC_DATA_WARNING_TIMEOUT_SECS -
|
||||
now()))) {
|
||||
when(wait(delay(waitTime))) {
|
||||
TraceEvent(SevWarn, "TLogPullAsyncDataSlow", logData->logId)
|
||||
.detail("Elapsed", now() - startTime)
|
||||
.detail("Version", logData->version.get());
|
||||
|
||||
Reference in New Issue
Block a user