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

bugfix: clean root context when state machine inst record failed #3323

Merged

Conversation

anselleeyy
Copy link
Contributor

Ⅰ. Describe what this PR did

fixbug: SAGA模式在创建状态机实例,在存入数据库时,出现异常时,移除 xid和branchType,避免影响其他事务执行

Ⅱ. Does this pull request fix one issue?

fixed #3312

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@anselleeyy
Copy link
Contributor Author

@long187 fixed, use duplicate key exception instead

Copy link
Contributor

@wangliang181230 wangliang181230 left a comment

Choose a reason for hiding this comment

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

LGTM

public void testStateMachineRecordFailed() {

// drop table to mock record exception
jdbcTemplate.execute("drop table seata_state_machine_inst");
Copy link
Contributor

Choose a reason for hiding this comment

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

How to ensure that this unit test is executed last, otherwise it will cause other unit tests to fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, use duplicate key exception instead

Copy link
Contributor

@long187 long187 left a comment

Choose a reason for hiding this comment

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

LTGM

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

@slievrly slievrly merged commit 465f28b into apache:develop Dec 8, 2020
@slievrly slievrly added this to the 1.5.0 milestone Dec 8, 2020
@anselleeyy anselleeyy deleted the feature/fix_uncleand_RootContext_on_Exp branch December 11, 2020 03:31
@wangliang181230 wangliang181230 modified the milestones: 1.5.0, 1.4.1 Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants