Skip to content

Commit

Permalink
Merge branch '2.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
PeppaO authored Nov 3, 2023
2 parents c483e1f + 773631e commit 3f5a9e8
Show file tree
Hide file tree
Showing 177 changed files with 7,333 additions and 1,093 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# step 2
- name: "Set up QEMU"
id: qemu
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
# step 3
- name: "Build arm-binary"
run: |
Expand Down
5 changes: 5 additions & 0 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
<artifactId>seata-discovery-sofa</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-discovery-raft</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-discovery-zk</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@
<artifactId>seata-discovery-sofa</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-discovery-raft</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-brpc</artifactId>
Expand Down
3 changes: 0 additions & 3 deletions build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@

--add-opens java.sql/java.sql=ALL-UNNAMED
--add-opens java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED

--illegal-access=permit
-Dillegal-access=permit
</maven.surefire.argLine>
</properties>
</profile>
Expand Down
18 changes: 16 additions & 2 deletions changes/en-us/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The version is updated as follows:
- [[#5902](https://github.com/seata/seata/pull/5902)] support IPv6
- [[#5907](https://github.com/seata/seata/pull/5907)] support polardb-x 2.0 in AT mode
- [[#5932](https://github.com/seata/seata/pull/5932)] support Dameng database
- [[#5946](https://github.com/seata/seata/pull/5946)] add sqlserver's adaptation to the console paging interface
- [[#5226](https://github.com/seata/seata/pull/5226)] support raft cluster and store mode

### bugfix:
- [[#5677](https://github.com/seata/seata/pull/5677)] fix saga mode serviceTask inputParams json autoType convert exception
Expand Down Expand Up @@ -77,8 +79,13 @@ The version is updated as follows:
- [[#5835](https://github.com/seata/seata/pull/5835)] bugfix: fix TC retry rollback wrongly, after the XA transaction fail and rollback
- [[#5881](https://github.com/seata/seata/pull/5880)] fix delete branch table unlock failed
- [[#5930](https://github.com/seata/seata/pull/5930)] fix the issue of missing sentinel password in store redis mode
- [[#5958](https://github.com/seata/seata/pull/5958)] required to be unlocked when a re-election occurs in a commit state
- [[#5971](https://github.com/seata/seata/pull/5971)] fix some configurations that are not deprecated show "Deprecated"
- [[#5954](https://github.com/seata/seata/pull/5954)] fix the issue of saved branch session status does not match the actual branch session status

### optimize:
- [[#5966](https://github.com/seata/seata/pull/5966)] decouple saga expression handling and remove evaluator package
- [[#5928](https://github.com/seata/seata/pull/5928)] add Saga statelang semantic validation
- [[#5208](https://github.com/seata/seata/pull/5208)] optimize throwable getCause once more
- [[#5212](https://github.com/seata/seata/pull/5212)] optimize log message level
- [[#5237](https://github.com/seata/seata/pull/5237)] optimize exception log message print(EnhancedServiceLoader.loadFile#cahtch)
Expand Down Expand Up @@ -134,6 +141,9 @@ The version is updated as follows:
- [[#5878](https://github.com/seata/seata/pull/5878)] optimize `httpcore` and `httpclient` dependencies
- [[#5917](https://github.com/seata/seata/pull/5917)] upgrade native-lib-loader version
- [[#5926](https://github.com/seata/seata/pull/5926)] optimize some scripts related to Apollo
- [[#5938](https://github.com/seata/seata/pull/5938)] support jmx port in seata
- [[#5951](https://github.com/seata/seata/pull/5951)] remove un support config in jdk17
- [[#5959](https://github.com/seata/seata/pull/5959)] modify code style and remove unused import

### security:
- [[#5642](https://github.com/seata/seata/pull/5642)] add Hessian Serializer WhiteDenyList
Expand All @@ -142,6 +152,8 @@ The version is updated as follows:
- [[#5805](https://github.com/seata/seata/pull/5805)] fix some serializer vulnerabilities
- [[#5868](https://github.com/seata/seata/pull/5868)] fix npm package vulnerabilities
- [[#5916](https://github.com/seata/seata/pull/5916)] upgrade nodejs dependency
- [[#5942](https://github.com/seata/seata/pull/5942)] upgrade dependencies version
- [[#5987](https://github.com/seata/seata/pull/5987)] upgrade some dependencies version

### test:
- [[#5308](https://github.com/seata/seata/pull/5308)] add unit test [FileLoader, ObjectHolder, StringUtils]
Expand All @@ -156,6 +168,7 @@ The version is updated as follows:
- [[#5893](https://github.com/seata/seata/pull/5893)] remove sofa test cases
- [[#5845](https://github.com/seata/seata/pull/5845)] upgrade druid and add `test-druid.yml`
- [[#5863](https://github.com/seata/seata/pull/5863)] fix unit test in java 21
- [[#5986](https://github.com/seata/seata/pull/5986)] fix zookeeper UT failed


### Contributors:
Expand All @@ -173,7 +186,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [pengten](https://github.com/pengten)
- [wangliang181230](https://github.com/wangliang181230)
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
- [a364176773](https://github.com/a364176773)
- [funky-eyes](https://github.com/funky-eyes)
- [isharpever](https://github.com/isharpever)
- [mxsm](https://github.com/mxsm)
- [liuqiufeng](https://github.com/liuqiufeng)
Expand All @@ -189,7 +202,8 @@ Thanks to these contributors for their code commits. Please report an unintended
- [Weelerer](https://github.com/Weelerer)
- [Ifdevil](https://github.com/Ifdevil)
- [iquanzhan](https://github.com/iquanzhan)

- [leizhiyuan](https://github.com/leizhiyuan)
- [Aruato](https://github.com/Aruato)

Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.

Expand Down
18 changes: 17 additions & 1 deletion changes/zh-cn/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5902](https://github.com/seata/seata/pull/5902)] 支持IPv6网络环境
- [[#5907](https://github.com/seata/seata/pull/5907)] 增加AT模式的PolarDB-X 2.0数据库支持
- [[#5932](https://github.com/seata/seata/pull/5932)] AT模式支持达梦数据库
- [[#5946](https://github.com/seata/seata/pull/5946)] 增加sqlserver对控制台分页接口的适配
- [[#5226](https://github.com/seata/seata/pull/5226)] 支持Raft集群部署和事务存储模式

### bugfix:
- [[#5677](https://github.com/seata/seata/pull/5677)] 修复saga模式下serviceTask入参autoType转化失败问题
Expand Down Expand Up @@ -76,8 +78,13 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5835](https://github.com/seata/seata/pull/5835)] bugfix: 修复当 XA 事务失败回滚后,TC 还会继续重试回滚的问题
- [[#5881](https://github.com/seata/seata/pull/5880)] 修复事务回滚时锁未删除的问题
- [[#5930](https://github.com/seata/seata/pull/5930)] 修复存储为redis哨兵模式下哨兵密码缺失的问题
- [[#5958](https://github.com/seata/seata/pull/5958)] 在二阶段提交状态下发生重选时需要进行解除全局锁
- [[#5971](https://github.com/seata/seata/pull/5971)] 修复某些未弃用的配置显示"已弃用"
- [[#5954](https://github.com/seata/seata/pull/5954)] 修复保存的分支会话状态与实际的分支会话状态不一致的问题

### optimize:
- [[#5966](https://github.com/seata/seata/pull/5966)] Saga 表达式解耦并统一格式
- [[#5928](https://github.com/seata/seata/pull/5928)] 增加Saga模式状态机语义验证阶段
- [[#5208](https://github.com/seata/seata/pull/5208)] 优化多次重复获取Throwable#getCause问题
- [[#5212](https://github.com/seata/seata/pull/5212)] 优化不合理的日志信息级别
- [[#5237](https://github.com/seata/seata/pull/5237)] 优化异常日志打印(EnhancedServiceLoader.loadFile#cahtch)
Expand Down Expand Up @@ -134,6 +141,10 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5878](https://github.com/seata/seata/pull/5878)] 优化 `httpcore``httpclient` 的依赖定义
- [[#5917](https://github.com/seata/seata/pull/5917)] 升级 native-lib-loader 版本
- [[#5926](https://github.com/seata/seata/pull/5926)] 优化一些与 Apollo 相关的脚本
- [[#5938](https://github.com/seata/seata/pull/5938)] 支持 jmx 监控配置
- [[#5951](https://github.com/seata/seata/pull/5951)] 删除在 jdk17 中不支持的配置项
- [[#5959](https://github.com/seata/seata/pull/5959)] 修正代码风格问题及去除无用的类引用


### security:
- [[#5642](https://github.com/seata/seata/pull/5642)] 增加Hessian 序列化黑白名单
Expand All @@ -142,6 +153,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5805](https://github.com/seata/seata/pull/5805)] 修复序列化漏洞
- [[#5868](https://github.com/seata/seata/pull/5868)] 修复npm package漏洞
- [[#5916](https://github.com/seata/seata/pull/5916)] 修复npm package漏洞
- [[#5942](https://github.com/seata/seata/pull/5942)] 升级依赖版本
- [[#5987](https://github.com/seata/seata/pull/5987)] 升级依赖版本

### test:
- [[#5308](https://github.com/seata/seata/pull/5308)] 添加单元测试用例 [FileLoader, ObjectHolder, StringUtils]
Expand All @@ -156,6 +169,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5893](https://github.com/seata/seata/pull/5893)] 移除 sofa 测试用例
- [[#5845](https://github.com/seata/seata/pull/5845)] 升级 `druid` 版本,并添加 `test-druid.yml` 用于测试seata与druid各版本的兼容性。
- [[#5863](https://github.com/seata/seata/pull/5863)] 修复单元测试在Java21下无法正常运行的问题。
- [[#5986](https://github.com/seata/seata/pull/5986)] 修复 zookeeper 单测失败问题

### Contributors:

Expand All @@ -172,7 +186,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [pengten](https://github.com/pengten)
- [wangliang181230](https://github.com/wangliang181230)
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
- [a364176773](https://github.com/a364176773)
- [funky-eyes](https://github.com/funky-eyes)
- [isharpever](https://github.com/isharpever)
- [mxsm](https://github.com/mxsm)
- [liuqiufeng](https://github.com/liuqiufeng)
Expand All @@ -188,6 +202,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [Weelerer](https://github.com/Weelerer)
- [Ifdevil](https://github.com/Ifdevil)
- [iquanzhan](https://github.com/iquanzhan)
- [leizhiyuan](https://github.com/leizhiyuan)
- [Aruato](https://github.com/Aruato)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

Expand Down
81 changes: 81 additions & 0 deletions common/src/main/java/io/seata/common/ConfigurationKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ public interface ConfigurationKeys {
*/
String SERVER_SERVICE_PORT_CAMEL = SERVER_PREFIX + "servicePort";

/**
* The constant SERVER_RAFT_PORT.
*/
String SERVER_RAFT_PORT_CAMEL = SERVER_PREFIX + "raftPort";

/**
* The constant SERVER_SERVICE_PORT_CONFIG.
*/
Expand Down Expand Up @@ -866,6 +871,81 @@ public interface ConfigurationKeys {
*/
String ENABLE_BRANCH_ASYNC_REMOVE = SERVER_PREFIX + SESSION_PREFIX + "enableBranchAsyncRemove";

/**
* The constant SERVER_RAFT.
*/
String SERVER_RAFT = SERVER_PREFIX + "raft.";

/**
* The constant SERVER_RAFT_SERVER_ADDR.
*/
String SERVER_RAFT_SERVER_ADDR = SERVER_RAFT + "serverAddr";

/**
* The constant SERVER_RAFT_GROUP.
*/
String SERVER_RAFT_GROUP = SERVER_RAFT + "group";

/**
* The constant SERVER_RAFT_SNAPSHOT_INTERVAL.
*/
String SERVER_RAFT_SNAPSHOT_INTERVAL = SERVER_RAFT + "snapshotInterval";

/**
* The constant SERVER_RAFT_DISRUPTOR_BUFFER_SIZE.
*/
String SERVER_RAFT_DISRUPTOR_BUFFER_SIZE = SERVER_RAFT + "disruptorBufferSize";

/**
* The constant SERVER_RAFT_MAX_REPLICATOR_INFLIGHT_MSGS.
*/
String SERVER_RAFT_MAX_REPLICATOR_INFLIGHT_MSGS = SERVER_RAFT + "maxReplicatorInflightMsgs";

/**
* The constant SERVER_RAFT_SYNC.
*/
String SERVER_RAFT_SYNC = SERVER_RAFT + "sync";

/**
* The constant SERVER_RAFT_MAX_APPEND_BUFFER_SIZE.
*/
String SERVER_RAFT_MAX_APPEND_BUFFER_SIZE = SERVER_RAFT + "maxAppendBufferSize";

/**
* The constant SERVER_RAFT_APPLY_BATCH.
*/
String SERVER_RAFT_APPLY_BATCH = SERVER_RAFT + "applyBatch";

/**
* The constant SERVER_RAFT_APPLY_BATCH.
*/
String SERVER_RAFT_ELECTION_TIMEOUT_MS = SERVER_RAFT + "electionTimeoutMs";

/**
* The constant SERVER_RAFT_REPORTER_ENABLED.
*/
String SERVER_RAFT_REPORTER_ENABLED = SERVER_RAFT + "reporterEnabled";

/**
* The constant SERVER_RAFT_REPORTER_INITIAL_DELAY.
*/
String SERVER_RAFT_REPORTER_INITIAL_DELAY = SERVER_RAFT + "reporterInitialDelay";

/**
* The constant SERVER_RAFT_SERIALIZATION.
*/
String SERVER_RAFT_SERIALIZATION = SERVER_RAFT + "serialization";

/**
* The constant SERVER_RAFT_COMPRESSOR.
*/
String SERVER_RAFT_COMPRESSOR = SERVER_RAFT + "compressor";

/**
* The constant CLIENT_METADATA_MAX_AGE_MS.
*/
String CLIENT_METADATA_MAX_AGE_MS = CLIENT_PREFIX + "metadataMaxAgeMs";

/**
* The constant IS_USE_CLOUD_NAMESPACE_PARSING.
*/
Expand All @@ -891,6 +971,7 @@ public interface ConfigurationKeys {
*/
String XA_CONNECTION_TWO_PHASE_HOLD_TIMEOUT = CLIENT_RM_PREFIX + "connectionTwoPhaseHoldTimeoutXA";


/**
* The constant ENABLE_PARALLEL_REQUEST_HANDLE_KEY
*/
Expand Down
15 changes: 14 additions & 1 deletion common/src/main/java/io/seata/common/DefaultValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@ public interface DefaultValues {
long DEFAULT_TABLE_META_CHECKER_INTERVAL = 60000L;
boolean DEFAULT_TM_DEGRADE_CHECK = false;
boolean DEFAULT_CLIENT_SAGA_BRANCH_REGISTER_ENABLE = false;

/**
* The default session store dir
*/
String DEFAULT_SESSION_STORE_FILE_DIR = "sessionStore";
boolean DEFAULT_CLIENT_SAGA_RETRY_PERSIST_MODE_UPDATE = false;
boolean DEFAULT_CLIENT_SAGA_COMPENSATE_PERSIST_MODE_UPDATE = false;
String DEFAULT_RAFT_SERIALIZATION = "jackson";
String DEFAULT_RAFT_COMPRESSOR = "none";

/**
* Shutdown timeout default 3s
Expand All @@ -53,7 +60,6 @@ public interface DefaultValues {
boolean DEFAULT_ENABLE_RM_CLIENT_BATCH_SEND_REQUEST = true;
boolean DEFAULT_ENABLE_TC_SERVER_BATCH_SEND_RESPONSE = false;


String DEFAULT_BOSS_THREAD_PREFIX = "NettyBoss";
String DEFAULT_NIO_WORKER_THREAD_PREFIX = "NettyServerNIOWorker";
String DEFAULT_EXECUTOR_THREAD_PREFIX = "NettyServerBizHandler";
Expand Down Expand Up @@ -120,6 +126,8 @@ public interface DefaultValues {
String DEFAULT_LOAD_BALANCE = "XID";
int VIRTUAL_NODES_DEFAULT = 10;

String DEFAULT_SEATA_GROUP = "default";

/**
* the constant DEFAULT_CLIENT_UNDO_COMPRESS_ENABLE
*/
Expand All @@ -135,6 +143,7 @@ public interface DefaultValues {
*/
String DEFAULT_CLIENT_UNDO_COMPRESS_THRESHOLD = "64k";


/**
* the constant DEFAULT_RETRY_DEAD_THRESHOLD
*/
Expand Down Expand Up @@ -203,6 +212,10 @@ public interface DefaultValues {
*/
int DEFAULT_XA_CONNECTION_TWO_PHASE_HOLD_TIMEOUT = 10000;

/**
* the constant DEFAULT_SERVER_RAFT_ELECTION_TIMEOUT_MS
*/
int DEFAULT_SERVER_RAFT_ELECTION_TIMEOUT_MS = 1000;
/**
* the constant DEFAULT_COMMITING_RETRY_PERIOD
*/
Expand Down
54 changes: 54 additions & 0 deletions common/src/main/java/io/seata/common/metadata/ClusterRole.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 1999-2019 Seata.io Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.common.metadata;

/**
* @author funkye
*/
public enum ClusterRole {

/**
* raft mode leader
*/
LEADER(0),
/**
* raft mode follower
*/
FOLLOWER(1),
/**
* raft mode learner
*/
LEARNER(2),
/**
* cluster mode member
*/
MEMBER(3);

private int roleCode;

ClusterRole(int roleCode) {
this.roleCode = roleCode;
}

public int getRoleCode() {
return roleCode;
}

public void setRoleCode(int roleCode) {
this.roleCode = roleCode;
}

}
Loading

0 comments on commit 3f5a9e8

Please sign in to comment.