Enhance trace event.

This commit is contained in:
negoyal 2021-11-16 17:39:59 -08:00
parent 8fac798ece
commit ce112e1f23
2 changed files with 5 additions and 7 deletions

View File

@ -68,11 +68,13 @@ struct VFSAsyncFile {
// Error code is only checked for non-zero because the SQLite API error code after an injected error // Error code is only checked for non-zero because the SQLite API error code after an injected error
// may not match the error code returned by VFSAsyncFile when the inject error occurred. // may not match the error code returned by VFSAsyncFile when the inject error occurred.
bool e = g_network->global(INetwork::enSQLiteInjectedError) != (flowGlobalType)0; bool e = g_network->global(INetwork::enSQLiteInjectedError) != (flowGlobalType)0;
bool f = g_simulator.checkInjectedCorruption();
TraceEvent("VFSCheckInjectedError") TraceEvent("VFSCheckInjectedError")
.detail("Found", e) .detail("InjectedIOError", e)
.detail("InjectedCorruption", f)
.detail("ErrorCode", (int64_t)g_network->global(INetwork::enSQLiteInjectedError)) .detail("ErrorCode", (int64_t)g_network->global(INetwork::enSQLiteInjectedError))
.backtrace(); .backtrace();
return e || (g_network->isSimulated() && g_simulator.checkInjectedCorruption()); return e || f;
} }
uint32_t* const pLockCount; // +1 for each SHARED_LOCK, or 1+X_COUNT for lock level X uint32_t* const pLockCount; // +1 for each SHARED_LOCK, or 1+X_COUNT for lock level X

View File

@ -50,7 +50,6 @@ struct TargetedKillWorkload : TestWorkload {
std::string description() const override { return "TargetedKillWorkload"; } std::string description() const override { return "TargetedKillWorkload"; }
Future<Void> setup(Database const& cx) override { return Void(); } Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { Future<Void> start(Database const& cx) override {
TraceEvent("StartTargetedKill").detail("Enabled", enabled);
if (enabled) if (enabled)
return assassin(cx, this); return assassin(cx, this);
return Void(); return Void();
@ -142,13 +141,10 @@ struct TargetedKillWorkload : TestWorkload {
for (j = 0; j < storageServers.size(); j++) { for (j = 0; j < storageServers.size(); j++) {
StorageServerInterface ssi = storageServers[s]; StorageServerInterface ssi = storageServers[s];
machine = ssi.address(); machine = ssi.address();
if (machine != self->dbInfo->get().clusterInterface.getWorkers.getEndpoint().getPrimaryAddress()) { if (machine != ccAddr) {
TraceEvent("IsolatedMark").detail("TargetedMachine", machine).detail("Role", self->machineToKill); TraceEvent("IsolatedMark").detail("TargetedMachine", machine).detail("Role", self->machineToKill);
wait(self->killEndpoint(workers, machine, cx, self)); wait(self->killEndpoint(workers, machine, cx, self));
killed++; killed++;
TraceEvent("SentKillEndpoint")
.detail("Killed", killed)
.detail("NumKillStorages", self->numKillStorages);
if (killed == self->numKillStorages) if (killed == self->numKillStorages)
return Void(); return Void();
} }