Repository navigation
os/ObjectStore: properly clear object map when replaying OP_REMOVE - #11388
Merged
Merged
Conversation
tchaikov
reviewed
Oct 10, 2016
Contributor
There was a problem hiding this comment.
we always clear omap first, and then unlink the object file. so, if the hardlink is 1 here, we should have cleared the omap already, am i right?
Contributor
Author
There was a problem hiding this comment.
why? we get object file's hardlink count before clearing omap and unlinking object file. hardlink == 1 is the most common case
Member
There was a problem hiding this comment.
So to clarify the situation is
- clear omap
- unlink
- unlink persists to disk, but omap does not
- crash
- replay sees hardlink 0 and doesn't clear omap
?
To remove an object, filestore needs to unlink corresponding object file from filesystem and removes corresponding object keys from DBObjectMap. When replaying OP_REMOVE operation, it's possible the operation has completed partially, object file has been deleted, but object keys in DBObjectMap hasn't. The fix is force clear object keys if object file does not exists Fixes: http://tracker.ceph.com/issues/17177 Signed-off-by: Yan, Zheng <[email protected]>
…_RENAME FileStore::_close_replay_guard does not sync the object map. If OSD crashes while executing FileStore::_collection_move_rename, it's possible that the replay guard is set, but the object map map update gets lost. When recovering, OSD checks the replay guard and does nothing. The fix is sync the object map in FileStore::_close_replay_guard() Signed-off-by: Yan, Zheng <[email protected]>
Contributor
Author
|
ping @athanatos @liewegas @tchaikov |
Member
|
lgtm! |
Contributor
|
lgtm! (Whoa, good catch!) |
Contributor
|
lgtm also. |
Contributor
|
Thanks @ukernel Hopefully we can get this merged soon. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To remove an object, filestore needs to unlink corresponding object
file from filesystem and removes corresponding object keys from
DBObjectMap. When replaying OP_REMOVE operation, it's possible the
operation has completed partially, object file has been deleted, but
object keys in DBObjectMap hasn't.
The fix is force clear object keys if object file does not exists
Fixes: http://tracker.ceph.com/issues/17177
Signed-off-by: Yan, Zheng [email protected]