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

存在日志丢失的情形 #12

Open
1623040547 opened this issue Oct 9, 2024 · 1 comment
Open

存在日志丢失的情形 #12

1623040547 opened this issue Oct 9, 2024 · 1 comment

Comments

@1623040547
Copy link

在写入文件之前将m_LogBuffer中的数据转移至了一个临时的AutoBuffer, AutoBuffer没有进行mmap映射,在Flush->WriteToFile之间若应用被杀死,可能导致日志丢失。
image

@1623040547 1623040547 changed the title [email protected] 存在日志丢失的情形 Oct 9, 2024
@lixiaoyu0123
Copy link

在写入文件之前将m_LogBuffer中的数据转移至了一个临时的AutoBuffer, AutoBuffer没有进行mmap映射,在Flush->WriteToFile之间若应用被杀死,可能导致日志丢失。 image

是的,会存在这种情况丢失数据的情况
考虑到使用过多mmap,涉及数据恢复会增加很大的逻辑复杂性。 边界条件的收益不是很高。所以没有再用mmap去兜底。
腾讯的xlog目前也是这种情况。

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