Live data from Hacker News

Are You Sure You Want to Use MMAP in Your Database Management System? (2022)

db.cs.cmu.edu

1–10 of 182 posts

Re: Are You Sure You Want to Use MMAP in Your Database Management System? (2022)

#2
Memory-Mapped Files = access violations when a disk read fails. If you're not prepared to handle those, don't use memory-mapped files. (Access violation exceptions are the same thing that happens when you attempt to read a null pointer)

Then there's the part with writes being delayed. Be prepared to deal with blocks not necessarily updating to disk in the order they were written to, and 10 seconds after the fact. This can make power failures cause inconsistencies.

Re: Are You Sure You Want to Use MMAP in Your Database Management System? (2022)

#8
post #2

Memory-Mapped Files = access violations when a disk read fails. If you're not prepared to handle those, don't use memory-mapped files. (Access violation exceptions are the same thing that happens when you attempt to read a null pointer) Then there's the part with writes being delayed. Be prepared to deal with blocks not necessarily updating to disk in the order they were written to, and 10 seconds after the fact. Thi…

> Be prepared to deal with blocks not necessarily updating to disk in the order they were written to, and 10 seconds after the fact. This can make power failures cause inconsistencies.

This is not specific to mmap -- regular old write() calls have the same behavior. You need to fsync() (or, with mmap, msync()) to guarantee data is on disk.

Re: Are You Sure You Want to Use MMAP in Your Database Management System? (2022)

#9
post #7

maybe a stupid question but what is wrong with coffee and spicy food?

For the majority of the world, nothing. But if your diet consists of fairly bland food then it can result in unpleasant trips to the toilet.

Acid reflux I thought

Re: Are You Sure You Want to Use MMAP in Your Database Management System? (2022)

#10
post #2

Memory-Mapped Files = access violations when a disk read fails. If you're not prepared to handle those, don't use memory-mapped files. (Access violation exceptions are the same thing that happens when you attempt to read a null pointer) Then there's the part with writes being delayed. Be prepared to deal with blocks not necessarily updating to disk in the order they were written to, and 10 seconds after the fact. Thi…

does that get delivered as SIGSEGV to the process or something else?
Post reply on HN