GiraffaFS / giraffa

Giraffa FileSystem (Slack: giraffa-fs.slack.com)
https://giraffa.ci.cloudbees.com
Apache License 2.0
17 stars 6 forks source link

Delete time penalty for directories #173

Closed milandesai closed 9 years ago

milandesai commented 9 years ago

Because of HBASE-2256, a PUT that immediately follows a DELETE will fail if both operations have the same millisecond timestamp. As a result, we sleep 100ms after deleting a file (see: NamespaceProcessor.deleteFile). However, we don't currently do this after deleteDirectory, and HBASE-2256 has yet to be resolved after all these years. This means that when deleting a directory tree, we will sleep 100ms for every file that is deleted, and we will not sleep at all once the root of the tree is deleted. So not only would we sleep for an unnecessarily large time for a large quantity of files, a subsequent PUT with the same key as the deleted tree root may fail. This is incorrect behavior; we should instead sleep once after the whole delete operation is done. I am consistently encountering this problem in tests for #32.

milandesai commented 9 years ago

Created a test. It doesn't fail for me without the change because this is a race condition. But it might fail for someone without the change, and should never fail for anyone with the change. Ready for review.

shvachko commented 9 years ago

Milan, this looks good. Let's commit it first if #32 depends on it. Will need to merge with current trunk.

milandesai commented 9 years ago

Committed to trunk as 9664e62ca4760dad60af169e15cd685faecabdf5.