Skip to content

Commit

Permalink
datasource metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbxyyx committed Aug 2, 2024
2 parents 2f5a1ee + d0f8c6f commit c2501c1
Show file tree
Hide file tree
Showing 204 changed files with 6,017 additions and 4,139 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ Thumbs.db

#h2
*.db

/console/src/main/resources/static/css/
/console/src/main/resources/static/img/
/console/src/main/resources/static/js/
/console/src/main/resources/static/saga-statemachine-designer/
/console/src/main/resources/static/index.html
/console/src/main/resources/static/version.json
1 change: 1 addition & 0 deletions build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<kafka-appender.version>0.2.0-RC2</kafka-appender.version>
<kafka-clients.version>3.6.1</kafka-clients.version>
<snakeyaml.version>2.0</snakeyaml.version>
<jackson-mapper.version>1.9.13</jackson-mapper.version>

<!-- For test -->
<junit-jupiter.version>5.8.2</junit-jupiter.version>
Expand Down
28 changes: 25 additions & 3 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ Add changes here for all PR submitted to the 2.x branch.
### feature:
- [[#6226](https://github.com/apache/incubator-seata/pull/6226)] multi-version seata protocol support
- [[#6537](https://github.com/apache/incubator-seata/pull/6537)] support Namingserver

- [[#6538](https://github.com/apache/incubator-seata/pull/6538)] Integration of naming server on the Seata server side
### bugfix:
- [[#6592](https://github.com/apache/incubator-seata/pull/6592)] fix @Async annotation not working in ClusterWatcherManager
- [[#6624](https://github.com/apache/incubator-seata/pull/6624)] fix Alibaba Dubbo convert error
- [[#6627](https://github.com/apache/incubator-seata/pull/6627)] fix the issue of xaEnded not being reset
- [[#6626](https://github.com/apache/incubator-seata/pull/6626)] fix hsf ConsumerModel convert error
- [[#6642](https://github.com/apache/incubator-seata/pull/6642)] codecov token not found
- [[#6661](https://github.com/apache/incubator-seata/pull/6661)] fix `tableMeta` cache scheduled refresh issue
- [[#6486](https://github.com/apache/incubator-seata/pull/6486)] fix mysql undo log update sql data more than max allowed packet
- [[#6668](https://github.com/apache/incubator-seata/pull/6668)] thread safety issue when adding and removing instances
- [[#6678](https://github.com/apache/incubator-seata/pull/6678)] fix the same record has different lowkeys due to mixed case of table names yesterday
- [[#6697](https://github.com/apache/incubator-seata/pull/6697)] v0 ByteBuf should not decode by super class
- [[#6707](https://github.com/apache/incubator-seata/pull/6707)] fix readonly branch commit errors in Oracle XA transactions
- [[#6711](https://github.com/apache/incubator-seata/pull/6711)] fix dameng rollback info un compress fail
- [[#6714](https://github.com/apache/incubator-seata/pull/6714)] fix dameng delete undo fail


### optimize:
- [[#6499](https://github.com/apache/incubator-seata/pull/6499)] split the task thread pool for committing and rollbacking statuses
Expand All @@ -24,15 +32,22 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6534](https://github.com/apache/incubator-seata/pull/6534)] optimize: send async response
- [[#6640](https://github.com/apache/incubator-seata/pull/6640)] modify codecov config
- [[#6640](https://github.com/apache/incubator-seata/pull/6648)] add license header
- [[#6666](https://github.com/apache/incubator-seata/pull/6666)] add ExceptionUtil class for unwarp error msg
- [[#6654](https://github.com/apache/incubator-seata/pull/6654)] add Namingserver package module
- [[#6667](https://github.com/apache/incubator-seata/pull/6667)] optimize Namingserver log output
- [[#6687](https://github.com/apache/incubator-seata/pull/6687)] delete static code built on the frontend
- [[#6700](https://github.com/apache/incubator-seata/pull/6700)] remove sdk version checking

### refactor:

### security:

- [[#6702](https://github.com/apache/incubator-seata/pull/6702)] fix REC security vulnerability during Raft deserialization

### test:
- [[#6533](https://github.com/apache/incubator-seata/pull/6533)] increase integration-tx-api module unit test coverage
- [[#6608](https://github.com/apache/incubator-seata/pull/6608)] add unit test for sql-parser-core
- [[#6647](https://github.com/apache/incubator-seata/pull/6647)] improve the test case coverage of saga module to 70%

- [[#6695](https://github.com/apache/incubator-seata/pull/6695)] old version(< 0.7.1) client test case for multi-version protocol

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

Expand All @@ -45,11 +60,18 @@ Thanks to these contributors for their code commits. Please report an unintended
- [Bughue](https://github.com/Bughue)
- [funky-eyes](https://github.com/funky-eyes)
- [tanyaofei](https://github.com/tanyaofei)
- [traitsisgiorgos](https://github.com/traitsisgiorgos)
- [wanghongzhou](https://github.com/wanghongzhou)
- [ggbocoder](https://github.com/ggbocoder)
- [azatyamanaev](https://github.com/azatyamanaev)
- [xjlgod](https://github.com/xjlgod)
- [xingfudeshi](https://github.com/xingfudeshi)
- [wuwen5](https://github.com/wuwen5)
- [jsbxyyx](https://github.com/jsbxyyx)
- [iAmClever](https://github.com/iAmClever)
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
- [liuqiufeng](https://github.com/liuqiufeng)
- [caohdgege](https://github.com/caohdgege)


Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
27 changes: 27 additions & 0 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### feature:
- [[#6226](https://github.com/apache/incubator-seata/pull/6226)] 支持seata私有协议多版本兼容
- [[#6537](https://github.com/apache/incubator-seata/pull/6537)] 支持 Namingserver
- [[#6538](https://github.com/apache/incubator-seata/pull/6538)] seata server端集成naming server

### bugfix:
- [[#6592](https://github.com/apache/incubator-seata/pull/6592)] fix @Async注解ClusterWatcherManager中不生效的问题
Expand All @@ -14,6 +15,13 @@
- [[#6640](https://github.com/apache/incubator-seata/pull/6640)] 优化codecov相关配置
- [[#6642](https://github.com/apache/incubator-seata/pull/6642)] 修复codecov token找不到导致无法提交单测覆盖度报告
- [[#6661](https://github.com/apache/incubator-seata/pull/6661)] 修复`tableMeta`缓存定时刷新失效问题
- [[#6486](https://github.com/apache/incubator-seata/pull/6486)] 修复在mysql数据库下undo_log sql数据超过最大包大小错误
- [[#6668](https://github.com/apache/incubator-seata/pull/6668)] 解决namingserver同一个集群下instance添加和删除时的线程安全问题
- [[#6678](https://github.com/apache/incubator-seata/pull/6678)] 修复由于表名大小写问题导致的相同记录生成不同RowKey的问题
- [[#6697](https://github.com/apache/incubator-seata/pull/6697)] v0版本的ByteBuf不应由父类先解码
- [[#6707](https://github.com/apache/incubator-seata/pull/6707)] 修复Oracle XA事务中只读分支提交出错的问题
- [[#6711](https://github.com/apache/incubator-seata/pull/6711)] 修复达梦数据库的getRollbackInfo没有解压缩的问题
- [[#6714](https://github.com/apache/incubator-seata/pull/6714)] 修复达梦数据库的delete sql回滚失败的问题

### optimize:
- [[#6499](https://github.com/apache/incubator-seata/pull/6499)] 拆分 committing 和 rollbacking 状态的任务线程池
Expand All @@ -24,14 +32,24 @@
- [[#6566](https://github.com/apache/incubator-seata/pull/6566)] 支持GlobalTransactionScanner类中exposeProxy属性的配置
- [[#6534](https://github.com/apache/incubator-seata/pull/6534)] 优化: 发送异步响应
- [[#6534](https://github.com/apache/incubator-seata/pull/6648)] 增加license header信息
- [[#6666](https://github.com/apache/incubator-seata/pull/6666)] 添加ExceptionUtil工具类用于解包装异常
- [[#6654](https://github.com/apache/incubator-seata/pull/6654)] 增加Namingserver打包功能
- [[#6667](https://github.com/apache/incubator-seata/pull/6667)] 优化Namingserver日志输出
- [[#6687](https://github.com/apache/incubator-seata/pull/6687)] 删除前端构建的静态代码
- [[#6700](https://github.com/apache/incubator-seata/pull/6700)] 去掉sdk版本检查

### refactor:


### security:
- [[#6702](https://github.com/apache/incubator-seata/pull/6702)] 修复Raft反序列化时存在RCE安全漏洞

### test:
- [[#6533](https://github.com/apache/incubator-seata/pull/6533)] 增加 Integration-TX-API 模块单元测试覆盖范围
- [[#6608](https://github.com/apache/incubator-seata/pull/6608)] 添加sql-parser-core模块测试用例
- [[#6647](https://github.com/apache/incubator-seata/pull/6647)] 增加saga模块的测试用例覆盖率
- [[#6695](https://github.com/apache/incubator-seata/pull/6695)] 多版本协议的旧版本(< 0.7.1)客户端测试用例




Expand All @@ -46,11 +64,20 @@
- [Bughue](https://github.com/Bughue)
- [funky-eyes](https://github.com/funky-eyes)
- [tanyaofei](https://github.com/tanyaofei)
- [traitsisgiorgos](https://github.com/traitsisgiorgos)
- [wanghongzhou](https://github.com/wanghongzhou)
- [ggbocoder](https://github.com/ggbocoder)
- [azatyamanaev](https://github.com/azatyamanaev)
- [xjlgod](https://github.com/xjlgod)
- [xingfudeshi](https://github.com/xingfudeshi)
- [wuwen5](https://github.com/wuwen5)
- [jsbxyyx](https://github.com/jsbxyyx)
- [iAmClever](https://github.com/iAmClever)
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
- [liuqiufeng](https://github.com/liuqiufeng)
- [caohdgege](https://github.com/caohdgege)



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

Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,11 @@ public interface ConfigurationKeys {
*/
String SERVER_ENABLE_CHECK_AUTH = SERVER_PREFIX + "enableCheckAuth";

/**
* The constant NAMING_SERVER
*/
String NAMING_SERVER = "namingserver";

/**
* The constant APPLICATION_ID.
*/
Expand Down Expand Up @@ -1011,4 +1016,39 @@ public interface ConfigurationKeys {
* The constant ROCKET_MQ_MSG_TIMEOUT
*/
String ROCKET_MQ_MSG_TIMEOUT = SERVER_PREFIX + "rocketmqMsgTimeout";

/**
*
*/
String NAMINGSERVER_REGISTRY_PREFIX = FILE_ROOT_REGISTRY + FILE_CONFIG_SPLIT_CHAR + NAMING_SERVER + FILE_CONFIG_SPLIT_CHAR;

/**
*
*/
String SEATA_NAMINGSERVER_REGISTRY_PREFIX = SEATA_FILE_ROOT_CONFIG + FILE_CONFIG_SPLIT_CHAR + NAMINGSERVER_REGISTRY_PREFIX;

/**
* The constant REGISTRY_NAMINGSERVER_CLUSTER
*/
String REGISTRY_NAMINGSERVER_CLUSTER = NAMINGSERVER_REGISTRY_PREFIX + "cluster";

/**
* The constant MAPPING_TABLE_NAME
*/
String MAPPING_TABLE_NAME = STORE_DB_PREFIX + FILE_CONFIG_SPLIT_CHAR + "mapping-table";

/**
* The constant NAMESPACE_KEY
*/
String NAMESPACE_KEY = SEATA_NAMINGSERVER_REGISTRY_PREFIX + "namespace";

/**
* The constant CLUSTER_NAME_KEY
*/
String CLUSTER_NAME_KEY = SEATA_FILE_ROOT_CONFIG + FILE_CONFIG_SPLIT_CHAR + REGISTRY_NAMINGSERVER_CLUSTER;

/**
* The constant META_PREFIX
*/
String META_PREFIX = SEATA_FILE_ROOT_CONFIG + FILE_CONFIG_SPLIT_CHAR + FILE_ROOT_REGISTRY + FILE_CONFIG_SPLIT_CHAR + "metadata.";
}
24 changes: 0 additions & 24 deletions common/src/main/java/org/apache/seata/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,28 +220,4 @@ public interface Constants {
*/
String JACKSON_JSON_TEXT_PREFIX = "{\"@class\":";

/**
* The constant HTTP_PREFIX
*/
String HTTP_PREFIX = "http://";

/**
* The constant HTTP_ADD_GROUP_SUFFIX
*/
String HTTP_ADD_GROUP_SUFFIX = "/naming/v1/addVGroup?";

/**
* The constant CONSTANT_UNIT
*/
String CONSTANT_UNIT = "unit";

/**
* The constant CONSTANT_GROUP
*/
String CONSTANT_GROUP = "vGroup";

/**
* The constant HTTP_REMOVE_GROUP_SUFFIX
*/
String HTTP_REMOVE_GROUP_SUFFIX = "/naming/v1/removeVGroup?";
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,42 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.seata.namingserver.pojo;
package org.apache.seata.common;

public interface NamingServerConstants {
/**
* The constant HTTP_PREFIX
*/
String HTTP_PREFIX = "http://";

/**
* The constant HTTP_ADD_GROUP_SUFFIX
*/
String HTTP_ADD_GROUP_SUFFIX = "/naming/v1/addVGroup?";

import org.apache.seata.common.metadata.Node;
/**
* The constant CONSTANT_UNIT
*/
String CONSTANT_UNIT = "unit";

import java.util.Collections;
import java.util.List;
/**
* The constant CONSTANT_GROUP
*/
String CONSTANT_GROUP = "vGroup";

public abstract class AbstractClusterData {
/**
* register instance in cluster
*
* @param node node msg
* @param unitName unit Name
* @return true if the node has changed, false if there is no change.
* The constant HTTP_REMOVE_GROUP_SUFFIX
*/
public boolean registerInstance(Node node, String unitName) {
return false;
}
String HTTP_REMOVE_GROUP_SUFFIX = "/naming/v1/removeVGroup?";

/**
* get all nodes in cluster
*
* @return all nodes in cluster
* The constant IP_PORT_SPLIT_CHAR
*/
public List<Node> getInstanceList() {
return Collections.EMPTY_LIST;
}
String IP_PORT_SPLIT_CHAR = ":";

/**
* remove instacne in cluster
*
* @param node node msg
* @param unitName unit Name
* The constant DEFAULT_VGROUP_MAPPING
*/
public void removeInstance(Node node, String unitName) {
}
String DEFAULT_VGROUP_MAPPING = "vgroup_table";

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ public enum ErrorCode {
/**
* 0001 ~ 0099 Configuration related errors
*/
ERR_CONFIG(ErrorType.Config, 0001);
ERR_CONFIG(ErrorType.Config, 0001),

/**
* 0100 ~ 0199 Security related errors
*/
ERR_DESERIALIZATION_SECURITY(ErrorType.Security, 0156),

/**
* The error code of the transaction exception.
*/


/**
* The error code of the sql exception
*/
ERROR_SQL(ErrorType.Datasource, 0201);

private int code;
private ErrorType type;

Expand Down Expand Up @@ -93,6 +105,10 @@ enum ErrorType {
* Datasource error type.
*/
Datasource,
/**
* Security error type.
*/
Security,
/**
* Other error type.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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 java.lang.reflect.InvocationTargetException;
import java.lang.reflect.UndeclaredThrowableException;

public class ExceptionUtil {

private ExceptionUtil() {
}

public static Throwable unwrap(Throwable wrapped) {
Throwable unwrapped = wrapped;
while (true) {
if (unwrapped instanceof InvocationTargetException) {
unwrapped = ((InvocationTargetException) unwrapped).getTargetException();
} else if (unwrapped instanceof UndeclaredThrowableException) {
unwrapped = ((UndeclaredThrowableException) unwrapped).getUndeclaredThrowable();
} else {
return unwrapped;
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Cluster {
private String clusterType;
private List<Unit> unitData = new ArrayList<>();


public Cluster() {
}

Expand Down
Loading

0 comments on commit c2501c1

Please sign in to comment.