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 dirty throw BranchRollbackFailed_Unretriable #5051

Merged
merged 15 commits into from
Nov 7, 2022

Conversation

zw201913
Copy link
Contributor

@zw201913 zw201913 commented Nov 4, 2022

fixes #4997

*/
class SQLUndoDirtyException extends SQLException {

private static final long serialVersionUID = -5168905669539637570L;
Copy link
Contributor

Choose a reason for hiding this comment

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

都加了这个了,为什么不 implements Serializable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

父类实现了,子类可不实现

if (e instanceof SQLUndoDirtyException) {
throw new BranchTransactionException(BranchRollbackFailed_Unretriable,
String.format(
"Branch session rollback failed because of dirty undo log. xid = %s branchId = %s %s", xid,
Copy link
Contributor

Choose a reason for hiding this comment

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

如果没意外的话,e.getMessage()就是上面的Has dirty records when undo.,跟前面的语义有点重复了

@caohdgege caohdgege added the module/rm rm module label Nov 4, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2022

Codecov Report

Merging #5051 (6c729d4) into develop (5796d64) will decrease coverage by 0.03%.
The diff coverage is 33.33%.

❗ Current head 6c729d4 differs from pull request most recent head df558ce. Consider uploading reports for the commit df558ce to get more accurate results

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #5051      +/-   ##
=============================================
- Coverage      49.45%   49.41%   -0.04%     
+ Complexity      4125     4124       -1     
=============================================
  Files            733      734       +1     
  Lines          26049    26054       +5     
  Branches        3219     3220       +1     
=============================================
- Hits           12882    12875       -7     
- Misses         11791    11804      +13     
+ Partials        1376     1375       -1     
Impacted Files Coverage Δ
...ata/rm/datasource/undo/AbstractUndoLogManager.java 49.46% <0.00%> (-0.82%) ⬇️
...seata/rm/datasource/undo/AbstractUndoExecutor.java 69.01% <100.00%> (ø)
...eata/rm/datasource/undo/SQLUndoDirtyException.java 100.00% <100.00%> (ø)
...rage/redis/store/RedisTransactionStoreManager.java 72.06% <0.00%> (-2.09%) ⬇️
...in/java/io/seata/server/session/GlobalSession.java 78.68% <0.00%> (-0.78%) ⬇️
...erver/storage/file/session/FileSessionManager.java 49.68% <0.00%> (+0.63%) ⬆️

@slievrly slievrly added the first-time contributor first-time contributor label Nov 7, 2022
* '1103' of https://github.com/zw201913/seata:
  optimize: remove useless code (apache#5047)
  bugfix: fix startup failure of Server1.5.2 by using OpenJDK 11 (apache#4874)
  bugfix: insert value is all parsed as string in insert on duplicate  (apache#5028)
  bugfix: global session is not change to Committed in saga mode (apache#5050)
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

.format("Branch session rollback failed and try again later xid = %s branchId = %s %s", xid,
branchId, e.getMessage()), e);
if (e instanceof SQLUndoDirtyException) {
throw new BranchTransactionException(BranchRollbackFailed_Unretriable,
Copy link
Contributor

Choose a reason for hiding this comment

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

描述上要加一些需要人工介入的提示

@funky-eyes funky-eyes added this to the 1.6.0 milestone Nov 7, 2022
@funky-eyes funky-eyes added module/rm-datasource rm-datasource module type: optimize and removed module/rm rm module labels Nov 7, 2022
@funky-eyes funky-eyes changed the title bufix: undo log dirty throw BranchRollbackFailed_Unretriable optimize: undo log dirty throw BranchRollbackFailed_Unretriable Nov 7, 2022
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

@zw201913 please take a look on the check style error.
image

@slievrly slievrly merged commit f0e25a6 into apache:develop Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected transaction rollback
6 participants