Skip to content

Commit

Permalink
Merge branch '2.x' into dev-register-fail-reason
Browse files Browse the repository at this point in the history
  • Loading branch information
Bughue authored Mar 6, 2025
2 parents 559fcce + b530e30 commit cbe4e1c
Show file tree
Hide file tree
Showing 77 changed files with 1,938 additions and 217 deletions.
11 changes: 11 additions & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7037](https://github.com/apache/incubator-seata/pull/7037)] support fury undolog parser
- [[#7069](https://github.com/apache/incubator-seata/pull/7069)] Raft cluster mode supports address translation
- [[#7038](https://github.com/apache/incubator-seata/pull/7038)] support fury serializer
- [[#7157](https://github.com/apache/incubator-seata/pull/7157)] migrate the console to the naming server
- [[#7114](https://github.com/apache/incubator-seata/pull/7114)] support raft mode registry to namingserver
- [[#7133](https://github.com/apache/incubator-seata/pull/7133)] Implement scheduled handling for end status transaction
- [[#7171](https://github.com/apache/incubator-seata/pull/7171)] support EpollEventLoopGroup in client
- [[#7182](https://github.com/apache/incubator-seata/pull/7182)] use the ip of the peerId as the host of the raft node
- [[#7181](https://github.com/apache/incubator-seata/pull/7181)] raft implements domain name resolution and selects peerId


### bugfix:

Expand All @@ -22,6 +27,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7135](https://github.com/apache/incubator-seata/pull/7135)] treating a unique index conflict during rollback as a dirty write
- [[#7150](https://github.com/apache/incubator-seata/pull/7150)] The time difference between the raft node and the follower node cannot synchronize data
- [[#7102](https://github.com/apache/incubator-seata/pull/7150)] bugfix: modify XA mode pre commit transaction from commit phase to before close phase
- [[#7188](https://github.com/apache/incubator-seata/pull/7188)] bugfix: Fix missing branchType in BusinessActionContext

### optimize:

Expand All @@ -30,6 +36,8 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7075](https://github.com/apache/incubator-seata/pull/7075)] fast fail when channel is null
- [[#7089](https://github.com/apache/incubator-seata/pull/7089)] support instance registration to the registry center
- [[#7093](https://github.com/apache/incubator-seata/pull/7093)] add a test workflow for JDK 21
- [[#7088](https://github.com/apache/incubator-seata/pull/7088)] expand english abbreviations to full words
- [[#7064](https://github.com/apache/incubator-seata/pull/7064)] remove unnecessary null checks
- [[#7130](https://github.com/apache/incubator-seata/pull/7130)] Expose some keepalive-related configuration for Druid, Hikari, and DBCP
- [[#7131](https://github.com/apache/incubator-seata/pull/7131)] Remove org.codehaus.jackson dependency
- [[#7134](https://github.com/apache/incubator-seata/pull/7134)] upgrade tomcat-embed to 9.0.98
Expand All @@ -39,6 +47,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7142](https://github.com/apache/incubator-seata/pull/7142)] upgrade commons-compress to 1.27.1
- [[#7149](https://github.com/apache/incubator-seata/pull/7149)] Fix abnormal character display issues in ./distribution/NOTICE.md
- [[#7170](https://github.com/apache/incubator-seata/pull/7170)] Optimize seata client I/O processing by adjusting thread count
- [[#7179](https://github.com/apache/incubator-seata/pull/7179)] Use shared EventLoop for TM and RM clients to reduce thread overhead and improve performance


### security:
Expand All @@ -55,6 +64,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7098](https://github.com/apache/incubator-seata/pull/7098)] Add unit tests for the `seata-common` module
- [[#7160](https://github.com/apache/incubator-seata/pull/7160)] Refactored tests in `LowerCaseLinkHashMapTest` to use parameterized unit testing
- [[#7167](https://github.com/apache/incubator-seata/pull/7167)] Refactored tests in `DurationUtilTest` to simplify and use parameterized unit testing
- [[#7189](https://github.com/apache/incubator-seata/pull/7189)] fix the runtime exception in the saga test case

### refactor:

Expand All @@ -72,6 +82,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [PeppaO](https://github.com/PeppaO)
- [xjlgod](https://github.com/xjlgod)
- [funky-eyes](https://github.com/funky-eyes)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)
- [psxjoy](https://github.com/psxjoy)
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
- [wxrqforever](https://github.com/wxrqforever)
Expand Down
12 changes: 12 additions & 0 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
- [[#7037](https://github.com/apache/incubator-seata/pull/7037)] 支持UndoLog的fury序列化方式
- [[#7069](https://github.com/apache/incubator-seata/pull/7069)] Raft集群模式支持地址转换
- [[#7038](https://github.com/apache/incubator-seata/pull/7038)] 支持Fury序列化器
- [[#7157](https://github.com/apache/incubator-seata/pull/7157)] 将console迁移至namingserver中
- [[#7114](https://github.com/apache/incubator-seata/pull/7114)] 支持raft集群注册至namingserver
- [[#7133](https://github.com/apache/incubator-seata/pull/7133)] 实现对残留的end状态事务定时处理
- [[#7171](https://github.com/apache/incubator-seata/pull/7171)] 客户端支持 EpollEventLoopGroup
- [[#7182](https://github.com/apache/incubator-seata/pull/7182)] 采用peerId的ip作为raft节点的host
- [[#7181](https://github.com/apache/incubator-seata/pull/7181)] raft实现域名解析并选择peerId


### bugfix:

Expand All @@ -22,6 +27,8 @@
- [[#7135](https://github.com/apache/incubator-seata/pull/7135)] 回滚时遇到唯一索引冲突视为脏写
- [[#7150](https://github.com/apache/incubator-seata/pull/7150)] raft节点之前时间差,follower节点无法同步数据
- [[#7102](https://github.com/apache/incubator-seata/pull/7150)] 将XA模式预提交事务从提交阶段修改为关闭前阶段
- [[#7188](https://github.com/apache/incubator-seata/pull/7188)] 修复 BusinessActionContext 中缺少的 branchType


### optimize:

Expand All @@ -30,6 +37,8 @@
- [[#7075](https://github.com/apache/incubator-seata/pull/7075)] 当channel为空时,快速失败,以便于减少不必要的等待
- [[#7089](https://github.com/apache/incubator-seata/pull/7089)] 新增instance注册到注册中心的接口
- [[#7093](https://github.com/apache/incubator-seata/pull/7093)] 增加jdk21的工作流测试
- [[#7088](https://github.com/apache/incubator-seata/pull/7088)] 将日志中英文缩写改为全拼
- [[#7064](https://github.com/apache/incubator-seata/pull/7064)] 移除不必要的空校验
- [[#7130](https://github.com/apache/incubator-seata/pull/7130)] 暴漏一些关于Druid, Hikari, 和DBCP的保活配置项
- [[#7131](https://github.com/apache/incubator-seata/pull/7131)] 移除 org.codehaus.jackson 依赖
- [[#7134](https://github.com/apache/incubator-seata/pull/7134)] 升级 tomcat-embed 至 9.0.98 版本
Expand All @@ -39,6 +48,7 @@
- [[#7142](https://github.com/apache/incubator-seata/pull/7142)] 升级 commons-compress 至 1.27.1 版本
- [[#7149](https://github.com/apache/incubator-seata/pull/7149)] 修复./distribution/NOTICE.md文件中的异常字符串显示问题
- [[#7170](https://github.com/apache/incubator-seata/pull/7170)] 通过调整线程数优化 Seata 客户端 I/O 处理
- [[#7179](https://github.com/apache/incubator-seata/pull/7179)] 使用共享的 EventLoop 来减少 TM 和 RM 客户端的线程开销并提高性能


### security:
Expand All @@ -55,6 +65,7 @@
- [[#7098](https://github.com/apache/incubator-seata/pull/7098)] 增加 `seata-common` 模块的测试用例
- [[#7160](https://github.com/apache/incubator-seata/pull/7160)] 在 LowerCaseLinkHashMapTest 中重构测试,以使用参数化单元测试
- [[#7167](https://github.com/apache/incubator-seata/pull/7167)] 重构了 DurationUtilTest 中的测试,以简化并使用参数化单元测试
- [[#7189](https://github.com/apache/incubator-seata/pull/7189)] 修复saga测试用例运行异常

### refactor:

Expand All @@ -72,6 +83,7 @@
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
- [PeppaO](https://github.com/PeppaO)
- [funky-eyes](https://github.com/funky-eyes)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)
- [psxjoy](https://github.com/psxjoy)
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
- [wxrqforever](https://github.com/wxrqforever)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,11 @@ public interface ConfigurationKeys {
*/
String WORKER_THREAD_SIZE = THREAD_FACTORY_PREFIX + "workerThreadSize";

/**
* The constant ENABLE_SHARED_EVENTLOOP
*/
String ENABLE_CLIENT_SHARED_EVENTLOOP = TRANSPORT_PREFIX + "enableClientSharedEventLoopGroup";

/**
* The constant SHUTDOWN_PREFIX
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public interface DefaultValues {
*/
@Deprecated
boolean DEFAULT_ENABLE_CLIENT_BATCH_SEND_REQUEST = true;
/**
* The constant DEFAULT_ENABLE_CLIENT_USE_SHARED_EVENT_LOOP.
*/
boolean DEFAULT_ENABLE_CLIENT_USE_SHARED_EVENT_LOOP = false;
/**
* The constant DEFAULT_ENABLE_TM_CLIENT_BATCH_SEND_REQUEST.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

Expand All @@ -44,6 +46,10 @@ public static Instance getInstance() {
return SingletonHolder.SERVER_INSTANCE;
}

public static List<Instance> getInstances() {
return SingletonHolder.SERVER_INSTANCES;
}


public String getNamespace() {
return namespace;
Expand Down Expand Up @@ -164,8 +170,24 @@ public String toJsonString(ObjectMapper objectMapper) {
}
}

public Instance clone() {
Instance instance = new Instance();
instance.setNamespace(namespace);
instance.setClusterName(clusterName);
instance.setUnit(unit);
instance.setControl(control);
instance.setTransaction(transaction);
instance.setWeight(weight);
instance.setHealthy(healthy);
instance.setTerm(term);
instance.setTimestamp(timestamp);
instance.setMetadata(metadata);
return instance;
}

private static class SingletonHolder {
private static final Instance SERVER_INSTANCE = new Instance();
private static final List<Instance> SERVER_INSTANCES = new ArrayList<>();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class Node {

private Endpoint internal;

private double weight = 1.0;
private boolean healthy = true;
private long timeStamp;
protected double weight = 1.0;
protected boolean healthy = true;
protected long timeStamp;

private String group;
private ClusterRole role = ClusterRole.MEMBER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@


public class NamingServerNode extends Node {
private double weight = 1.0;
private boolean healthy = true;
private long term;
private String unit;

Expand Down
25 changes: 25 additions & 0 deletions common/src/main/java/org/apache/seata/common/util/NetUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.List;
import java.util.ArrayList;


/**
Expand Down Expand Up @@ -367,4 +369,27 @@ private static String removeBrackets(String str) {
}
return str.replaceAll("[\\[\\]]", "");
}

public static List<String> getHostByName(String ipOrDomain) {
if (ipOrDomain == null) {
return null;
}
List<String> ipAddressList = new ArrayList<>();
if (isValidIPv4(ipOrDomain) || isValidIPv6(ipOrDomain)) {
ipAddressList.add(ipOrDomain);
return ipAddressList;
} else {
try {
InetAddress[] allByName = InetAddress.getAllByName(ipOrDomain);
for (InetAddress address : allByName) {
ipAddressList.add(address.getHostAddress());
}
return ipAddressList;
} catch (UnknownHostException e) {
LOGGER.warn("Failed to resolve ip address, {}", e.getMessage());
ipAddressList.add(ipOrDomain);
return ipAddressList;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const enUs: ILocale = {
subTitle: 'list',
createTimeLabel: 'CreateTime',
selectFilerPlaceholder: 'Please select filter criteria',
selectNamespaceFilerPlaceholder: 'Please select namespace',
selectClusterFilerPlaceholder: 'Please select cluster',
selectVGroupFilerPlaceholder: 'Please select vgroup',
inputFilterPlaceholder: 'Please enter filter criteria',
branchSessionSwitchLabel: 'Whether to include branch sessions',
resetButtonLabel: 'Reset',
Expand All @@ -77,6 +80,9 @@ const enUs: ILocale = {
subTitle: 'list',
createTimeLabel: 'CreateTime',
inputFilterPlaceholder: 'Please enter filter criteria',
selectNamespaceFilerPlaceholder: 'Please select namespace',
selectClusterFilerPlaceholder: 'Please select cluster',
selectVGroupFilerPlaceholder: 'Please select vgroup',
resetButtonLabel: 'Reset',
searchButtonLabel: 'Search',
operateTitle: 'operate',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const zhCn: ILocale = {
subTitle: '基础列表页',
createTimeLabel: '创建时间',
selectFilerPlaceholder: '请选择筛选条件',
selectNamespaceFilerPlaceholder: '请选择命名空间',
selectClusterFilerPlaceholder: '请选择集群',
selectVGroupFilerPlaceholder: '请选择事务分组',
inputFilterPlaceholder: '请输入筛选条件',
branchSessionSwitchLabel: '是否包含分支事务',
resetButtonLabel: '重置',
Expand All @@ -77,6 +80,9 @@ const zhCn: ILocale = {
subTitle: '基础列表页',
createTimeLabel: '创建时间',
inputFilterPlaceholder: '请输入筛选条件',
selectNamespaceFilerPlaceholder: '请选择命名空间',
selectClusterFilerPlaceholder: '请选择集群',
selectVGroupFilerPlaceholder: '请选择事务分组',
resetButtonLabel: '重置',
searchButtonLabel: '搜索',
operateTitle: '操作',
Expand Down
Loading

0 comments on commit cbe4e1c

Please sign in to comment.