Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Bughue
Copy link
Contributor

@Bughue Bughue commented Apr 10, 2023

Ⅰ. Describe what this PR did

更新globalstatus的时候采用线程安全的方式,阻止预期状态不匹配的操作继续执行。
目前的思路是:rollback和commit都用乐观锁方式去更新globalsession的status,更新成功的会往下执行。没有更新成功的会遇到异常而中断。
传参expected status方式使用threadlocal

以下两个pr优化了之后,这个pr可以简化
#4858
#4881

原pr关闭
#4383

Ⅱ. Does this pull request fix one issue?

fixes #4372

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

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

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.

db/redis mode must be thread-safe when changing the transaction state

2 participants