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: fix the wrong rollback sequence caused by the same record request from different transaction branches on different servers #2187

Merged
merged 8 commits into from
Feb 3, 2020

Conversation

slievrly
Copy link
Member

@slievrly slievrly commented Jan 15, 2020

Signed-off-by: slievrly slievrly@163.com

Ⅰ. Describe what this PR did

bugfix: fix the wrong rollback sequence caused by the same record request from different transaction branches on different servers

Ⅱ. Does this pull request fix one issue?

fix #2186

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

…uest from different transaction branches on different servers

Signed-off-by: slievrly <slievrly@163.com>
Copy link
Member

@jsbxyyx jsbxyyx left a comment

Choose a reason for hiding this comment

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

LGTM

@feijiing
Copy link

图片
将seata server 版本升级至 1.1.0-SNAPSHOT版本,另外BRANCH_TABLE 表结构同步到最新表结构,可查看seata 源码中的sql脚本,经过测试验证能够回滚成功。
问题总结1: seata server 启动没有加 -n 参数,生产环境多机,多台TC必须加的,每台区分不同的node,用于生成不同范围的事务id,不然在开启全局事务时id会冲突报错

@zjinlei zjinlei added this to the 1.1.0 milestone Jan 22, 2020
PRIMARY KEY (`branch_id`),
KEY `idx_xid` (`xid`)
KEY `idx_xid` (`xid`),
KEY `idx_gmt_create` (`gmt_create`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Verified that the index has no effect on sorting.

Copy link
Member Author

Choose a reason for hiding this comment

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

already remove gmt_create index.

script/server/db/mysql.sql Show resolved Hide resolved
Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@codecov-io
Copy link

codecov-io commented Jan 22, 2020

Codecov Report

Merging #2187 into develop will increase coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2187      +/-   ##
=============================================
+ Coverage      52.88%   53.03%   +0.15%     
  Complexity      2498     2498              
=============================================
  Files            485      485              
  Lines          15283    15302      +19     
  Branches        1715     1754      +39     
=============================================
+ Hits            8082     8116      +34     
- Misses          6401     6408       +7     
+ Partials         800      778      -22
Impacted Files Coverage Δ Complexity Δ
...in/java/io/seata/server/session/GlobalSession.java 84.13% <0%> (-0.6%) 67% <0%> (ø)
...java/io/seata/spring/tcc/TccActionInterceptor.java 13.15% <0%> (-0.36%) 2% <0%> (ø)
...n/java/io/seata/rm/datasource/ConnectionProxy.java 26.05% <0%> (-0.23%) 12% <0%> (ø)
...a/io/seata/core/rpc/netty/AbstractRpcRemoting.java 9.35% <0%> (-0.19%) 3% <0%> (ø)
...ing/annotation/GlobalTransactionalInterceptor.java 10% <0%> (-0.15%) 2% <0%> (ø)
...in/java/io/seata/server/session/BranchSession.java 80.45% <0%> (-0.02%) 44% <0%> (ø)
...va/io/seata/core/store/db/LogStoreDataBaseDAO.java 55.92% <0%> (+0.14%) 21% <0%> (ø) ⬇️
...ain/java/io/seata/config/ConfigurationFactory.java 51.02% <0%> (+1.02%) 3% <0%> (ø) ⬇️
...buf/convertor/BranchRollbackResponseConvertor.java 100% <0%> (+2.94%) 3% <0%> (ø) ⬇️
...tobuf/convertor/BranchCommitResponseConvertor.java 100% <0%> (+3.03%) 3% <0%> (ø) ⬇️
... and 19 more

Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM

@zjinlei zjinlei merged commit 162f83e into apache:develop Feb 3, 2020
booogu pushed a commit to booogu/seata that referenced this pull request Feb 12, 2020
…uest from different transaction branches on different servers (apache#2187)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undo log 回滚失败,回滚数据为脏数据(Has dirty records when undo)
6 participants