mirror of https://github.com/citusdata/citus.git
Better deadlock detection debugging
parent
c6077feb76
commit
1e874347a9
|
@ -645,6 +645,9 @@ LogTransactionNode(TransactionNode *transactionNode)
|
|||
appendStringInfo(logMessage, "[WaitsFor gpids: %s]",
|
||||
WaitsForToString(transactionNode->waitsFor));
|
||||
|
||||
uint64 gpid = transactionId->gpid;
|
||||
bool gpidMissingOk = false;
|
||||
|
||||
/* log the backend query if the proc is associated with the transaction */
|
||||
if (transactionNode->initiatorProc != NULL)
|
||||
{
|
||||
|
@ -654,6 +657,17 @@ LogTransactionNode(TransactionNode *transactionNode)
|
|||
|
||||
appendStringInfo(logMessage, "[Backend Query: %s]", backendQuery);
|
||||
}
|
||||
else if (
|
||||
gpid &&
|
||||
ExtractNodeIdFromGlobalPID(gpid, gpidMissingOk) == GetLocalNodeId()
|
||||
)
|
||||
{
|
||||
int pid = ExtractProcessIdFromGlobalPID(gpid);
|
||||
const char *backendQuery =
|
||||
pgstat_get_backend_current_activity(pid, false);
|
||||
|
||||
appendStringInfo(logMessage, "[Backend Query: %s]", backendQuery);
|
||||
}
|
||||
|
||||
LogDistributedDeadlockDebugMessage(logMessage->data);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue