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
leizhiyuan authored Nov 6, 2023
2 parents 2eb5926 + b883c2c commit 643dbf4
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Build Status](https://github.com/seata/seata/workflows/build/badge.svg?branch=develop)](https://github.com/seata/seata/actions)
[![codecov](https://codecov.io/gh/seata/seata/branch/develop/graph/badge.svg)](https://codecov.io/gh/seata/seata)
[![license](https://img.shields.io/github/license/seata/seata.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![maven](https://img.shields.io/maven-central/v/io.seata/seata-parent?versionSuffix=1.7.0)](https://search.maven.org/search?q=io.seata)
[![maven](https://img.shields.io/maven-central/v/io.seata/seata-parent?versionSuffix=1.8.0)](https://search.maven.org/search?q=io.seata)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/seata/seata.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/seata/seata/context:java)


Expand Down Expand Up @@ -87,7 +87,7 @@ For more details about principle and design, please go to [Seata wiki page](http
Depending on the scenario, choose one of the two dependencies: `io.seata:seata-all` or `io.seata:seata-spring-boot-starter`.
```xml
<properties>
<seata.version>1.7.0</seata.version>
<seata.version>1.8.0</seata.version>
</properties>

<dependencies>
Expand Down
64 changes: 64 additions & 0 deletions changes/en-us/1.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
### 1.8.0

[source](https://github.com/seata/seata/archive/v1.8.0.zip) |
[binary](https://github.com/seata/seata/releases/download/v1.8.0/seata-server-1.8.0.zip)

<details>
<summary><mark>Release notes</mark></summary>


### Seata 1.8.0

Seata 1.8.0 Released.

Seata is an easy-to-use, high-performance, open source distributed transaction solution.

The version is updated as follows:

### feature:
- [[#3672](https://github.com/seata/seata/pull/3672)] support Dameng database
- [[#5892](https://github.com/seata/seata/pull/5892)] support PolarDB-X 2.0 database

### bugfix:
- [[#5833](https://github.com/seata/seata/pull/5833)] bugfix: fix TC retry rollback wrongly, after the XA transaction fail and rollback
- [[#5884](https://github.com/seata/seata/pull/5884)] fix dm escaped characters for upper and lower case column names
- [[#5931](https://github.com/seata/seata/pull/5931)] fix the issue of missing sentinel password in store redis mode
- [[#5970](https://github.com/seata/seata/pull/5970)] fix some configurations that are not deprecated show "Deprecated"

### optimize:
- [[#5866](https://github.com/seata/seata/pull/5866)] some minor syntax optimization
- [[#5889](https://github.com/seata/seata/pull/5889)] remove dependency without license
- [[#5890](https://github.com/seata/seata/pull/5890)] remove 7z format compression support
- [[#5891](https://github.com/seata/seata/pull/5891)] remove mariadb.jdbc dependency
- [[#5828](https://github.com/seata/seata/pull/5828)] fix codecov chart not display
- [[#5927](https://github.com/seata/seata/pull/5927)] optimize some scripts related to Apollo
- [[#5918](https://github.com/seata/seata/pull/5918)] standardized the properties of codecov.yml
- [[#5939](https://github.com/seata/seata/pull/5939)] support jmx port in seata

### security:
- [[#5867](https://github.com/seata/seata/pull/5867)] fix npm package vulnerabilities
- [[#5898](https://github.com/seata/seata/pull/5898)] fix npm package vulnerabilities

### test:
- [[#5888](https://github.com/seata/seata/pull/5888)] remove sofa test cases
- [[#5831](https://github.com/seata/seata/pull/5831)] upgrade druid and add `test-druid.yml`
- [[#5862](https://github.com/seata/seata/pull/5862)] fix unit test in java 21
- [[#5914](https://github.com/seata/seata/pull/5914)] upgrade native-lib-loader version
- [[#5960](https://github.com/seata/seata/pull/5960)] fix zookeeper UT failed
- [[#5981](https://github.com/seata/seata/pull/5981)] fixed jedis version for `seata-server`

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

<!-- Please make sure your Github ID is in the list below -->
- [slievrly](https://github.com/slievrly)
- [capthua](https://github.com/capthua)
- [funky-eyes](https://github.com/funky-eyes)
- [iquanzhan](https://github.com/iquanzhan)
- [leizhiyuan](https://github.com/leizhiyuan)
- [l81893521](https://github.com/l81893521)
- [PeppaO](https://github.com/PeppaO)
- [wangliang181230](https://github.com/wangliang181230)
- [hsien999](https://github.com/hsien999)


Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
1 change: 1 addition & 0 deletions changes/en-us/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ The version is updated as follows:
- [[#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
- [[#5995](https://github.com/seata/seata/pull/5995)] add test cases for RaftClusterMetadataMsg


### Contributors:
Expand Down
73 changes: 73 additions & 0 deletions changes/zh-cn/1.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
### 1.8.0

[source](https://github.com/seata/seata/archive/v1.8.0.zip) |
[binary](https://github.com/seata/seata/releases/download/v1.8.0/seata-server-1.8.0.zip)

<details>
<summary><mark>Release notes</mark></summary>


### Seata 1.8.0

Seata 1.8.0 发布。

Seata 是一款开源的分布式事务解决方案,提供高性能和简单易用的分布式事务服务。

此版本更新如下:

### feature:
- [[#3672](https://github.com/seata/seata/pull/3672)] AT模式支持Dameng数据库
- [[#5892](https://github.com/seata/seata/pull/5892)] AT模式支持PolarDB-X 2.0数据库

### bugfix:
- [[#5833](https://github.com/seata/seata/pull/5833)] 修复 XA 事务失败回滚后,TC 继续重试回滚的问题
- [[#5884](https://github.com/seata/seata/pull/5884)] 修复达梦前后镜像查询列名都加了引号导致sql异常的问题
- [[#5931](https://github.com/seata/seata/pull/5931)] 修复存储redis哨兵模式下哨兵密码缺失的问题
- [[#5970](https://github.com/seata/seata/pull/5970)] 修复某些未弃用的配置显示"已弃用"

### optimize:
- [[#5866](https://github.com/seata/seata/pull/5866)] 一些小的语法优化
- [[#5889](https://github.com/seata/seata/pull/5889)] 移除无license组件
- [[#5890](https://github.com/seata/seata/pull/5890)] 移除7z压缩支持
- [[#5891](https://github.com/seata/seata/pull/5891)] 移除 mariadb.jdbc 依赖
- [[#5828](https://github.com/seata/seata/pull/5828)] 修正 `codecov chart` 不展示的问题
- [[#5927](https://github.com/seata/seata/pull/5927)] 优化一些与 Apollo 相关的脚本
- [[#5918](https://github.com/seata/seata/pull/5918)] 修正codecov.yml不标准属性
- [[#5939](https://github.com/seata/seata/pull/5939)] 支持 jmx 监控配置

### security:
- [[#5867](https://github.com/seata/seata/pull/5867)] 修复npm package漏洞
- [[#5898](https://github.com/seata/seata/pull/5898)] 修复npm package漏洞

### test:
- [[#5888](https://github.com/seata/seata/pull/5888)] 移除 sofa 测试用例
- [[#5831](https://github.com/seata/seata/pull/5831)] 升级 `druid` 版本,并添加 `test-druid.yml` 用于测试seata与druid各版本的兼容性。
- [[#5862](https://github.com/seata/seata/pull/5862)] 修复单元测试在Java21下无法正常运行的问题。
- [[#5914](https://github.com/seata/seata/pull/5914)] 升级 native-lib-loader 版本
- [[#5960](https://github.com/seata/seata/pull/5960)] 修复 zookeeper 单测失败问题
- [[#5981](https://github.com/seata/seata/pull/5981)] 固定 `seata-server` 所使用有 jedis 版本

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

<!-- 请确保您的 GitHub ID 在以下列表中 -->
- [slievrly](https://github.com/slievrly)
- [capthua](https://github.com/capthua)
- [funky-eyes](https://github.com/funky-eyes)
- [iquanzhan](https://github.com/iquanzhan)
- [leizhiyuan](https://github.com/leizhiyuan)
- [l81893521](https://github.com/l81893521)
- [PeppaO](https://github.com/PeppaO)
- [wangliang181230](https://github.com/wangliang181230)
- [hsien999](https://github.com/hsien999)


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

#### Link

- **Seata:** https://github.com/seata/seata
- **Seata-Samples:** https://github.com/seata/seata-samples
- **Release:** https://github.com/seata/seata/releases
- **WebSite:** https://seata.io

</details>
2 changes: 2 additions & 0 deletions changes/zh-cn/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#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 单测失败问题
- [[#5995](https://github.com/seata/seata/pull/5995)] 添加 RaftClusterMetadataMsg 模块的单元测试用例

### Contributors:

Expand Down Expand Up @@ -207,6 +208,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [iquanzhan](https://github.com/iquanzhan)
- [leizhiyuan](https://github.com/leizhiyuan)
- [Aruato](https://github.com/Aruato)
- [ggbocoder](https://github.com/ggbocoder)

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

Expand Down
57 changes: 57 additions & 0 deletions server/src/test/java/io/seata/server/raft/RaftSyncMessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
package io.seata.server.raft;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.seata.common.metadata.ClusterRole;
import io.seata.common.metadata.Node;
import io.seata.core.exception.TransactionException;
import io.seata.core.model.BranchType;
import io.seata.server.cluster.raft.sync.msg.RaftBranchSessionSyncMsg;
import io.seata.server.cluster.raft.sync.msg.RaftClusterMetadataMsg;
import io.seata.server.cluster.raft.sync.msg.RaftGlobalSessionSyncMsg;
import io.seata.server.cluster.raft.sync.msg.RaftSyncMessage;
import io.seata.server.cluster.raft.sync.RaftSyncMessageSerializer;
Expand All @@ -29,6 +35,7 @@
import io.seata.server.cluster.raft.snapshot.session.RaftSessionSnapshot;
import io.seata.server.cluster.raft.sync.msg.dto.BranchTransactionDTO;
import io.seata.server.cluster.raft.sync.msg.dto.GlobalTransactionDTO;
import io.seata.server.cluster.raft.sync.msg.dto.RaftClusterMetadata;
import io.seata.server.session.GlobalSession;
import io.seata.server.session.SessionHelper;
import io.seata.server.session.SessionHolder;
Expand Down Expand Up @@ -94,4 +101,54 @@ public void testSnapshotSerialize() throws IOException, TransactionException {
Assertions.assertEquals(1, map.get(globalSession.getXid()).getBranchSessions().size());
}

@Test
public void testRaftClusterMetadataSerialize() throws IOException {
RaftSyncMessage raftSyncMessage = new RaftSyncMessage();
RaftClusterMetadata raftClusterMetadata = new RaftClusterMetadata();
//set leader
Node leader = new Node();
leader.setRole(ClusterRole.LEADER);
leader.setGroup("abc");
leader.setControl(leader.createEndpoint("1.1.1.1",8088,"http"));
leader.setTransaction(leader.createEndpoint("1.1.1.1",8089,"netty"));
Map<String,Object> metaData=new HashMap<>();
metaData.put("abc","abc");
leader.setMetadata(metaData);
raftClusterMetadata.setLeader(leader);
//set learner
Node learner = new Node();
learner.setRole(ClusterRole.LEARNER);
learner.setGroup("abc");
learner.setControl(leader.createEndpoint("1.1.1.2",8088,"http"));
learner.setTransaction(leader.createEndpoint("1.1.1.2",8089,"netty"));
List<Node> learners=new ArrayList<>();
learners.add(learner);
raftClusterMetadata.setLearner(learners);
//set follower
Node follower = new Node();
follower.setRole(ClusterRole.FOLLOWER);
follower.setGroup("abc");
follower.setControl(leader.createEndpoint("1.1.1.3",8088,"http"));
follower.setTransaction(leader.createEndpoint("1.1.1.3",8089,"netty"));
List<Node> followers=new ArrayList<>();
followers.add(follower);
raftClusterMetadata.setFollowers(followers);

RaftClusterMetadataMsg raftClusterMetadataMsg=new RaftClusterMetadataMsg(raftClusterMetadata);

raftSyncMessage.setBody(raftClusterMetadataMsg);
byte[] msg = RaftSyncMessageSerializer.encode(raftSyncMessage);
RaftSyncMessage raftSyncMessage1 = RaftSyncMessageSerializer.decode(msg);
RaftClusterMetadataMsg raftClusterMetadataMsg1=(RaftClusterMetadataMsg) raftSyncMessage1.getBody();
Node leader1=raftClusterMetadataMsg1.getRaftClusterMetadata().getLeader();
Assertions.assertEquals("1.1.1.1", leader1.getControl().getHost());
Assertions.assertEquals("abc",leader1.getMetadata().get("abc"));
Assertions.assertEquals(1,raftClusterMetadataMsg1.getRaftClusterMetadata().getFollowers().size());
Node follower1=raftClusterMetadataMsg1.getRaftClusterMetadata().getFollowers().get(0);
Assertions.assertEquals("abc", follower1.getGroup());
Assertions.assertEquals(1,raftClusterMetadataMsg1.getRaftClusterMetadata().getLearner().size());
Node learner1=raftClusterMetadataMsg1.getRaftClusterMetadata().getLearner().get(0);
Assertions.assertEquals(ClusterRole.LEARNER,learner1.getRole());
}

}

0 comments on commit 643dbf4

Please sign in to comment.