-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
feature:support redis distributed lock to prevent TC competition #3683
Merged
caohdgege
merged 72 commits into
apache:develop
from
lightClouds917:redis_distribute_locker
Jun 22, 2021
Merged
feature:support redis distributed lock to prevent TC competition #3683
caohdgege
merged 72 commits into
apache:develop
from
lightClouds917:redis_distribute_locker
Jun 22, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tionTemplate code
…tionTemplate code
funky-eyes
reviewed
Jun 2, 2021
server/src/main/java/io/seata/server/lock/distributed/DistributedLockerFactory.java
Outdated
Show resolved
Hide resolved
server/src/test/java/io/seata/server/session/SessionHolderTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/io/seata/server/session/SessionHolderTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/io/seata/server/session/redis/RedisDistributedLockerTest.java
Outdated
Show resolved
Hide resolved
caohdgege
reviewed
Jun 9, 2021
server/src/main/java/io/seata/server/lock/distributed/DistributedLockerFactory.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/lock/distributed/DistributedLockerFactory.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/storage/file/lock/FileDistributedLocker.java
Outdated
Show resolved
Hide resolved
server/src/main/resources/META-INF/services/io.seata.core.store.DistributedLocker
Outdated
Show resolved
Hide resolved
funky-eyes
reviewed
Jun 13, 2021
server/src/main/java/io/seata/server/storage/db/lock/distributed/MysqlDistributedLocker.java
Outdated
Show resolved
Hide resolved
funky-eyes
reviewed
Jun 13, 2021
server/src/main/resources/META-INF/services/io.seata.core.store.DistributedLocker
Outdated
Show resolved
Hide resolved
funky-eyes
requested changes
Jun 19, 2021
server/src/main/java/io/seata/server/lock/distributed/DistributedLockerFactory.java
Outdated
Show resolved
Hide resolved
funky-eyes
approved these changes
Jun 21, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
caohdgege
approved these changes
Jun 22, 2021
There was a problem hiding this 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
feature:support redis distributed lock to prevent multiple TCs Competitive process the scheduled task,like retryRollbacking,retryCommitting......
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
主要功能点:
1.新增了spi机制根据db类型加载具体的分布式锁实现,抽象出一层工厂;
2.新增了file的分布式锁默认实现,直接return true;
3.新增了redis的分布式锁实现;
4.新增了默认实现,直接return true;
5.优化了分布式锁的入口和方法语义;
6.测试用例均添加了,但是由于目前jedis-mock版本问题,均注释掉了,找到合适的版本后再开启。