apache / apache/incubator-seata

修复TCC模式远程RPC类型的TCC接口资源注册

Open
#4,342 0 comments 0 reactions 0 assignees View on GitHub
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模式如果使用远程RPC类型的TCC接口,防悬挂功能将无法使用。

使用类似 Dubbo 远程 RPC 协议的形式定义TCC接口,那么调用方和发起方会不在同一个服务中,即一阶段和二阶段不在同一个服务操作,那么就无法使用 fence 库记录并处理。
![](https://gitee.com/objcoding/md-picture/raw/master/img/20220120111421.png)

1、目前的资源注册逻辑比较混乱的,尤其是TCCBeanParserUtils#isTccAutoProxy这个方法逻辑,如果想要将远程rpc类型TCC接口的一阶段放在参与者中进行代理拦截,我想到一个改动量最小的方案(但不是最优的),就是将远程rpc解析类复写isRemoting方法,将其改为只有提供方才返回true,这样就避免了消费方也去解析资源。

2、可以新建一个用于防悬挂的代理拦截,如果是发起方,则代理拦截TCC一阶段。

### Ⅱ. 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 :
- Seata version:
- OS :
- Others:

Contributor guide

Open the contributing guide

Research direction

Start with TCCBeanParserUtils#isTccAutoProxy and the remote RPC parsing logic described in the issue, then trace how the fence library records TCC resources. Confirm how provider and consumer services currently register and intercept the first phase. Done means remote RPC TCC calls support anti-hanging protection without incorrectly registering the consumer side.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.