basho / bitcask

because you need another a key/value storage engine
1.28k stars 171 forks source link

Lock file staleness check could be more robust [JIRA: RIAK-2230] #226

Open JKoff opened 8 years ago

JKoff commented 8 years ago

A few days ago, we started getting {error,locked} errors on certain puts in a development environment. After some digging, I found that bitcask_lockops:delete_stale_lock/1 was incorrectly returning not_stale for bitcask.write.lock files when the pid had been reassigned (in our case to a rabbitmq beam process.) This is because it uses kill -0, which merely verifies a process' existence, not its identity.

A workaround is to stop Riak and delete all bitcask.write.lock files.