Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: undo_log table check optimize #6031

Merged
merged 15 commits into from
Nov 26, 2023
Merged

optimize: undo_log table check optimize #6031

merged 15 commits into from
Nov 26, 2023

Conversation

laywin
Copy link
Contributor

@laywin laywin commented Nov 14, 2023

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

#6022

Ⅱ. Does this pull request fix one issue?

fixes #6022

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #6031 (c5761c7) into 2.x (09097aa) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6031      +/-   ##
============================================
+ Coverage     49.45%   49.52%   +0.06%     
- Complexity     4748     4752       +4     
============================================
  Files           908      908              
  Lines         31354    31355       +1     
  Branches       3777     3776       -1     
============================================
+ Hits          15505    15527      +22     
+ Misses        14310    14292      -18     
+ Partials       1539     1536       -3     
Files Coverage Δ
.../src/main/java/io/seata/core/constants/DBType.java 0.00% <ø> (ø)
...asource/src/main/java/io/seata/rm/RMHandlerAT.java 52.27% <ø> (+9.41%) ⬆️
...n/java/io/seata/rm/datasource/DataSourceProxy.java 60.57% <100.00%> (+3.16%) ⬆️

... and 5 files with indirect coverage changes

@funky-eyes funky-eyes changed the title undo_log table check optimize optimize: undo_log table check optimize Nov 15, 2023
@funky-eyes funky-eyes added first-time contributor first-time contributor mode: AT AT transaction mode module/rm-datasource rm-datasource module labels Nov 16, 2023
@funky-eyes funky-eyes added this to the 2.x Backlog milestone Nov 16, 2023
# Conflicts:
#	changes/en-us/2.0.0.md
#	changes/zh-cn/2.0.0.md
#	rm-datasource/src/main/java/io/seata/rm/datasource/DataSourceProxy.java
#	rm-datasource/src/test/java/io/seata/rm/RMHandlerATTest.java
@funky-eyes funky-eyes modified the milestones: 2.x Backlog, 2.1.0 Nov 24, 2023
@@ -9,7 +9,7 @@
- [[#PR_NO](https://github.com/seata/seata/pull/PR_NO)] 准确简要的PR描述

### optimize:
- [[#PR_NO](https://github.com/seata/seata/pull/PR_NO)] 准确简要的PR描述
- [[#6031](https://github.com/seata/seata/pull/6031)] 添加undo_log表的存在性校验
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该版本下首次提交pr,作者信息需要进行登记一下
For the first PR submission in this version, the author's information needs to be registered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是这个吗,有登记额
Is this it? It's registered
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你看下中文的那份文件是否没登记
Check if the Chinese file is not registered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

try {
undoLogManager = UndoLogManagerFactory.getUndoLogManager(dbType);
} catch (EnhancedServiceNotFoundException e) {
LOGGER.error("can't find undoLogManager service provider for dbtype: {}", dbType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我建议这里直接抛异常出去,说明用户再使用一个我们不支持的数据库,要提示这个数据库不支持
I suggest throwing an exception directly here, indicating that if the user uses a database that we do not support, we need to prompt that the database is not supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有抛出去,是因为很多单测使用了数据库代理,会导致单测失败。
It is not thrown out because many unit tests use database proxy, which can be lead it fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有抛出去,是因为很多单测使用了数据库代理,会导致单测失败。 It is not thrown out because many unit tests use database proxy, which can be lead it fail.

有没有什么办法在单测的时候不进行校验undolog table?或者增加一个开关,这个开关允许用户配置check,如果用户关闭,就不进行check,然后我们默认开启,在单测的时候关闭check
Is there any way to not check undolog table during single test or add a switch that allows user to configure check and if user turns it off, no check is performed, then we turn it on by default and turn off check during single test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update mockito version to 4.5.1 same as seata server's mockito dependency to support static mock. when unit test. mock undolog table check.

funky-eyes and others added 4 commits November 25, 2023 23:36
…atic mock

2. throw exception when the db type not support in AT mode
3. add author register info
# Conflicts:
#	changes/zh-cn/2.x.md
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@funky-eyes funky-eyes merged commit 960c298 into apache:2.x Nov 26, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor mode: AT AT transaction mode module/rm-datasource rm-datasource module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Optimize] add a check for the existence of the undolog table
2 participants