Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问下这里的BarrierID是做什么用的呢? #35

Closed
lanlanlanlanlanchengzhu opened this issue Sep 25, 2021 · 3 comments
Closed

Comments

@lanlanlanlanlanchengzhu

image

@yedf2
Copy link
Contributor

yedf2 commented Sep 25, 2021

dtm可以支持一个服务访问多个数据源,只需要吧每个数据源的访问放在一个barrier.Call里面即可

这个barrierId就是为了给每个Call分配一个新的id,避免唯一键冲突

@cometwk
Copy link

cometwk commented Nov 5, 2021

这里 originAffected 的 insert 语句, 这样处理,更合适???

if ti.BranchType == BranchCancel || ti.BranchType == BranchCompensate {
  // 放在这里,  更合适???
  originAffected, _ := insertBarrier(tx, ti.TransType, ti.Gid, ti.BranchID, originType, bid, ti.BranchType)
  if  originAffected > 0 {
    return
  }
}

@yedf2
Copy link
Contributor

yedf2 commented Nov 5, 2021

如果收到重复的cancel,那么你的这种处理不够完善

这里 originAffected 的 insert 语句, 这样处理,更合适???

if ti.BranchType == BranchCancel || ti.BranchType == BranchCompensate {
  // 放在这里,  更合适???
  originAffected, _ := insertBarrier(tx, ti.TransType, ti.Gid, ti.BranchID, originType, bid, ti.BranchType)
  if  originAffected > 0 {
    return
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants