apache / apache/incubator-seata

seata Version类问题

Open
#3,456 4 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

seata 源码版本:1.4.0
`io.seata.core.protocol.Version`类存储了当前 seata 版本信息,主要是为了进行TM/RM 版本的校验,该类内部有一个属性:
```java
/**
* The constant VERSION_MAP.
*/
public static final Map VERSION_MAP = new ConcurrentHashMap<>();
```
关于该属性,有以下疑问:
1. VERSION_MAP属性 put 后并未有对应的清除逻辑,key 为 channel 的 ip:port 信息,随着TC 服务运行时间增加,该属性数据会越来越多,占用内存,是否应该在 channel 断开时 remove?
2. VERSION_MAP属性 put 后目前源码中并未使用,当前Version类主要是为了校验TM/RM 版本,是否有必要记录channel+对应的 version 信息呢?

麻烦解答下,谢谢。

Contributor guide

Open the contributing guide

Research direction

Start with the io.seata.core.protocol.Version class and trace every VERSION_MAP put site, then inspect the channel disconnect lifecycle. Determine whether entries are removed and whether the stored channel-version data has a current consumer; done means documenting the decision or defining the required cleanup and usage changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.