FastRestore:Use cannonical way to trace error

This commit is contained in:
Meng Xu 2020-05-01 13:35:13 -07:00
parent ba07d449f6
commit 134dbca0ee
4 changed files with 6 additions and 14 deletions

View File

@ -84,14 +84,12 @@ ACTOR Future<Void> restoreApplierCore(RestoreApplierInterface applierInterf, int
updateProcessStatsTimer = delay(SERVER_KNOBS->FASTRESTORE_UPDATE_PROCESS_STATS_INTERVAL);
}
when(wait(exitRole)) {
TraceEvent("RestoreApplierCoreExitRole").detail("NodeID", self->id());
TraceEvent("RestoreApplierCoreExitRole", self->id());
break;
}
}
} catch (Error& e) {
TraceEvent(SevWarn, "FastRestoreApplierError", self->id())
.detail("Error", e.what())
.detail("RequestType", requestTypeStr);
TraceEvent(SevWarn, "FastRestoreApplierError", self->id()).detail("RequestType", requestTypeStr).error(e);
break;
}
}

View File

@ -354,9 +354,7 @@ Future<Void> getBatchReplies(RequestStream<Request> Interface::*channel, std::ma
} catch (Error& e) {
if (e.code() == error_code_operation_cancelled) break;
// fprintf(stdout, "sendBatchRequests Error code:%d, error message:%s\n", e.code(), e.what());
TraceEvent(SevWarn, "FastRestoreSendBatchRequests")
.detail("ErrorCode", e.code())
.detail("ErrorInfo", e.what());
TraceEvent(SevWarn, "FastRestoreSendBatchRequests").error(e);
for (auto& request : requests) {
TraceEvent(SevWarn, "FastRestoreLoader")
.detail("SendBatchRequests", requests.size())

View File

@ -111,14 +111,12 @@ ACTOR Future<Void> restoreLoaderCore(RestoreLoaderInterface loaderInterf, int no
updateProcessStatsTimer = delay(SERVER_KNOBS->FASTRESTORE_UPDATE_PROCESS_STATS_INTERVAL);
}
when(wait(exitRole)) {
TraceEvent("FastRestoreLoaderCoreExitRole").detail("NodeID", self->id());
TraceEvent("FastRestoreLoaderCoreExitRole", self->id());
break;
}
}
} catch (Error& e) {
TraceEvent(SevWarn, "FastRestoreLoader", self->id())
.detail("Error", e.what())
.detail("RequestType", requestTypeStr);
TraceEvent(SevWarn, "FastRestoreLoader", self->id()).detail("RequestType", requestTypeStr).error(e);
break;
}
}

View File

@ -240,9 +240,7 @@ ACTOR Future<Void> startRestoreWorker(Reference<RestoreWorkerData> self, Restore
}
}
} catch (Error& e) {
TraceEvent(SevWarn, "FastRestoreWorkerError")
.detail("Error", e.what())
.detail("RequestType", requestTypeStr);
TraceEvent(SevWarn, "FastRestoreWorkerError").detail("RequestType", requestTypeStr).error(e);
break;
}
}