Skip to content
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

mds: fix dropping events in standby replay #12077

Merged
merged 1 commit into from Dec 7, 2016
Merged

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented Nov 18, 2016

Ensure that we never drop the last segment during
standby replay -- this avoids the case where we
start ignoring events because we think we're
still waiting to see a subtreemap.

Fixes: http://tracker.ceph.com/issues/17954
Signed-off-by: John Spray john.spray@redhat.com

@batrick
Copy link
Member

batrick commented Nov 21, 2016

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>

dout(10) << " segment seq=" << seg->seq << " " << seg->offset <<
"~" << seg->end - seg->offset << dendl;

if (seg->end > journaler->get_read_pos()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

seg->end is set to journaler->get_read_pos() after reading each log event. How can this test be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I wrote this branch when experimenting and forgot to remove it. The "segments.size() == 1" below is the part that really fixes the bug.

@jcsp
Copy link
Contributor Author

jcsp commented Nov 22, 2016

@ukernel does it look good now?

@jcsp
Copy link
Contributor Author

jcsp commented Nov 22, 2016

@ukernel
Copy link
Contributor

ukernel commented Nov 23, 2016

If I understand the code correctly. The code tries trimming all segments except the head one. This seems incorrect. (If a log segment is not expired by active MDS, updates in the segment haven't
been flushed to corresponding objects. If the standby replay MDS trim the log segment, updates in the segment may get lost if the standby MDS become active later)

Ensure that we never drop the last segment during
standby replay -- this avoids the case where we
start ignoring events because we think we're
still waiting to see a subtreemap.

Fixes: http://tracker.ceph.com/issues/17954
Signed-off-by: John Spray <john.spray@redhat.com>
@jcsp
Copy link
Contributor Author

jcsp commented Nov 23, 2016

Sorry, I messed this up when committing it. I originally mean to remove the "seg->end > journaler->get_read_pos()" condition and leave the "seg->end > expire_pos" condition, but I removed the wrong one. As you say, the expire_pos check still needs to be there.

@jcsp
Copy link
Contributor Author

jcsp commented Nov 24, 2016

(it's fixed now)

@ukernel
Copy link
Contributor

ukernel commented Nov 25, 2016

Reviewed-by: Yan, Zheng zyan@redhat.com

@jcsp jcsp merged commit d6b991a into ceph:master Dec 7, 2016
@jcsp jcsp deleted the wip-17954 branch December 7, 2016 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix cephfs Ceph File System
Projects
None yet
3 participants