apache / apache/incubator-seata

global transaction conflicts with the timed supplement task at commit time

Open
#3,605 1 comment 0 reactions 1 assignee Claimed by @springlayer View on GitHub
task: help-wanted
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.

### Ⅰ. Issue Description
当全局事务决议为提交时,且由于有tcc事务的存在,会让tcc事务进行同步提交,此时tcc的二阶段的confirm可能有大量数据需要操作,且分支众多,容易与异步提交并补偿提交失败的事务的定时任务发生资源抢占问题,需要优化.
暂时想到的优化方式为:
1.在globalsession状态更改为committed时,进行对这个globalsession的数据for update,再进行判断数据是否存在,存在再进行修改,如果不存在就说明被处理过了直接返回true即可
2.在globalsession执行end时不关注其delete结果,如果delete出现问题,比如数据库宕机,此时事务的状态肯定已经走完了changeStatus,所以如果删除失败,TC的定时任务会补偿这个删除失败的事务,所以删除结果并不重要
如果更好的方式,欢迎在此issue留言讨论

### Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

```
Just paste your stack trace here!
```

### Ⅲ. Describe what you expected to happen

### Ⅳ. How to reproduce it (as minimally and precisely as possible)

1. xxx
2. xxx
3. xxx

### Ⅴ. Anything else we need to know?

### Ⅵ. Environment:

- JDK version :
- OS :
- Others:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.