Redis Transaction Principle and Source Code Analysis #214
guozhihao-224
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
基本介绍
Redis对于事务处理的逻辑相对简单,归纳起来就是每个client记录监控了哪些key(watched_keys)和使用list来存储当前事务中需要执行的命令;对于redis db来说,同样是使用HashTable的方式记录某个key被哪些client监控了。涉及以下操作:
命令使用方式
命令调用链
Redis事务相关流程调用链(只关注与事务相关的逻辑)(基于Redis 7.0.15 版本)
命令处理(对应图中蓝色字部分)
详细代码解析(基于Redis 7.0.15 版本)
主要数据结构
WATCH命令实现
Beta Was this translation helpful? Give feedback.
All reactions