dtx-remote.log

主要记录 Client 端与 Server 端的 RPC 请求日志,包括 Client 端与 Server 端建立 TCP 连接,Client 端注册信息、鉴权信息、上报事务日志信息等。

路径/home/admin/logs/dtxserver/dtx-remote.log

记录主事务上传事务开始日志

日志格式start BusinessActivity, activityRequest:” + ActivityRequest

示例

start BusinessActivity, activityRequest:
{   
//应用名称
"appName": "bff-xxxx",
//业务ID
"bizId": "221869310xxxx",
//发起方标识
"bizType": "transfer_by_tcc",
//客户端IP
"clientIp": "10.10.0.xxx:50034",
//事务上下文信息
"context": "{\"start-time\":1619439759205,\"bizType\":\"transfer_by_tcc\",\"tracerInfo\":\"tcid=0a0a00bd16194397591765601e8166&spid=0.1.4&pspid=0.1&sample=true&\",\"dataCenter\":\"cn-xxxx-finance-h\",\"zone\":\"RZ00A\",\"appName\":\"bff-account\",\"bizId\":\"221869310\",\"rpcId\":\"0.1.4\",\"isLdcMode\":true,\"host-name\":\"10.10.0.xxx\",\"shardingKey\":\"22\",\"tracerId\":\"0a0a00bd16194397591765601e8166\"}",
//业务实例ID
"instanceId": "EKHAK9xxxxx",
//事务状态
"state": "U",
//超时时间
"timeout": 30,
//事务ID
"txId": "370c6843c30740249302.22-0000000000-221869310"
}

记录创建主事务失败日志

日志格式create new activity record failed,txId:" + activityId.getTxId() + ", instanceId" + instanceId + ", appName:" + appName

示例

create new activity record failed,txId:370c6843c30740249302.22-0000000000-221869310, instanceId EKHAK9xxxxx , appName:bff-xxxx

记录分支事务上传事务开始日志

日志格式start businessAction, actionRequest:" + ActionRequest

示例

start businessAction, actionRequest:
{
//分支事务ID 
"actionId": "7898f69496424911be7309d7f9f134de",
//分支事务上下文信息
"context": "{\"sys::rollback_method\":\"dtxRollbackOne\",\"bizType\":\"ROLLBACK_FAILED\",\"tracerInfo\":\"tcid=ac191f141619593402896101722948&spid=0&pspid=&sample=true&\",\"dataCenter\":\"\",\"appName\":\"ant-cloud-quality-dtxtest\",\"sys::commit_method\":\"dtxCommitOne\",\"isLdcMode\":false,\"host-name\":\"172.25.31.20\",\"action-start-time\":1619593403024,\"sys::prepare\":\"dtxPrepare\",\"zone\":\"\",\"rpcId\":\"0\",\"sys::class_name\":\"com.alipay.antcloud.service.DtxOneAction\",\"actionName\":\"dtxOneAction\",\"tracerId\":\"ac191f141619593402896101722948\"}",
//实例ID
"instanceId": "NCCI0DCxxxx",
//资源ID
"resourceId": "SOFABOOT_RPC&dtxOneAction&&",
//资源类型
"resourceType": 2,
//分支事务状态
"state": "I",
//事务ID
"txId": "12f02cc7de84442ca402-0000000000"
}

记录创建分支事务失败日志

日志格式create new action record failed,actionRequest:" + ActionRequest

示例

create new action record failed,actionRequest:
{
//分支事务ID 
"actionId": "7898f69496424911be7309d7f9f134de",
//分支事务上下文信息
"context": "{\"sys::rollback_method\":\"dtxRollbackOne\",\"bizType\":\"ROLLBACK_FAILED\",\"tracerInfo\":\"tcid=ac191f141619593402896101722948&spid=0&pspid=&sample=true&\",\"dataCenter\":\"\",\"appName\":\"ant-cloud-quality-dtxtest\",\"sys::commit_method\":\"dtxCommitOne\",\"isLdcMode\":false,\"host-name\":\"172.25.31.20\",\"action-start-time\":1619593403024,\"sys::prepare\":\"dtxPrepare\",\"zone\":\"\",\"rpcId\":\"0\",\"sys::class_name\":\"com.alipay.antcloud.service.DtxOneAction\",\"actionName\":\"dtxOneAction\",\"tracerId\":\"ac191f141619593402896101722948\"}",
//实例ID
"instanceId": "NCCI0DCxxxx",
//资源ID
"resourceId": "SOFABOOT_RPC&dtxOneAction&&",
//资源类型
"resourceType": 2,
//分支事务状态
"state": "I",
//事务ID
"txId": "12f02cc7de84442ca402-0000000000"
}

记录二阶段执行完成以后,更新主事务状态成功日志

日志格式update activity record state to [ " + (isCommit?"commit":"rollback") + " ] success, txId:" + txId + ", instanceId:" + instanceId

示例

update activity record state to [ commit ] success, txId:12f02cc7de84442ca402-0000000000, instanceId:NCCI0DCxxxx

记录二阶段执行完成以后,更新主事务状态失败日志

日志格式update activity record failed,txId:" + txId + ", instanceId:" + instanceId, e

示例

update activity record failed,txId:12f02cc7de84442ca402-0000000000, instanceId: NCCI0DCxxxx
com.alipay.dtx.server.common.exception.DtxException: null 
at com.alipay.dtx.server.remote.manager.impl.DtxClientResourceManagerImpl.doAccessPermission(DtxClientResourceManagerImpl.java:207) 
at com.alipay.dtx.server.remote.manager.impl.DtxClientResourceManagerImpl.addConnection(DtxClientResourceManagerImpl.java:119) 
.......

记录二阶段执行状态日志

日志格式transaction handle finish,txId:" + txId + ", tenant:" + instanceId + ", result:" + (isDone ? "success" : "failed")

示例

transaction handle finish,txId:12f02cc7de84442ca402-0000000000, tenant:NCCI0DCxxxx, result:success