-
Notifications
You must be signed in to change notification settings - Fork 173
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
Add more components for distributed lock API #104
Comments
@ZLBer 方案二是说trylock其实不用传过期时间,只要长连接没断就可以自动续租,长连接断了就停止续租
很有启发,我明天查下grpc相关资料 |
@seeflood next i want to implement lock by consul, let me try ! |
Sure! |
@seeflood 基于mongo实现分布式锁,我目前的想法是使用mongoDB的expire-data机制(TTL) https://docs.mongodb.com/manual/tutorial/expire-data/,或者有什么好的方案我们可以讨论下 |
@LXPWing 好呀,不过这样描述太简单了,可以描述下tryLock预计做哪些事情、unlock预计做哪些事情,像上面zk的讨论一样;当然如果你觉得这功能比较简单、不需要太多描述的话,可以直接把核心代码写出来、提个PR,大家好帮你看看实现的有没有问题~ 另外,有些细节需要考虑:
这些我也不太清楚(不太熟mongo),你可以在写代码之前先调研下哈 |
1.mongo在写时可以在客户端设置(Write Concern)mongo的写时一致性https://docs.mongodb.com/manual/reference/write-concern/ |
@LXPWing 棒,我修改下issue,这个assign给你哈 |
go有embed mongodb或者适配mgo语法用于单元测试的数据库吗,谷歌搜了下没找到。真的没有的话我简单实现个的db用来单测 |
@LXPWing 可以搜搜看,我找到有个java实现的embed mongodb,没看到有go的 没有的话不要紧,单测里把真正操作mongodb的部分mock掉即可;集成测试里(或者使用demo里)可以用docker启动个真的mongodb |
@LXPWing 感谢贡献!我留言了哈 #348 (comment) |
/good-first-issue cancel |
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue or help wanted. Thank you for your contributions. |
What would you like to be added:
Add more components for distributed lock API.
Choose an open source component or cloud service (such as zookeeper) you like to implement distributed lock API
References:pull request #100
done
assigned.see Zookeeper lock #111
assigned.see Add etcd lock #128
chinese:
选择一个你喜欢的开源组件或云服务(比如zookeeper)实现分布式锁API
参考资料:pull request #100
Why is this needed:
Currently we only support standalone Redis as a distributed lock store.We need more components to make it useful
The text was updated successfully, but these errors were encountered: