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

m1 系统 server 关闭后没有执行刷盘导致重启数据失效 #77

Closed
iiiuwioajdks opened this issue Sep 13, 2022 · 3 comments
Closed

Comments

@iiiuwioajdks
Copy link

m1 系统 kill server 之后会因为文件没有刷盘而导致重启获取不到数据
用 ls -l 查看可以发现在 kill 后文件没有修改

@hnwyllmm
Copy link
Collaborator

现在的代码实现中,在进程退出时,是会调用sync接口同步数据到磁盘的。
可以看下m1系统上是否在kill时,可以正常退出

@iiiuwioajdks
Copy link
Author

iiiuwioajdks commented Sep 14, 2022

现在的代码实现中,在进程退出时,是会调用sync接口同步数据到磁盘的。
可以看下m1系统上是否在kill时,可以正常退出

我试了一下,在 ctrl+c 和 kill 下是可以走到 clean up 刷盘的,在使用 kill -9 的情况下只会走到 quit_thread_func 而不会返回到 main 中

@hnwyllmm
Copy link
Collaborator

kill -9 是一个特殊的信号,是应用程序无法捕获的一个信号,所以无法处理此信号。
解决这种问题的方式通常是使数据库支持redo/undo日志,然后再数据库应用程序重新启动时做恢复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants