Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

关于xlog在win上的运用问题 #492

Closed
OurPerfectWorld opened this issue Nov 29, 2018 · 5 comments
Closed

关于xlog在win上的运用问题 #492

OurPerfectWorld opened this issue Nov 29, 2018 · 5 comments

Comments

@OurPerfectWorld
Copy link

通过调试xlog的win版本,发现有个问题
使用createFileMapping创建map2文件后,此时的map2处于open状态
同时会对该文件上调用fopen操作(在mmap_util.cc中)
在ios上map2进行fopen是正常,并进行初始化文件内容
而win上会fopen失败,导致把map2文件删除,导致后面整个log的写入,和map2文件是毫无关系
这个是就这样设计还是bug来着?

@OurPerfectWorld
Copy link
Author

@garryyan

@garryyan
Copy link
Collaborator

garryyan commented Dec 4, 2018

已知问题 稍后我 fix 下

@OurPerfectWorld
Copy link
Author

nice
另外请教下,我方打算把map2改成最终的log生成文件,而不像xlog一样,当成一个中转文件,这个方案有什么弊端么

@garryyan
Copy link
Collaborator

garryyan commented Dec 4, 2018

占用内存会变大,而且你无法预知你的 log 文件将会是多大,除非你不停的去映射文件。当无法预知被映射的文件大小时,操作 mmap 将会是个麻烦的事情

@OurPerfectWorld
Copy link
Author

嗯嗯了解了,多谢。

garryyan added a commit that referenced this issue Dec 30, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants