Skip to content

Commit

Permalink
Merge branch '2.x' of https://github.com/seata/seata into dev-2024-un…
Browse files Browse the repository at this point in the history
…dolog-del

# Conflicts:
#	changes/en-us/2.x.md
#	changes/zh-cn/2.x.md
  • Loading branch information
Bughue committed Dec 4, 2024
2 parents 628c965 + 6cdb847 commit 3e3f5da
Show file tree
Hide file tree
Showing 128 changed files with 4,253 additions and 1,007 deletions.
5 changes: 5 additions & 0 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@
<artifactId>seata-saga-spring</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-annotation</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-all</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@
<artifactId>seata-saga-engine-store</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-annotation</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-sqlparser-core</artifactId>
Expand Down
1 change: 1 addition & 0 deletions build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
<image.tags>latest</image.tags>

<dependencies.copy.skip>true</dependencies.copy.skip>
<mysql.copy.skip>true</mysql.copy.skip>
</properties>

<build>
Expand Down
26 changes: 22 additions & 4 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6864](https://github.com/apache/incubator-seata/pull/6864)] support shentong database
- [[#6974](https://github.com/apache/incubator-seata/pull/6974)] support fastjson2 undolog parser
- [[#6992](https://github.com/apache/incubator-seata/pull/6992)] support grpc serializer
- [[#6973](https://github.com/apache/incubator-seata/pull/6973)] support saga annotation
- [[#6926](https://github.com/apache/incubator-seata/pull/6926)] support ssl communication for raft nodes


### bugfix:
Expand All @@ -25,7 +27,11 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6984](https://github.com/apache/incubator-seata/pull/6984)] support building docker image on openjdk23
- [[#6994](https://github.com/apache/incubator-seata/pull/6994)] fix the problem of building undoLog exception when update join does not update data
- [[#7005](https://github.com/apache/incubator-seata/pull/7005)] fix the Raft NPE issue caused by two-phase concurrency

- [[#7010](https://github.com/apache/incubator-seata/pull/7010)] fix error while the "context" is key word in DM8 when delete undolog
- [[#7022](https://github.com/apache/incubator-seata/pull/7022)] fix `store.mode` property in `application.raft.example.yml`
- [[#7025](https://github.com/apache/incubator-seata/pull/7025)] fix vGroupMappingManager is NOT init
- [[#7044](https://github.com/apache/incubator-seata/pull/7044)] fix tableMeta refresh after closed
-
### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] remove the branch registration operation of the XA read-only transaction
- [[#6874](https://github.com/apache/incubator-seata/pull/6874)] modify the version to 2.3.0-SNAPSHOT
Expand All @@ -48,14 +54,21 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6993](https://github.com/apache/incubator-seata/pull/6993)] optimize transaction metrics
- [[#6995](https://github.com/apache/incubator-seata/pull/6995)] upgrade outdate npmjs dependencies
- [[#6996](https://github.com/apache/incubator-seata/pull/6996)] optimize lock release logic in AT transaction mode
- [[#6998](https://github.com/apache/incubator-seata/pull/6998)] Skip sending some request if client-version is v0

- [[#7023](https://github.com/apache/incubator-seata/pull/7023)] optimize fail fast, when all server not available
- [[#7027](https://github.com/apache/incubator-seata/pull/7027)] raft mode maintains the reload logic consistent with the file
- [[#6891](https://github.com/apache/incubator-seata/pull/6891)] add StateType Enum
- [[#7040](https://github.com/apache/incubator-seata/pull/7040)] optimize the print info in ConfigurationFactory
- [[#7046](https://github.com/apache/incubator-seata/pull/7046)] remove the dependency conflict for spring-webmvc

### refactor:
- [[#7017](https://github.com/apache/incubator-seata/pull/7017)] remove dependency on seata-server module


### test:
- [[#6869](https://github.com/apache/incubator-seata/pull/6869)] Add unit tests for the `seata-core` module
- [[#6927](https://github.com/apache/incubator-seata/pull/6927)] Add unit tests for the `seata-rocketmq` module
- [[#7018](https://github.com/apache/incubator-seata/pull/7018)] Add unit tests for the `seata-tm` module
- [[#7030](https://github.com/apache/incubator-seata/pull/7030)] Add unit tests for the `seata-common` module

Thanks to these contributors for their code commits. Please report an unintended omission.

Expand All @@ -74,7 +87,12 @@ Thanks to these contributors for their code commits. Please report an unintended
- [xingfudeshi](https://github.com/xingfudeshi)
- [o-jimin](https://github.com/o-jimin)
- [lixingjia77](https://github.com/lixingjia77)

- [whaon](https://github.com/whaon)
- [YvCeung](https://github.com/YvCeung)
- [jsbxyyx](https://github.com/jsbxyyx)
- [lightClouds917](https://github.com/lightClouds917)
- [Muluo-cyan](https://github.com/Muluo-cyan)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)


Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
29 changes: 24 additions & 5 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- [[#6974](https://github.com/apache/incubator-seata/pull/6974)] 支持UndoLog的fastjson2序列化方式
- [[#6992](https://github.com/apache/incubator-seata/pull/6992)] 支持grpc序列化器
- [[#6995](https://github.com/apache/incubator-seata/pull/6995)] 升级过时的 npmjs 依赖
- [[#6973](https://github.com/apache/incubator-seata/pull/6973)] 支持saga注解化
- [[#6926](https://github.com/apache/incubator-seata/pull/6926)] 支持Raft节点间的SSL通信

### bugfix:
- [[#6899](https://github.com/apache/incubator-seata/pull/6899)] 修复file.conf打包后的读取
Expand All @@ -25,7 +27,10 @@
- [[#6984](https://github.com/apache/incubator-seata/pull/6984)] 修复 openjdk23 版本下无法构建 docker 镜像的问题
- [[#6994](https://github.com/apache/incubator-seata/pull/6994)] 修复updateJoin语句未更新到数据时prepareUndoLog异常
- [[#7005](https://github.com/apache/incubator-seata/pull/7005)] 修复Raft模式下两阶段并发可能导致NPE的问题

- [[#7010](https://github.com/apache/incubator-seata/pull/7010)] 修复使用达梦数据库时删除undolog发生SQL语法错误
- [[#7022](https://github.com/apache/incubator-seata/pull/7022)] 修复 `application.raft.example.yml``store.mode`属性
- [[#7025](https://github.com/apache/incubator-seata/pull/7025)] 修复vGroupMappingManager未初始化的问题
- [[#7044](https://github.com/apache/incubator-seata/pull/7044)] 修复TableMeta在数据源关闭后刷新错误问题

### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] 移除只读XA事务的分支注册操作
Expand All @@ -50,16 +55,24 @@
- [[#6991](https://github.com/apache/incubator-seata/pull/6991)] gRPC协议序列化默认值为protobuf
- [[#6996](https://github.com/apache/incubator-seata/pull/6996)] 优化 AT 事务模式锁释放逻辑
- [[#6993](https://github.com/apache/incubator-seata/pull/6993)] 优化 metrics 指标
- [[#6998](https://github.com/apache/incubator-seata/pull/6998)] 当server和v0版本客户端(<0.7.1)通信时,跳过不支持的请求

- [[#6995](https://github.com/apache/incubator-seata/pull/6995)] 升级过时的 npmjs 依赖
- [[#6996](https://github.com/apache/incubator-seata/pull/6996)] 优化 AT 事务模式锁释放逻辑
- [[#7023](https://github.com/apache/incubator-seata/pull/7023)] 优化快速失败
- [[#7027](https://github.com/apache/incubator-seata/pull/7027)] raft模式下reload行为与file保持一致
- [[#6891](https://github.com/apache/incubator-seata/pull/6891)] 增加 StateType 类型
- [[#7040](https://github.com/apache/incubator-seata/pull/7040)] 优化ConfigurationFactory加载的打印信息
- [[#7046](https://github.com/apache/incubator-seata/pull/7046)] 去除spring-webmvc的依赖冲突

### refactor:
- [[#7017](https://github.com/apache/incubator-seata/pull/7017)] 移除 seata-server 模块的依赖


### security:

### test:
- [[#6869](https://github.com/apache/incubator-seata/pull/6869)] 增加`seata-core`测试用例覆盖率
- [[#6927](https://github.com/apache/incubator-seata/pull/6927)] 增加`seata-rocketmq`模块的测试用例
- [[#7018](https://github.com/apache/incubator-seata/pull/7018)] 增加 `seata-tm` 模块的测试用例
- [[#7030](https://github.com/apache/incubator-seata/pull/7030)] 增加 `seata-common` 模块的测试用例


非常感谢以下 contributors 的代码贡献。若有无意遗漏,请报告。

Expand All @@ -78,6 +91,12 @@
- [xingfudeshi](https://github.com/xingfudeshi)
- [o-jimin](https://github.com/o-jimin)
- [lixingjia77](https://github.com/lixingjia77)
- [whaon](https://github.com/whaon)
- [YvCeung](https://github.com/YvCeung)
- [jsbxyyx](https://github.com/jsbxyyx)
- [lightClouds917](https://github.com/lightClouds917)
- [Muluo-cyan](https://github.com/Muluo-cyan)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)


同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,21 @@ public interface ConfigurationKeys {
*/
String SERVER_RAFT = SERVER_PREFIX + "raft.";

/**
* The constant SERVER_RAFT_SSL.
*/
String SERVER_RAFT_SSL = SERVER_RAFT + "ssl.";

/**
* The constant SERVER_RAFT_SSL_CLIENT.
*/
String SERVER_RAFT_SSL_CLIENT = SERVER_RAFT_SSL + "client.";

/**
* The constant SERVER_RAFT_SSL_SERVER.
*/
String SERVER_RAFT_SSL_SERVER = SERVER_RAFT_SSL + "server.";

/**
* The constant SERVER_RAFT_SERVER_ADDR.
*/
Expand Down Expand Up @@ -924,6 +939,42 @@ public interface ConfigurationKeys {
*/
String SERVER_RAFT_SYNC = SERVER_RAFT + "sync";

/**
* The constant SERVER_RAFT_SSL_ENABLED.
*/
String SERVER_RAFT_SSL_ENABLED = SERVER_RAFT_SSL + "enabled";

/**
* The constant SERVER_RAFT_SSL_SERVER_KEYSTORE.
*/
String SERVER_RAFT_SSL_SERVER_KEYSTORE_PATH = SERVER_RAFT_SSL_SERVER + "keystore.path";

/**
* The constant SERVER_RAFT_SSL_CLIENT_KEYSTORE.
*/
String SERVER_RAFT_SSL_CLIENT_KEYSTORE_PATH = SERVER_RAFT_SSL_CLIENT + "keystore.path";

/**
* The constant SERVER_RAFT_SSL_SERVER_KEYSTORE_PASSWORD.
*/
String SERVER_RAFT_SSL_SERVER_KEYSTORE_PASSWORD = SERVER_RAFT_SSL_SERVER + "keystore.password";

/**
* The constant SERVER_RAFT_SSL_CLIENT_KEYSTORE_PASSWORD.
*/
String SERVER_RAFT_SSL_CLIENT_KEYSTORE_PASSWORD = SERVER_RAFT_SSL_CLIENT + "keystore.password";


/**
* The constant SERVER_RAFT_SSL_KEYSTORE_TYPE.
*/
String SERVER_RAFT_SSL_KEYSTORE_TYPE = SERVER_RAFT_SSL + "keystore.type";

/**
* The constant SERVER_RAFT_SSL_KMF_ALGORITHM.
*/
String SERVER_RAFT_SSL_KMF_ALGORITHM = SERVER_RAFT_SSL + "kmf.algorithm";

/**
* The constant SERVER_RAFT_MAX_APPEND_BUFFER_SIZE.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,9 @@ public interface DefaultValues {
* The constant DEFAULT_ROCKET_MQ_MSG_TIMEOUT.
*/
int DEFAULT_ROCKET_MQ_MSG_TIMEOUT = 60 * 1000;

/**
* The constant DEFAULT_RAFT_SSL_ENABLED.
*/
boolean DEFAULT_RAFT_SSL_ENABLED = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.apache.seata.common;

/**
* @funkye
* Lock Strategy Mode
*/
public enum LockStrategyMode {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;

/**
* Reflection tools
Expand Down Expand Up @@ -495,6 +497,34 @@ public static Method getMethod(final Class<?> clazz, final String methodName)
return getMethod(clazz, methodName, EMPTY_CLASS_ARRAY);
}

/**
* Recursively get clazz and their interfaces match matchCondition method-class mapping
*
* @param clazz clazz
* @param matchCondition matchCondition
* @return Set
*/
public static Map<Method, Class<?>> findMatchMethodClazzMap(Class<?> clazz, Predicate<Method> matchCondition) {
Map<Method, Class<?>> methodClassMap = new HashMap<>();

for (Method method : clazz.getMethods()) {
if (matchCondition.test(method)) {
methodClassMap.put(method, clazz);
}
}

Set<Class<?>> interfaceClasses = getInterfaces(clazz);
for (Class<?> interClass : interfaceClasses) {
for (Method method : interClass.getMethods()) {
if (matchCondition.test(method)) {
methodClassMap.put(method, interClass);
}
}
}

return methodClassMap;
}

/**
* invoke Method
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.seata.common.exception;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.UndeclaredThrowableException;

/**
*
*/
class ExceptionUtilTest {

@Test
public void unwrap() {
InvocationTargetException targetException = new InvocationTargetException(new RuntimeException("invocation"));
Assertions.assertInstanceOf(RuntimeException.class, ExceptionUtil.unwrap(targetException));

UndeclaredThrowableException exception = new UndeclaredThrowableException(new RuntimeException("undeclared"));
Assertions.assertInstanceOf(RuntimeException.class, ExceptionUtil.unwrap(exception));

RuntimeException runtimeException = new RuntimeException("runtime");
Assertions.assertInstanceOf(RuntimeException.class, ExceptionUtil.unwrap(runtimeException));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.seata.common.metadata.ClusterRole;
import org.apache.seata.common.metadata.Node;
import org.junit.jupiter.api.Test;

Expand All @@ -33,13 +34,21 @@ class InstanceTest {
void toJsonString() throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
Instance instance = Instance.getInstance();
Map<String,Object> map = new HashMap<>();
Map<String,Object> mmap = new HashMap<>();
mmap.put("k","v");
map.put("k",mmap);
Map<String, Object> map = new HashMap<>();
Map<String, Object> mmap = new HashMap<>();
mmap.put("k", "v");
map.put("k", mmap);
instance.setMetadata(map);
instance.setControl(new Node.Endpoint("1.1.1.1",888));
instance.setTransaction(new Node.Endpoint("2.2.2.2",999));
assertEquals(instance.toJsonString(objectMapper),objectMapper.writeValueAsString(instance));
instance.setNamespace("namespace");
instance.setClusterName("clustername");
instance.setRole(ClusterRole.LEADER);
instance.setUnit("unit");
instance.setWeight(100d);
instance.setHealthy(true);
instance.setTerm(100L);
instance.setTimestamp(System.currentTimeMillis());
instance.setControl(new Node.Endpoint("1.1.1.1", 888));
instance.setTransaction(new Node.Endpoint("2.2.2.2", 999));
assertEquals(instance.toJsonString(objectMapper), objectMapper.writeValueAsString(instance));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ void toJsonString() throws JsonProcessingException {
map.put("k","v");
node.setMetadata(map);
node.setGroup("group");
node.setUnit("unit");
node.setHealthy(true);
node.setTerm(111L);
node.setControl(new Node.Endpoint("1.1.1.1",888));
node.setTransaction(new Node.Endpoint("2.2.2.2",999));
assertEquals(node.toJsonString(objectMapper),objectMapper.writeValueAsString(node));
Expand Down
Loading

0 comments on commit 3e3f5da

Please sign in to comment.