Trace message changes and fix few FIXMEs

This commit is contained in:
sramamoorthy 2019-03-06 17:16:59 -08:00 committed by Alex Miller
parent 69edefe68b
commit 72dd067173
13 changed files with 178 additions and 204 deletions

View File

@ -300,8 +300,6 @@ struct GetHealthMetricsRequest
};
struct ExecRequest {
// FIXME: sramamoorthy, FDB6PORT, flat-buffers related versioning disabled
// constexpr static flat_buffers::FileIdentifier file_identifier = 1315755287;
Arena arena;
StringRef execPayLoad;
ReplyPromise<Void> reply;
@ -312,8 +310,6 @@ struct ExecRequest {
template <class Ar>
void serialize(Ar& ar) {
// FIXME: sramamoorthy, FDB6PORT, flat-buffers related versioning disabled
// serializer(ar, v2(execPayLoad), v2(reply), v2(arena), v2(debugID));
serializer(ar, execPayLoad, reply, arena, debugID);
}
};

View File

@ -3317,10 +3317,10 @@ ACTOR Future<Void> snapCreate(Database inputCx, StringRef snapCmd, UID snapUID)
// remember the client ID before the snap operation
state UID preSnapClientUID = cx->clientInfo->get().id;
TraceEvent("snapCreate")
.detail("snapCmd", snapCmd.toString())
.detail("snapCreateEnter", snapUID)
.detail("preSnapClientUID", preSnapClientUID);
TraceEvent("SnapCreateEnter")
.detail("SnapCmd", snapCmd.toString())
.detail("UID", snapUID)
.detail("PreSnapClientUID", preSnapClientUID);
tr.debugTransaction(snapUID);
std::string snapString = "empty-binary:uid=" + snapUID.toString();
@ -3339,12 +3339,12 @@ ACTOR Future<Void> snapCreate(Database inputCx, StringRef snapCmd, UID snapUID)
}
}
TraceEvent("snapCreate").detail("snapCreate.After.LockingTLogs", snapUID);
TraceEvent("SnapCreateAfterLockingTLogs").detail("UID", snapUID);
int p = snapCmd.toString().find_first_of(':', 0);
state std::string snapPayLoad;
TraceEvent("snapCmd").detail("snapCmd", snapCmd.toString());
TraceEvent("SnapCmd").detail("Command", snapCmd.toString());
if (p == snapCmd.toString().npos) {
snapPayLoad = snapCmd.toString() + ":uid=" + snapUID.toString();
} else {
@ -3364,11 +3364,11 @@ ACTOR Future<Void> snapCreate(Database inputCx, StringRef snapCmd, UID snapUID)
tr.execute(execSnap, snapPayLoadRef);
wait(tr.commit());
} catch (Error& e) {
TraceEvent("snapCreate").detail("snapCreateErrorSnapTLogStorage", e.what());
TraceEvent("SnapCreateErroSnapTLogStorage").detail("Error", e.what());
throw;
}
TraceEvent("snapCreate").detail("snapCreate.After.SnappingTLogsStorage", snapUID);
TraceEvent("SnapCreateAfterSnappingTLogStorage").detail("UID", snapUID);
// enable popping of the TLog
loop {
@ -3382,28 +3382,28 @@ ACTOR Future<Void> snapCreate(Database inputCx, StringRef snapCmd, UID snapUID)
}
}
TraceEvent("snapCreate").detail("snapCreate.After.UnlockingTLogs", snapUID);
TraceEvent("SnapCreateAfterUnlockingTLogs").detail("UID", snapUID);
// snap the coordinators
try {
Future<Void> exec = executeCoordinators(cx, snapPayLoad, snapUID);
wait(exec);
} catch (Error& e) {
TraceEvent("snapCreate").detail("snapCreateErrorSnapCoordinators", e.what());
TraceEvent("SnapCreateErrorSnapCoords").detail("Error", e.what());
throw;
}
TraceEvent("snapCreate").detail("snapCreate.After.SnappingCoords", snapUID);
TraceEvent("SnapCreateAfterSnappingCoords").detail("UID", snapUID);
// if the client IDs did not change then we have a clean snapshot
UID postSnapClientUID = cx->clientInfo->get().id;
if (preSnapClientUID != postSnapClientUID) {
TraceEvent("UID mismatch")
.detail("preSnapClientUID", preSnapClientUID)
.detail("postSnapClientUID", postSnapClientUID);
.detail("SnapPreSnapClientUID", preSnapClientUID)
.detail("SnapPostSnapClientUID", postSnapClientUID);
throw coordinators_changed();
}
TraceEvent("snapCreate").detail("snapCreate.Complete", snapUID);
TraceEvent("SnapCreateComplete").detail("UID", snapUID);
return Void();
}

View File

@ -87,14 +87,14 @@ void ExecCmdValueString::parseCmdValue() {
}
void ExecCmdValueString::dbgPrint() {
auto te = TraceEvent("execCmdValueString");
auto te = TraceEvent("ExecCmdValueString");
te.detail("cmdValueString", cmdValueString);
te.detail("binaryPath", binaryPath);
te.detail("CmdValueString", cmdValueString);
te.detail("BinaryPath", binaryPath);
int i = 0;
for (auto elem : binaryArgs) {
te.detail(format("arg{}", ++i).c_str(), elem);
te.detail(format("Arg", ++i).c_str(), elem);
}
return;
}

View File

@ -763,15 +763,14 @@ ACTOR Future<Void> commitBatch(
te1.detail("To", "all sources");
te1.detail("Mutation", m.toString());
te1.detail("Version", commitVersion);
te1.detail("numTags", allSources.size());
te1.detail("NumTags", allSources.size());
if (m.param1 == execSnap) {
te1.trackLatest(tokenStr.c_str());
}
// FIXME: sramamoorthy, FDB6port - dynamic tracing not supported?
// auto te = TraceEvent(SevDebug, "tagInfo");
auto te = TraceEvent(SevDebug, "TagInfo");
int i = 0;
for (auto& tag : allSources) {
// te.detail(format("tagId{}", ++i).c_str(), tag.toString());
te.detail(format("TagId", ++i).c_str(), tag.toString());
toCommit.addTag(tag);
}
toCommit.addTypedMessage(m);
@ -1572,7 +1571,7 @@ ACTOR Future<Void> masterProxyServerCore(
"MasterProxyServer.masterProxyServerCore."
"ExecRequest");
TraceEvent("ExecRequest").detail("payload", execReq.execPayLoad.toString());
TraceEvent("ExecRequest").detail("Payload", execReq.execPayLoad.toString());
// get the list of coordinators
state Optional<Value> coordinators = commitData.txnStateStore->readValue(coordinatorsKey).get();

View File

@ -1320,7 +1320,7 @@ ACTOR Future<Void> tLogCommit(
rd >> len;
param2 = StringRef((uint8_t const*)rd.readBytes(len), len);
TraceEvent("oldTLog6TLogCommandType", self->dbgid).detail("execCmd", execCmd.toString());
TraceEvent("TLogExecCommandType", self->dbgid).detail("Value", execCmd.toString());
execArg.setCmdValueString(param2.toString());
execArg.dbgPrint();
@ -1338,21 +1338,20 @@ ACTOR Future<Void> tLogCommit(
}
if (execVersion == invalidVersion) {
TraceEvent(SevWarn, "snapFailed")
.detail("ignorePopUid", self->ignorePopUid)
.detail("ignorePopRequest", self->ignorePopRequest)
.detail("reason", reason)
TraceEvent(SevWarn, "TLogSnapFailed")
.detail("IgnorePopUid", self->ignorePopUid)
.detail("IgnorePopRequest", self->ignorePopRequest)
.detail("Reason", reason)
.trackLatest(reason.c_str());
auto startTag = logData->allTags.begin();
std::string message = "ExecTrace/TLog/" + logData->allTags.begin()->toString();
// startTag.toString() +
"/" + uidStr;
TraceEvent("oldTLog6ExecCmdSnapCreate")
.detail("uidStr", uidStr)
.detail("status", -1)
.detail("tag", logData->allTags.begin()->toString())
.detail("role", "TLog")
TraceEvent("ExecCmdSnapCreate")
.detail("Uid", uidStr)
.detail("Status", -1)
.detail("Tag", logData->allTags.begin()->toString())
.detail("Role", "TLog")
.trackLatest(message.c_str());
}
}
@ -1360,38 +1359,38 @@ ACTOR Future<Void> tLogCommit(
execVersion = invalidVersion;
self->ignorePopRequest = true;
if (self->ignorePopUid != "") {
TraceEvent(SevWarn, "oldTlog6TLogPopDisableonDisable")
.detail("ignorePopUid", self->ignorePopUid)
.detail("uidStr", uidStr);
TraceEvent(SevWarn, "TLogPopDisableonDisable")
.detail("IgnorePopUid", self->ignorePopUid)
.detail("UidStr", uidStr);
}
self->ignorePopUid = uidStr;
// ignorePopRequest will be turned off after 30 seconds
self->ignorePopDeadline = g_network->now() + 30.0;
TraceEvent("oldTLog6ExecCmdPopDisable")
.detail("execCmd", execCmd.toString())
.detail("uidStr", uidStr)
.detail("ignorePopUid", self->ignorePopUid)
.detail("ignporePopRequest", self->ignorePopRequest)
.detail("ignporePopDeadline", self->ignorePopDeadline)
TraceEvent("TLogExecCmdPopDisable")
.detail("ExecCmd", execCmd.toString())
.detail("UidStr", uidStr)
.detail("IgnorePopUid", self->ignorePopUid)
.detail("IgnporePopRequest", self->ignorePopRequest)
.detail("IgnporePopDeadline", self->ignorePopDeadline)
.trackLatest("disablePopTLog");
}
if (execCmd == execEnableTLogPop) {
execVersion = invalidVersion;
if (self->ignorePopUid != uidStr) {
TraceEvent(SevWarn, "oldTLog6tLogPopDisableEnableUidMismatch")
.detail("ignorePopUid", self->ignorePopUid)
.detail("uidStr", uidStr)
TraceEvent(SevWarn, "TLogPopDisableEnableUidMismatch")
.detail("IgnorePopUid", self->ignorePopUid)
.detail("UidStr", uidStr)
.trackLatest("tLogPopDisableEnableUidMismatch");
}
self->ignorePopRequest = false;
self->ignorePopDeadline = 0.0;
self->ignorePopUid = "";
TraceEvent("oldTLog6ExecCmdPopEnable")
.detail("execCmd", execCmd.toString())
.detail("uidStr", uidStr)
.detail("ignorePopUid", self->ignorePopUid)
.detail("ignporePopRequest", self->ignorePopRequest)
.detail("ignporePopDeadline", self->ignorePopDeadline)
TraceEvent("TLog6ExecCmdPopEnable")
.detail("ExecCmd", execCmd.toString())
.detail("UidStr", uidStr)
.detail("IgnorePopUid", self->ignorePopUid)
.detail("IgnporePopRequest", self->ignorePopRequest)
.detail("IgnporePopDeadline", self->ignorePopDeadline)
.trackLatest("enablePopTLog");
}
}
@ -1456,9 +1455,9 @@ ACTOR Future<Void> tLogCommit(
std::string tLogFolderToCreateCmd = "mkdir " + tLogFolderTo;
std::string tLogFolderCopyCmd = "cp " + tLogFolderFrom + " " + tLogFolderTo;
TraceEvent("oldTLog6ExecSnapCommands")
.detail("tLogFolderToCreateCmd", tLogFolderToCreateCmd)
.detail("tLogFolderCopyCmd", tLogFolderCopyCmd);
TraceEvent("ExecSnapCommands")
.detail("TLogFolderToCreateCmd", tLogFolderToCreateCmd)
.detail("TLogFolderCopyCmd", tLogFolderCopyCmd);
vector<std::string> paramList;
std::string cpBin = "/bin/cp";
@ -1476,37 +1475,34 @@ ACTOR Future<Void> tLogCommit(
err = fdbFork(cpBin, paramList);
}
}
TraceEvent("oldTLog6CommitExecTraceTLog")
.detail("uidStr", uidStr)
.detail("status", err)
.detail("tag", logData->allTags.begin()->toString())
.detail("role", "TLog");
TraceEvent("TLogCommitExecTraceTLog")
.detail("UidStr", uidStr)
.detail("Status", err)
.detail("Tag", logData->allTags.begin()->toString())
.detail("Role", "TLog");
// print the status message
// print the detailed status message
for (auto it = logData->allTags.begin(); it != logData->allTags.end(); it++) {
Version poppedTagVersion = -1;
auto tagv = logData->getTagData(*it);
// auto tagv = logData->tag_data.find(*it);
// if (tagv != logData->tag_data.end()) {
// poppedTagVersion = tagv->value.popped;
// }
poppedTagVersion = tagv->popped;
int len = param2.size();
state std::string message = "ExecTrace/TLog/" + it->toString() + "/" + uidStr;
TraceEvent te = TraceEvent(SevDebug, "oldTLog6ExecTraceDetailed");
te.detail("uid", uidStr);
te.detail("status", err);
te.detail("role", "TLog");
te.detail("execCmd", execCmd.toString());
te.detail("param2", param2.toString());
TraceEvent te = TraceEvent(SevDebug, "TLogExecTraceDetailed");
te.detail("Uid", uidStr);
te.detail("Status", err);
te.detail("Role", "TLog");
te.detail("ExecCmd", execCmd.toString());
te.detail("Param2", param2.toString());
te.detail("Tag", it->toString());
te.detail("Version", qe.version);
te.detail("poppedTagVersion", poppedTagVersion);
te.detail("persistentDataVersion", logData->persistentDataVersion);
te.detail("persistentDatadurableVersion", logData->persistentDataDurableVersion);
te.detail("queueCommittedVersion", logData->queueCommittedVersion.get());
te.detail("ignorePopUid", self->ignorePopUid);
te.detail("PoppedTagVersion", poppedTagVersion);
te.detail("PersistentDataVersion", logData->persistentDataVersion);
te.detail("PersistentDatadurableVersion", logData->persistentDataDurableVersion);
te.detail("QueueCommittedVersion", logData->queueCommittedVersion.get());
te.detail("IgnorePopUid", self->ignorePopUid);
if (execCmd == execSnap) {
te.trackLatest(message.c_str());
}
@ -1702,16 +1698,16 @@ ACTOR Future<Void> serveTLogInterface( TLogData* self, TLogInterface tli, Refere
self->ignorePopRequest = false;
self->ignorePopUid = "";
self->ignorePopDeadline = 0.0;
TraceEvent("oldTLog6resetIgnorePopRequest")
.detail("now", g_network->now())
.detail("ignorePopRequest", self->ignorePopRequest)
.detail("ignorePopDeadline", self->ignorePopDeadline)
TraceEvent("ResetIgnorePopRequest")
.detail("Now", g_network->now())
.detail("IgnorePopRequest", self->ignorePopRequest)
.detail("IgnorePopDeadline", self->ignorePopDeadline)
.trackLatest("disableTLogPopTimedOut");
}
if (!self->ignorePopRequest) {
logData->addActor.send(tLogPop(self, req, logData));
} else {
TraceEvent("oldTLog6ignoringPopRequest").detail("ignorePopDeadline", self->ignorePopDeadline);
TraceEvent("IgnoringPopRequest").detail("IgnorePopDeadline", self->ignorePopDeadline);
}
}
when( TLogCommitRequest req = waitNext( tli.commit.getFuture() ) ) {

View File

@ -225,7 +225,6 @@ struct TLogCommitRequest {
: arena(a), prevVersion(prevVersion), version(version), knownCommittedVersion(knownCommittedVersion), minKnownCommittedVersion(minKnownCommittedVersion), messages(messages), debugID(debugID), hasExecOp(hasExecOp){}
template <class Ar>
void serialize( Ar& ar ) {
// FIXME: sramamoorthy, FDB6port, flatbuffers related versioning missing
serializer(ar, prevVersion, version, knownCommittedVersion, minKnownCommittedVersion, messages, reply, arena, debugID, hasExecOp);
}
};

View File

@ -1687,7 +1687,7 @@ ACTOR Future<Void> tLogCommit(
rd >> len;
param2 = StringRef((uint8_t const*)rd.readBytes(len), len);
TraceEvent("TLogCommandType", self->dbgid).detail("execCmd", execCmd.toString());
TraceEvent("TLogExecCommandType", self->dbgid).detail("Value", execCmd.toString());
execArg.setCmdValueString(param2.toString());
execArg.dbgPrint();
@ -1705,22 +1705,21 @@ ACTOR Future<Void> tLogCommit(
}
if (execVersion == invalidVersion) {
TraceEvent(SevWarn, "oldTLog6snapFailed")
.detail("ignorePopUid", self->ignorePopUid)
.detail("ignorePopRequest", self->ignorePopRequest)
.detail("reason", reason)
TraceEvent(SevWarn, "TLogSnapFailed")
.detail("IgnorePopUid", self->ignorePopUid)
.detail("IgnorePopRequest", self->ignorePopRequest)
.detail("Reason", reason)
.trackLatest(reason.c_str());
auto startTag = logData->allTags.begin();
std::string message = "ExecTrace/TLog/" +
logData->allTags.begin()->toString();
// startTag.toString() +
"/" + uidStr;
TraceEvent("TLog6ExecCmdSnapCreate")
.detail("uidStr", uidStr)
.detail("status", -1)
.detail("tag", logData->allTags.begin()->toString())
.detail("role", "TLog")
TraceEvent("ExecCmdSnapCreate")
.detail("Uid", uidStr)
.detail("Status", -1)
.detail("Tag", logData->allTags.begin()->toString())
.detail("Role", "TLog")
.trackLatest(message.c_str());
}
}
@ -1728,38 +1727,38 @@ ACTOR Future<Void> tLogCommit(
execVersion = invalidVersion;
self->ignorePopRequest = true;
if (self->ignorePopUid != "") {
TraceEvent(SevWarn, "tLogPopDisableOnDisable")
.detail("ignorePopUid", self->ignorePopUid)
.detail("uidStr", uidStr);
TraceEvent(SevWarn, "TLogPopDisableOnDisable")
.detail("IgnorePopUid", self->ignorePopUid)
.detail("UidStr", uidStr);
}
self->ignorePopUid = uidStr;
// ignorePopRequest will be turned off after 30 seconds
self->ignorePopDeadline = g_network->now() + 30.0;
TraceEvent("TLogExecCmdPopDisable")
.detail("execCmd", execCmd.toString())
.detail("uidStr", uidStr)
.detail("ignorePopUid", self->ignorePopUid)
.detail("ignporePopRequest", self->ignorePopRequest)
.detail("ignporePopDeadline", self->ignorePopDeadline)
.detail("ExecCmd", execCmd.toString())
.detail("UidStr", uidStr)
.detail("IgnorePopUid", self->ignorePopUid)
.detail("IgnporePopRequest", self->ignorePopRequest)
.detail("IgnporePopDeadline", self->ignorePopDeadline)
.trackLatest("disablePopTLog");
}
if (execCmd == execEnableTLogPop) {
execVersion = invalidVersion;
if (self->ignorePopUid != uidStr) {
TraceEvent(SevWarn, "tLogPopDisableEnableUidMismatch")
.detail("ignorePopUid", self->ignorePopUid)
.detail("uidStr", uidStr)
.trackLatest("tLogPopDisableEnableUidMismatch");
TraceEvent(SevWarn, "TLogPopDisableEnableUidMismatch")
.detail("IgnorePopUid", self->ignorePopUid)
.detail("UidStr", uidStr)
.trackLatest("TLogPopDisableEnableUidMismatch");
}
self->ignorePopRequest = false;
self->ignorePopDeadline = 0.0;
self->ignorePopUid = "";
TraceEvent("TLogExecCmdPopEnable")
.detail("execCmd", execCmd.toString())
.detail("uidStr", uidStr)
.detail("ignorePopUid", self->ignorePopUid)
.detail("ignporePopRequest", self->ignorePopRequest)
.detail("ignporePopDeadline", self->ignorePopDeadline)
.detail("ExecCmd", execCmd.toString())
.detail("UidStr", uidStr)
.detail("IgnorePopUid", self->ignorePopUid)
.detail("IgnporePopRequest", self->ignorePopRequest)
.detail("IgnporePopDeadline", self->ignorePopDeadline)
.trackLatest("enablePopTLog");
}
}
@ -1826,8 +1825,8 @@ ACTOR Future<Void> tLogCommit(
"cp " + tLogFolderFrom + " " + tLogFolderTo;
TraceEvent("TLogExecSnapcommands")
.detail("tLogFolderToCreateCmd", tLogFolderToCreateCmd)
.detail("tLogFolderCopyCmd", tLogFolderCopyCmd);
.detail("TLogFolderToCreateCmd", tLogFolderToCreateCmd)
.detail("TLogFolderCopyCmd", tLogFolderCopyCmd);
vector<std::string> paramList;
std::string cpBin = "/bin/cp";
@ -1846,43 +1845,38 @@ ACTOR Future<Void> tLogCommit(
}
}
TraceEvent("TLogCommitExecTraceLog")
.detail("uidStr", uidStr)
.detail("status", err)
.detail("tag", logData->allTags.begin()->toString())
.detail("role", "TLog");
.detail("UidStr", uidStr)
.detail("Status", err)
.detail("Tag", logData->allTags.begin()->toString())
.detail("Role", "TLog");
// print the status message
for (auto it = logData->allTags.begin(); it != logData->allTags.end(); it++) {
Version poppedTagVersion = -1;
auto tagv = logData->getTagData(*it);
// auto tagv = logData->tag_data.find(*it);
// if (tagv != logData->tag_data.end()) {
// poppedTagVersion = tagv->value.popped;
// }
poppedTagVersion = tagv->popped;
int len = param2.size();
state std::string message =
int len = param2.size();
state std::string message =
"ExecTrace/TLog/" + it->toString() + "/" + uidStr;
TraceEvent te = TraceEvent(SevDebug, "TLogExecTraceDetailed");
te.detail("uid", uidStr);
te.detail("status", err);
te.detail("role", "TLog");
te.detail("execCmd", execCmd.toString());
te.detail("param2", param2.toString());
te.detail("Tag", it->toString());
te.detail("Version", qe.version);
te.detail("poppedTagVersion", poppedTagVersion);
te.detail("persistentDataVersion", logData->persistentDataVersion);
te.detail("persistentDatadurableVersion",
logData->persistentDataDurableVersion);
te.detail("queueCommittedVersion",
logData->queueCommittedVersion.get());
te.detail("ignorePopUid", self->ignorePopUid);
if (execCmd == execSnap) {
te.trackLatest(message.c_str());
}
}
te.detail("Uid", uidStr);
te.detail("Status", err);
te.detail("Role", "TLog");
te.detail("ExecCmd", execCmd.toString());
te.detail("Param2", param2.toString());
te.detail("Tag", it->toString());
te.detail("Version", qe.version);
te.detail("PoppedTagVersion", poppedTagVersion);
te.detail("PersistentDataVersion", logData->persistentDataVersion);
te.detail("PersistentDatadurableVersion", logData->persistentDataDurableVersion);
te.detail("QueueCommittedVersion", logData->queueCommittedVersion.get());
te.detail("IgnorePopUid", self->ignorePopUid);
if (execCmd == execSnap) {
te.trackLatest(message.c_str());
}
}
execVersion = invalidVersion;
}
@ -2075,16 +2069,16 @@ ACTOR Future<Void> serveTLogInterface( TLogData* self, TLogInterface tli, Refere
self->ignorePopRequest = false;
self->ignorePopUid = "";
self->ignorePopDeadline = 0.0;
TraceEvent("resetIgnorePopRequest")
.detail("now", g_network->now())
.detail("ignorePopRequest", self->ignorePopRequest)
.detail("ignorePopDeadline", self->ignorePopDeadline)
TraceEvent("ResetIgnorePopRequest")
.detail("Now", g_network->now())
.detail("IgnorePopRequest", self->ignorePopRequest)
.detail("IgnorePopDeadline", self->ignorePopDeadline)
.trackLatest("disableTLogPopTimedOut");
}
if (!self->ignorePopRequest) {
logData->addActor.send(tLogPop(self, req, logData));
} else {
TraceEvent("ignoringPopRequest").detail("ignorePopDeadline", self->ignorePopDeadline);
TraceEvent("IgnoringPopRequest").detail("IgnorePopDeadline", self->ignorePopDeadline);
}
}
when( TLogCommitRequest req = waitNext( tli.commit.getFuture() ) ) {

View File

@ -241,8 +241,6 @@ struct TraceBatchDumpRequest {
};
struct ExecuteRequest {
// FIXME: sramamoorthy, FDB6port enable flat_buffers
// constexpr static flat_buffers::FileIdentifier file_identifier = 16478959;
ReplyPromise<Void> reply;
Arena arena;
@ -254,8 +252,6 @@ struct ExecuteRequest {
template <class Ar>
void serialize(Ar& ar) {
// FIXME: sramamoorthy, FDB6port enable flat_buffers
// serializer(ar, v2(reply), v2(execPayLoad), v2(arena));
serializer(ar, reply, execPayLoad, arena);
}
};

View File

@ -1863,7 +1863,7 @@ void splitMutation(StorageServer* data, KeyRangeMap<T>& map, MutationRef const&
std::string cmd = m.param1.toString();
int len = m.param2.size();
if ((cmd == execDisableTLogPop) || (cmd == execEnableTLogPop)) {
TraceEvent("IgnoreNonSnapCommands").detail("execCommand", cmd);
TraceEvent("IgnoreNonSnapCommands").detail("ExecCommand", cmd);
return;
}
ExecCmdValueString execArg(m.param2.toString());
@ -1895,9 +1895,9 @@ void splitMutation(StorageServer* data, KeyRangeMap<T>& map, MutationRef const&
} else {
// copy the files
TraceEvent("ExecTraceStorage")
.detail("storageFolder", data->folder)
.detail("localMachineId", data->thisServerID.toString())
.detail("durableVersion", data->durableVersion.get());
.detail("StorageFolder", data->folder)
.detail("LocalMachineId", data->thisServerID.toString())
.detail("DurableVersion", data->durableVersion.get());
std::string folder = abspath(data->folder);
@ -1908,8 +1908,8 @@ void splitMutation(StorageServer* data, KeyRangeMap<T>& map, MutationRef const&
std::string folderCopyCmd = "cp " + folderFrom + " " + folderTo;
TraceEvent("ExecTraceStorageSnapcommands")
.detail("folderToCreateCmd", folderToCreateCmd)
.detail("folderCopyCmd", folderCopyCmd);
.detail("FolderToCreateCmd", folderToCreateCmd)
.detail("FolderCopyCmd", folderCopyCmd);
vector<std::string> paramList;
std::string cpBin = "/bin/cp";
@ -1918,7 +1918,7 @@ void splitMutation(StorageServer* data, KeyRangeMap<T>& map, MutationRef const&
paramList.push_back(mkdirBin);
paramList.push_back(folderTo);
err = fdbFork(mkdirBin, paramList);
TraceEvent("mkdirStatus").detail("errno", err);
TraceEvent("MkdirStatus").detail("Errno", err);
if (err == 0) {
paramList.clear();
@ -1929,19 +1929,18 @@ void splitMutation(StorageServer* data, KeyRangeMap<T>& map, MutationRef const&
err = fdbFork(cpBin, paramList);
}
}
// FIXME, sramamoorthy, print for non execSnap commands too
auto tokenStr = "ExecTrace/storage/" + uidStr;
TraceEvent te = TraceEvent("ExecTraceStorage");
te.detail("Uid", uidStr);
te.detail("Status", err);
te.detail("Role", "storage");
te.detail("Version", ver);
te.detail("Mutation", m.toString());
te.detail("Mid", data->thisServerID.toString());
te.detail("DurableVersion", data->durableVersion.get());
te.detail("DataVersion", data->version.get());
te.detail("Tag", data->tag.toString());
if (cmd == execSnap) {
auto tokenStr = "ExecTrace/storage/" + uidStr;
TraceEvent te = TraceEvent("ExecTraceStorage");
te.detail("uid", uidStr);
te.detail("status", err);
te.detail("role", "storage");
te.detail("version", ver);
te.detail("mutation", m.toString());
te.detail("mid", data->thisServerID.toString());
te.detail("durableVersion", data->durableVersion.get());
te.detail("data_version", data->version.get());
te.detail("tag", data->tag.toString());
te.trackLatest(tokenStr.c_str());
}
} else

View File

@ -1219,8 +1219,8 @@ ACTOR Future<Void> workerServer(Reference<ClusterConnectionFile> connFile,
std::string folderCopyCmd = "cp " + folderFrom + " " + folderTo;
TraceEvent("ExecTraceCoordSnapcommands")
.detail("folderToCreateCmd", folderToCreateCmd)
.detail("folderCopyCmd", folderCopyCmd);
.detail("FolderToCreateCmd", folderToCreateCmd)
.detail("FolderCopyCmd", folderCopyCmd);
vector<std::string> paramList;
std::string cpBin = "/bin/cp";
@ -1229,7 +1229,7 @@ ACTOR Future<Void> workerServer(Reference<ClusterConnectionFile> connFile,
paramList.push_back(mkdirBin);
paramList.push_back(folderTo);
err = fdbFork(mkdirBin, paramList);
TraceEvent("mkdirStatus").detail("errno", err);
TraceEvent("MkdirStatus").detail("Errno", err);
if (err == 0) {
paramList.clear();
@ -1243,11 +1243,11 @@ ACTOR Future<Void> workerServer(Reference<ClusterConnectionFile> connFile,
auto tokenStr = "ExecTrace/Coordinators/" + uidStr;
auto te = TraceEvent("ExecTraceCoordinators");
te.detail("uid", uidStr);
te.detail("status", err);
te.detail("role", "coordinator");
te.detail("value", coordFolder);
te.detail("execPayLoad", req.execPayLoad.toString());
te.detail("Uid", uidStr);
te.detail("Status", err);
te.detail("Role", "coordinator");
te.detail("Value", coordFolder);
te.detail("ExecPayLoad", req.execPayLoad.toString());
te.trackLatest(tokenStr.c_str());
req.reply.send(Void());
}

View File

@ -244,7 +244,7 @@ public: // workload functions
} else if (self->testID == 1) {
// create a snapshot
state double toDelay = fmod(g_random->randomUInt32(), self->maxSnapDelay);
TraceEvent("toDelay").detail("toDelay", toDelay);
TraceEvent("ToDelay").detail("Value", toDelay);
ASSERT(toDelay < self->maxSnapDelay);
wait(delay(toDelay));

View File

@ -2692,35 +2692,31 @@ fdbFork(const std::string& path, const std::vector<std::string>& args)
}
paramList.push_back(nullptr);
// FIXME: sramamoorthy, FDB6port, dynamic content fails
auto te = TraceEvent("fdbFork");
te.detail("cmd", path);
// for (int i = 0; i < args.size(); i++) {
// te.detail("args", args[i]);
//}
auto te = TraceEvent("FdbFork");
te.detail("Cmd", path);
for (int i = 0; i < args.size(); i++) {
te.detail("Args", args[i]);
}
pid_t pid = fork();
if (pid == -1) {
TraceEvent(SevWarnAlways, "Command failed to spawn")
.detail("cmd", path);
throw platform_error();
} else if (pid > 0) {
TraceEvent(SevWarnAlways, "CommandFailedToSpawn").detail("Cmd", path);
throw platform_error();
} else if (pid > 0) {
int status;
waitpid(pid, &status, 0);
if (!(WIFEXITED(status) && WEXITSTATUS(status) == 0)) {
TraceEvent(SevWarnAlways, "Command failed")
.detail("cmd", path)
.detail("errno", WIFEXITED(status) ? WEXITSTATUS(status) : -1);
return WIFEXITED(status) ? WEXITSTATUS(status) : -1;
}
TraceEvent("Command status")
.detail("cmd", path)
.detail("errno", WIFEXITED(status) ? WEXITSTATUS(status) : 0);
} else {
execv(const_cast<char*>(path.c_str()), &paramList[0]);
TraceEvent(SevWarnAlways, "CommandFailed")
.detail("Cmd", path)
.detail("Errno", WIFEXITED(status) ? WEXITSTATUS(status) : -1);
return WIFEXITED(status) ? WEXITSTATUS(status) : -1;
}
TraceEvent("CommandStatus").detail("Cmd", path).detail("Errno", WIFEXITED(status) ? WEXITSTATUS(status) : 0);
} else {
execv(const_cast<char*>(path.c_str()), &paramList[0]);
_exit(EXIT_FAILURE);
}
return 0;
}
return 0;
}

View File

@ -533,7 +533,6 @@ bool isLibraryLoaded(const char* lib_path);
void* loadLibrary(const char* lib_path);
void* loadFunction(void* lib, const char* func_name);
// FIXME: sramamoorthy, clang-format fails here fix it
// wrapper to execv
// takes two arguments:
// 1. path to the binary