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

redis AOF重写描述不准确以及一个小错误 #1439

Closed
xjlgod opened this issue Nov 6, 2021 · 3 comments
Closed

redis AOF重写描述不准确以及一个小错误 #1439

xjlgod opened this issue Nov 6, 2021 · 3 comments
Labels
enhancement New feature or request or suggestion

Comments

@xjlgod
Copy link
Contributor

xjlgod commented Nov 6, 2021

原文为
1.服务器会将重写缓冲区中的所有内容追加到新 AOF 文件的末尾,使得新旧两个 AOF 文件所保存的数据库状态一致。最后,服务器用新的 AOF 文件替换旧的 AOF 文件,以此来完成 AOF 文件重写操作。
如果新旧两个 AOF 文件所保存的数据库状态一致,为什么还需要替换呢?我不知道我的理解是否正确,谢谢大佬抽空review。
2.然后还有个地方装箱和拆箱写反了。
已经提交了pr

@la-jiao-you
Copy link

根据《Redis设计与实现》P143-P149的描述,是用一个子进程在后台对服务器内的所有键值对进行查看并重写set类型(zset、hset等)的命令,然后写入到AOF重写文件中,并通过aof重写缓冲区记录在这个过程中的新产生的写命令,并在aof重写完毕后将aof重写缓冲区内的内容追加到新的AOF文件中,并完成替换。在此期间会存在有两个缓冲区一个是aof重写缓冲区和aof缓冲区,aof缓冲区保证原本的aof持久化继续。

@Snailclimb
Copy link
Owner

已经提交了pr

👍

@Snailclimb Snailclimb added the enhancement New feature or request or suggestion label Nov 24, 2021
@buptLiYangCode
Copy link

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request or suggestion
Projects
None yet
Development

No branches or pull requests

4 participants