apache / apache/incubator-seata
分支注册时,rpc超时导致branch、lock表中有脏数据遗留
- 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
在分支进行注册时,server端数据库卡顿等原因造成 client端 RPC 超时。client端执行回滚逻辑,本次全局事务结束。但server端网络恢复、数据库响应。导致分支注册成功,遗留脏数据。
### Ⅱ. Describe what happened
压测过程中,server端压力较大,client端rpc等待超时回滚,server数据库恢复,继续执行注册任务,造成脏数据遗留。
复现的话,可以在 [这里](https://github.com/seata/seata/blob/04d0568c0e89fd77c5a8c22a9d39025a0be41051/server/src/main/java/io/seata/server/coordinator/AbstractCore.java#L77)增加一个断点,等待client端rpc超时,回滚完成后放开断点。表中就会有脏数据残留
### Ⅲ. Describe what you expected to happen
有没有比较优雅的解决办法。
### Ⅳ. How to reproduce it (as minimally and precisely as possible)
1. 在server端做一个集群的GlobalSession悲观锁。这消耗很大。
有没有什么好的解决办法呢?
### Ⅴ. Anything else we need to know?
### Ⅵ. Environment:
- JDK version :
- OS :
- Others:
Contributor guide
Research direction
Start at server/src/main/java/io/seata/server/coordinator/AbstractCore.java around line 77 and reproduce the reported pause until the client RPC times out, rolls back, and the server resumes. Trace how branch registration interacts with the branch and lock tables, then determine what cleanup or concurrency behavior prevents leftover data; the issue provides no specific test file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100