Hacker News new | ask | show | jobs
by halukakin 2468 days ago
The way i understand it, it is not crash safe. It can now persist data in some cases.

However redis is crash safe to about 1 second before crash or so, if not even better.

1 comments

With fsync_always it's crash safe for all but the most pathological scenarios.
But it's performance is way worst, almost voiding the case for choosing Redis.
I have not found this to be true. I suppose it depends on your use case and deployment.
How? It's persisting to a RAM disk. It only properly cleans up when sent a specific shutdown signal.
Sorry fsync_always is a redis setting, not memcached. The fsync is to a real disk.

The parent poster's comment about redis being crash safe to 1s is just the default.

I do wonder what happens when a process writes to a memory mapped file, but crashes before the page is synced to disk. Does the write disappear?
If the OS is still alive, everything is ok (but the OS may sync different pages at different times and in any order if you don't fsync specific ranges with special calls). If the whole machine crashes (power issue, kernel panic, ...), what you find on disk can be a mess.
> what you find on disk can be a mess

Is this "can be" determined by the backing filesystem? E.g., would you expect to get a clean result from a log-structured or copy-on-write filesystem?