[ 
https://issues.apache.org/jira/browse/SCB-805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Willem Jiang reassigned SCB-805:
--------------------------------

    Assignee: Jeremy Xu

> 当alpha与omega所在节点的时间不同步时,分布式事务会被异常aborted
> ----------------------------------------
>
>                 Key: SCB-805
>                 URL: https://issues.apache.org/jira/browse/SCB-805
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Saga
>    Affects Versions: saga-0.2.0
>            Reporter: Jeremy Xu
>            Assignee: Jeremy Xu
>            Priority: Minor
>             Fix For: saga-0.3.0
>
>
> RT, 
> 当alpha与omega所在节点的时间不同步时,分布式事务会被异常aborted。检查代码发现alpha侧创建TxEvent时用到了omega侧传过来的时间戳。
> {code:java}
> @Override
> public void onTxEvent(GrpcTxEvent message, StreamObserver<GrpcAck> 
> responseObserver) {
>   boolean ok = txConsistentService.handle(new TxEvent(
>       message.getServiceName(),
>       message.getInstanceId(),
>       new Date(message.getTimestamp()),  // 这里用到了omega侧传过来的时间戳
>       message.getGlobalTxId(),
>       message.getLocalTxId(),
>       message.getParentTxId().isEmpty() ? null : message.getParentTxId(),
>       message.getType(),
>       message.getCompensationMethod(),
>       message.getTimeout(),
>       message.getRetryMethod(),
>       message.getRetries(),
>       message.getPayloads().toByteArray()
>   ));{code}
>  
> 这里感觉可以直接用收到TxEvent的时间,即*new Date()*即可。



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to