Hi, Zhang

Now Alpha side have a timeout mechanism to avoid this happen.
If a global transaction have exceeded timeout setting, alpha will send 
compensation command to terminate this transaction.
We also consider about writing event log in omega side to reduce complexity of 
alpha side.


------------------
Zhao Jun
Apache Sharding-Sphere & ServiceComb


> On Jan 8, 2019, at 3:58 PM, Longchun Zhang <longc...@gmail.com> wrote:
> 
> Hi guys,
> 
> 
> 
> Recently I am reading the TCC implementation.
> 
> 
> 
> Current implementation is: In the try phase, embedded Omega agent will send
> a try participate request to alpha server ‘after’ done the try operation.
> And then in the final phase Alpha will use the participate information to
> do confirm or cancel operation.
> 
> 
> 
> There is a race condition here: If the omega crashed ‘before’ sending
> participate request, and left garbage in the system, Alpha server will do
> nothing about this Omega agent because Alpha server haven’t any information
> about this participate Omega.
> 
> 
> 
> To avoid this condition, I suggest that Omega agent send participate
> request ‘before’ do the business operation. Alpha will get enough
> information to cancel this operation even when the Omega crashed.
> 
> 
> 
> What do you guys think about it?

Reply via email to