Skip to content

Commit 13ef429

Browse files
committed
Merge remote-tracking branch 'upstream/2.x' into summer-code-raft-config-centerV2
2 parents 04448f1 + b11cc1d commit 13ef429

File tree

60 files changed

+2191
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2191
-155
lines changed

changes/en-us/2.x.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Add changes here for all PR submitted to the 2.x branch.
1717
- [[#7112](https://github.com/apache/incubator-seata/pull/7112)] bugfix: remove the condition that IPv6 must start with fe80
1818
- [[#7107](https://github.com/apache/incubator-seata/pull/7107)] fix the issue of failing to parse annotations in TCC mode when the business object is a proxy object.
1919
- [[#7124](https://github.com/apache/incubator-seata/pull/7124)] bugfix: GlobalTransactionScanner.afterPropertiesSet need do scanner check
20-
20+
- [[#7135](https://github.com/apache/incubator-seata/pull/7135)] treating a unique index conflict during rollback as a dirty write
2121

2222
### optimize:
2323

@@ -27,6 +27,10 @@ Add changes here for all PR submitted to the 2.x branch.
2727
- [[#7089](https://github.com/apache/incubator-seata/pull/7089)] support instance registration to the registry center
2828
- [[#7093](https://github.com/apache/incubator-seata/pull/7093)] add a test workflow for JDK 21
2929
- [[#7131](https://github.com/apache/incubator-seata/pull/7131)] Remove org.codehaus.jackson dependency
30+
- [[#7134](https://github.com/apache/incubator-seata/pull/7134)] upgrade tomcat-embed to 9.0.98
31+
- [[#7138](https://github.com/apache/incubator-seata/pull/7138)] Remove org.eclipse.jetty dependency
32+
- [[#7139](https://github.com/apache/incubator-seata/pull/7139)] upgrade xstream to 1.4.21
33+
- [[#7141](https://github.com/apache/incubator-seata/pull/7141)] remove unused dependencies
3034

3135

3236
### security:
@@ -58,5 +62,6 @@ Thanks to these contributors for their code commits. Please report an unintended
5862
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
5963
- [wxrqforever](https://github.com/wxrqforever)
6064
- [xingfudeshi](https://github.com/xingfudeshi)
65+
- [YongGoose](https://github.com/YongGoose)
6166

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

changes/zh-cn/2.x.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [[#7112](https://github.com/apache/incubator-seata/pull/7112)] 校验是否IPv6网络ip取消必须以fe80开始的条件
1818
- [[#7107](https://github.com/apache/incubator-seata/pull/7107)] 修复tcc模式下,当业务对象为代理对象时,解析注解失败问题。
1919
- [[#7124](https://github.com/apache/incubator-seata/pull/7124)] GlobalTransactionScanner.afterPropertiesSet方法需要做扫描检查
20+
- [[#7135](https://github.com/apache/incubator-seata/pull/7135)] 回滚时遇到唯一索引冲突视为脏写
2021

2122
### optimize:
2223

@@ -26,6 +27,10 @@
2627
- [[#7089](https://github.com/apache/incubator-seata/pull/7089)] 新增instance注册到注册中心的接口
2728
- [[#7093](https://github.com/apache/incubator-seata/pull/7093)] 增加jdk21的工作流测试
2829
- [[#7131](https://github.com/apache/incubator-seata/pull/7131)] 移除 org.codehaus.jackson 依赖
30+
- [[#7134](https://github.com/apache/incubator-seata/pull/7134)] 升级 tomcat-embed 至 9.0.98 版本
31+
- [[#7138](https://github.com/apache/incubator-seata/pull/7138)] 移除 org.eclipse.jetty 依赖
32+
- [[#7139](https://github.com/apache/incubator-seata/pull/7139)] 升级 xstream 至 1.4.21 版本
33+
- [[#7141](https://github.com/apache/incubator-seata/pull/7141)] 去除未使用的依赖
2934

3035

3136
### security:
@@ -57,5 +62,6 @@
5762
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
5863
- [wxrqforever](https://github.com/wxrqforever)
5964
- [xingfudeshi](https://github.com/xingfudeshi)
60-
-
65+
- [YongGoose](https://github.com/YongGoose)
66+
6167
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

common/src/main/java/org/apache/seata/common/result/Result.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public class Result<T> implements Serializable {
2626

2727
public static final String SUCCESS_CODE = "200";
2828
public static final String SUCCESS_MSG = "success";
29+
public static final String FAIL_CODE = "500";
30+
2931

3032
private String code = SUCCESS_CODE;
3133
private String message = SUCCESS_MSG;

common/src/main/java/org/apache/seata/common/result/SingleResult.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,18 @@ public static <T> SingleResult<T> failure(Code errorCode) {
4747
return new SingleResult(errorCode.getCode(), errorCode.getMsg());
4848
}
4949

50+
public static <T> SingleResult<T> failure(String msg) {
51+
return new SingleResult<>(FAIL_CODE, msg);
52+
}
53+
5054
public static <T> SingleResult<T> success(T data) {
5155
return new SingleResult<>(SUCCESS_CODE, SUCCESS_MSG,data);
5256
}
5357

58+
public static <T> SingleResult<T> success() {
59+
return new SingleResult<>(SUCCESS_CODE, SUCCESS_MSG, null);
60+
}
61+
5462
public T getData() {
5563
return data;
5664
}

console/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<spring-boot-for-server.version>2.7.18</spring-boot-for-server.version>
3636
<spring-framework-for-server.version>5.3.39</spring-framework-for-server.version>
3737
<snakeyaml-for-server.version>2.0</snakeyaml-for-server.version>
38-
<tomcat-embed.version>9.0.90</tomcat-embed.version>
38+
<tomcat-embed.version>9.0.98</tomcat-embed.version>
3939
</properties>
4040

4141
<dependencyManagement>

console/src/main/resources/static/console-fe/src/locales/en-us.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ const enUs: ILocale = {
6262
showBranchSessionTitle: 'View branch session',
6363
showGlobalLockTitle: 'View global lock',
6464
branchSessionDialogTitle: 'Branch session info',
65+
deleteGlobalSessionTitle: 'Delete global session',
66+
forceDeleteGlobalSessionTitle: 'Force delete global session',
67+
stopGlobalSessionTitle: 'Stop global session retry',
68+
startGlobalSessionTitle: 'Start global session retry',
69+
sendGlobalSessionTitle: 'Commit or rollback global session',
70+
changeGlobalSessionTitle: 'Change global session status',
71+
deleteBranchSessionTitle: 'Delete branch session',
72+
forceDeleteBranchSessionTitle: 'force delete branch session',
73+
stopBranchSessionTitle: 'Stop branch session retry',
74+
startBranchSessionTitle: 'Start branch session retry',
6575
},
6676
GlobalLockInfo: {
6777
title: 'GlobalLockInfo',
@@ -70,6 +80,8 @@ const enUs: ILocale = {
7080
inputFilterPlaceholder: 'Please enter filter criteria',
7181
resetButtonLabel: 'Reset',
7282
searchButtonLabel: 'Search',
83+
operateTitle: 'operate',
84+
deleteGlobalLockTitle: 'Delete global lock',
7385
},
7486
ConfigInfo: {
7587
title: 'ConfigurationInfo',

console/src/main/resources/static/console-fe/src/locales/zh-cn.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ const zhCn: ILocale = {
6262
showBranchSessionTitle: '查看分支信息',
6363
showGlobalLockTitle: '查看全局锁',
6464
branchSessionDialogTitle: '分支事务信息',
65+
deleteGlobalSessionTitle: '删除全局事务',
66+
forceDeleteGlobalSessionTitle: '强制删除全局事务',
67+
stopGlobalSessionTitle: '停止全局事务重试',
68+
startGlobalSessionTitle: '开启全局事务重试',
69+
sendGlobalSessionTitle: '提交或回滚全局事务',
70+
changeGlobalSessionTitle: '更新全局事务状态',
71+
deleteBranchSessionTitle: '删除分支事务',
72+
forceDeleteBranchSessionTitle: '强制删除分支事务',
73+
stopBranchSessionTitle: '停止分支事务重启',
74+
startBranchSessionTitle: '开启分支事务重试',
6575
},
6676
GlobalLockInfo: {
6777
title: '全局锁信息',
@@ -70,6 +80,8 @@ const zhCn: ILocale = {
7080
inputFilterPlaceholder: '请输入筛选条件',
7181
resetButtonLabel: '重置',
7282
searchButtonLabel: '搜索',
83+
operateTitle: '操作',
84+
deleteGlobalLockTitle: '删除全局锁',
7385
},
7486
ConfigInfo: {
7587
title: '配置信息',

console/src/main/resources/static/console-fe/src/pages/GlobalLockInfo/GlobalLockInfo.tsx

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
1515
* limitations under the License.
1616
*/
1717
import React from 'react';
18-
import { ConfigProvider, Table, Button, DatePicker, Form, Icon, Pagination, Input } from '@alicloud/console-components';
18+
import { ConfigProvider, Table, Button, DatePicker, Form, Icon, Pagination, Input, Dialog, Message } from '@alicloud/console-components';
1919
import Actions, { LinkButton } from '@alicloud/console-components-actions';
2020
import { withRouter } from 'react-router-dom';
2121
import Page from '@/components/Page';
2222
import { GlobalProps } from '@/module';
2323
import styled, { css } from 'styled-components';
24-
import getData, { GlobalLockParam } from '@/service/globalLockInfo';
24+
import getData, {checkData, deleteData, GlobalLockParam } from '@/service/globalLockInfo';
2525
import PropTypes from 'prop-types';
2626
import moment from 'moment';
2727

2828
import './index.scss';
29+
import {get} from "lodash";
30+
import {enUsKey, getCurrentLanguage} from "@/reducers/locale";
2931

3032
const { RangePicker } = DatePicker;
3133
const FormItem = Form.Item;
@@ -37,7 +39,7 @@ type GlobalLockInfoState = {
3739
globalLockParam: GlobalLockParam;
3840
}
3941

40-
class GlobalLockInfo extends React.Component<GlobalProps, GlobalLockInfoState> {
42+
class GlobalLockInfo extends React.Component<GlobalProps, GlobalLockInfoState> {
4143
static displayName = 'GlobalLockInfo';
4244

4345
static propTypes = {
@@ -148,12 +150,53 @@ type GlobalLockInfoState = {
148150
this.search();
149151
}
150152

153+
deleteCell = (val: string, index: number, record: any) => {
154+
const {locale = {}} = this.props;
155+
const {
156+
deleteGlobalLockTitle
157+
} = locale;
158+
let width = getCurrentLanguage() === enUsKey ? '120px' : '80px'
159+
return (
160+
<Actions style={{width: width}}>
161+
<Button onClick={() => {
162+
let addWarnning = ''
163+
Dialog.confirm({
164+
title: 'Confirm',
165+
content: 'Are you sure you want to delete the global lock',
166+
onOk: () => {
167+
checkData(record).then((rsp) => {
168+
addWarnning = rsp.data ? 'The branch transactions may be affected' : ''
169+
Dialog.confirm({
170+
title: 'Warnning',
171+
content: <div dangerouslySetInnerHTML={{ __html: 'Dirty write problem exists' + '<br>' + addWarnning }}/>,
172+
onOk: () => {
173+
deleteData(record).then(() => {
174+
Message.success("Delete success")
175+
this.search()
176+
}).catch((rsp) => {
177+
Message.error(get(rsp, 'data.message'))
178+
})
179+
}
180+
})
181+
}).catch((rsp) => {
182+
Message.error(get(rsp, 'data.message'))
183+
})
184+
}
185+
});
186+
}}>
187+
{deleteGlobalLockTitle}
188+
</Button>
189+
</Actions>)
190+
}
191+
192+
151193
render() {
152194
const { locale = {} } = this.props;
153195
const { title, subTitle, createTimeLabel,
154196
inputFilterPlaceholder,
155197
searchButtonLabel,
156198
resetButtonLabel,
199+
operateTitle,
157200
} = locale;
158201
return (
159202
<Page
@@ -221,27 +264,28 @@ type GlobalLockInfoState = {
221264
</Form>
222265
{/* global lock table */}
223266
<div>
224-
<Table dataSource={this.state.list} loading={this.state.loading}>
225-
<Table.Column title="xid" dataIndex="xid" />
226-
<Table.Column title="transactionId" dataIndex="transactionId" />
227-
<Table.Column title="branchId" dataIndex="branchId" />
228-
<Table.Column title="resourceId" dataIndex="resourceId" />
229-
<Table.Column title="tableName" dataIndex="tableName" />
230-
<Table.Column title="pk" dataIndex="pk" />
231-
<Table.Column title="rowKey" dataIndex="rowKey" />
232-
<Table.Column title="gmtCreate" dataIndex="gmtCreate" />
233-
<Table.Column title="gmtModified" dataIndex="gmtModified" />
234-
</Table>
235-
<Pagination
236-
total={this.state.total}
237-
defaultCurrent={1}
238-
current={this.state.globalLockParam.pageNum}
239-
onChange={this.paginationOnChange}
240-
pageSize={this.state.globalLockParam.pageSize}
241-
pageSizeSelector="dropdown"
242-
pageSizeList={[10, 20, 30, 40, 50]}
243-
onPageSizeChange={this.paginationOnPageSizeChange}
244-
/>
267+
<Table dataSource={this.state.list} loading={this.state.loading}>
268+
<Table.Column title="xid" dataIndex="xid" />
269+
<Table.Column title="transactionId" dataIndex="transactionId" />
270+
<Table.Column title="branchId" dataIndex="branchId" />
271+
<Table.Column title="resourceId" dataIndex="resourceId" />
272+
<Table.Column title="tableName" dataIndex="tableName" />
273+
<Table.Column title="pk" dataIndex="pk" />
274+
<Table.Column title="rowKey" dataIndex="rowKey" />
275+
<Table.Column title="gmtCreate" dataIndex="gmtCreate" />
276+
<Table.Column title="gmtModified" dataIndex="gmtModified" />
277+
<Table.Column title={operateTitle} cell={this.deleteCell}/>
278+
</Table>
279+
<Pagination
280+
total={this.state.total}
281+
defaultCurrent={1}
282+
current={this.state.globalLockParam.pageNum}
283+
onChange={this.paginationOnChange}
284+
pageSize={this.state.globalLockParam.pageSize}
285+
pageSizeSelector="dropdown"
286+
pageSizeList={[10, 20, 30, 40, 50]}
287+
onPageSizeChange={this.paginationOnPageSizeChange}
288+
/>
245289
</div>
246290
</Page>
247291
);

0 commit comments

Comments
 (0)