-
Notifications
You must be signed in to change notification settings - Fork 175
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
Bitcask cannot recover from invalid or empty lock files #163
Comments
see also: #99 (comment) This is kind of a dup, except that it's more specific, I guess. As I noted in the other bug, I don't see a good way to solve this without adding a lot of logic that I think should be handled at a higher level. I'll open an issue against riak that details what I think should happen. |
The Erlang VM doesn't provide a file I/O interface to any of the common UNIX/POSIX lock-related functions: fcntl(2), flock(2), or lockf(3). So Bitcask is trying to do something sane that doesn't rely on them. Putting one of them into the Bitcask NIF is possible, but it introduces headaches for portability across UNIX variants. And none of them offer the exact same semantics with the others. Note that @bsparrow435's case of a zero-byte file can happen when a file system fills: there's enough room to create the file but not enough room to store any data. |
Can we use |
rename(2) won't work as it overwrites the destination. I'd do it as create temporary file Jon On Wed, Apr 16, 2014 at 9:04 AM, Reid Draper notifications@github.comwrote:
Jon Meredith |
Seems reasonable to me |
We already have a locking implementation; it isn't the best, but unless I |
I was just saying the locking algorithm we have is racy, and possibly
(harmless) messages we're seeing on a customer system. On Wed, Apr 16, 2014 at 10:14 AM, Evan Vigil-McClanahan <
Jon Meredith |
@evanmcc cool. I probably commented without understanding the issue well-enough. I just knew that rename(2) was atomic, so it might be another way of approaching the problem. |
between #72 and basho/riak#535, I think that this issue is covered, closing. |
Repro steps: Start a single node with bitcask, fill with enough data to have a few data files, stop node, create empty lock file, start node.
Errors:
The node sits in a sad loop, never recovering.
The text was updated successfully, but these errors were encountered: