Skip to content

os/ObjectStore: properly clear object map when replaying OP_REMOVE - #11388

Merged
yuriw merged 2 commits into
ceph:masterfrom
ukernel:wip-17177
Oct 24, 2016
Merged

yuriw merged 2 commits into
ceph:masterfrom
ukernel:wip-17177

Conversation

@ukernel

@ukernel ukernel commented Oct 10, 2016 •

Copy link
Copy Markdown
Contributor

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]

Comment thread src/os/filestore/FileStore.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? we get object file's hardlink count before clearing omap and unlinking object file. hardlink == 1 is the most common case

@liewegas liewegas Oct 14, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

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]>
@ukernel

ukernel commented Oct 14, 2016

Copy link
Copy Markdown
Contributor Author

ping @athanatos @liewegas @tchaikov

@liewegas

Copy link
Copy Markdown
Member

lgtm!

@athanatos

Copy link
Copy Markdown
Contributor

lgtm! (Whoa, good catch!)

@tchaikov

Copy link
Copy Markdown
Contributor

lgtm also.

@badone

badone commented Oct 18, 2016

Copy link
Copy Markdown
Contributor

Thanks @ukernel Hopefully we can get this merged soon.

@yuriw
yuriw merged commit 73a1b45 into ceph:master Oct 24, 2016
@ukernel
ukernel deleted the wip-17177 branch January 12, 2017 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants