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: acquire lock return fail-fast code in redis-pipeline mode. #4277

Merged
merged 6 commits into from
Jan 13, 2022

Conversation

objcoding
Copy link
Contributor

@objcoding objcoding commented Jan 9, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

When the local transaction and the global transaction are enabled, the branch registration fails to acquire the global lock, the lock holder is in the second-stage rollback, and the branch registration fails to be retried quickly, because the retry with the local transaction does not release the database lock , resulting in a two-phase rollback wait. Therefore, if a global lock is found in the Rollbacking state, the fail-fast code is returned directly.

Ⅱ. Does this pull request fix one issue?

#4267

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@objcoding objcoding changed the title bugfix: redis pipeline acquire lock return fail-fast ex when local and global transaction both enabled. bugfix: acquire lock return fail-fast code in redis-pipeline mode. Jan 9, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2022

Codecov Report

Merging #4277 (d63ceee) into develop (4f8e4b1) will increase coverage by 0.23%.
The diff coverage is 20.00%.

❗ Current head d63ceee differs from pull request most recent head 10e4de8. Consider uploading reports for the commit 10e4de8 to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4277      +/-   ##
=============================================
+ Coverage      48.55%   48.79%   +0.23%     
- Complexity      3791     3799       +8     
=============================================
  Files            724      724              
  Lines          24236    24211      -25     
  Branches        2970     2967       -3     
=============================================
+ Hits           11768    11813      +45     
+ Misses         11229    11158      -71     
- Partials        1239     1240       +1     
Impacted Files Coverage Δ
...o/seata/server/storage/redis/lock/RedisLocker.java 37.56% <20.00%> (+0.69%) ⬆️
...er/src/main/java/io/seata/server/ServerRunner.java 50.00% <0.00%> (-7.70%) ⬇️
...n/src/main/java/io/seata/common/util/IdWorker.java 77.08% <0.00%> (-6.25%) ⬇️
...torage/file/store/FileTransactionStoreManager.java 56.12% <0.00%> (-0.65%) ⬇️
...o/seata/server/coordinator/DefaultCoordinator.java 48.38% <0.00%> (-0.54%) ⬇️
...in/java/io/seata/server/session/GlobalSession.java 79.31% <0.00%> (+0.43%) ⬆️
...io/seata/core/rpc/netty/AbstractNettyRemoting.java 14.28% <0.00%> (+1.29%) ⬆️
...e/properties/registry/RegistryNacosProperties.java 51.72% <0.00%> (+5.77%) ⬆️
...igure/properties/config/ConfigNacosProperties.java 75.00% <0.00%> (+12.50%) ⬆️
...ource/sql/struct/cache/AbstractTableMetaCache.java 89.65% <0.00%> (+17.24%) ⬆️
... and 2 more

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 补充下1.5.0.md

@funky-eyes
Copy link
Contributor

按标题的意思这个pr应该是个optimize

@objcoding
Copy link
Contributor Author

按标题的意思这个pr应该是个optimize

是的,原则上是pr3733的一个优化,因为pr3733并没有打包release版本,还处于develop分支。

@objcoding objcoding changed the title bugfix: acquire lock return fail-fast code in redis-pipeline mode. optimize: acquire lock return fail-fast code in redis-pipeline mode. Jan 10, 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

@funky-eyes funky-eyes merged commit 88c1ca4 into apache:develop Jan 13, 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.

None yet

4 participants