Skip to content

osd/PG: discover missing objects when an OSD peers and PG is degraded - #27288

Merged
liewegas merged 1 commit into
ceph:masterfrom
TheJJ:fix-finding-remapped-source-osd
Apr 22, 2019
Merged

liewegas merged 1 commit into
ceph:masterfrom
TheJJ:fix-finding-remapped-source-osd

Conversation

@TheJJ

@TheJJ TheJJ commented Apr 1, 2019 •

Copy link
Copy Markdown
Contributor

When a PG is remapped from OSD a to OSD b, the objects are
backfilled. When OSD a is restarted, objects become degraded
as a is no longer queried or considered as a backfill source.

As the PG is degraded, PG::discover_all_missing is not called
when a candidate OSD peers with the primary: The PG is already
active, thus PG::activate (and in turn missing object discovery)
is not called. Discovery is also not initiated from
PG::RecoveryState::Active::react(const MNotifyRec& notevt)
as there are no unfound objects.

This patch adds a call to discover_all_missing when
when an OSD sends its MNotifyRec message and the PG is degraded.

Fixes: https://tracker.ceph.com/issues/37439
Signed-off-by: Jonas Jelten [email protected]

  • References tracker ticket

@neha-ojha
neha-ojha requested review from dzafman and neha-ojha April 1, 2019 21:02
@TheJJ
TheJJ force-pushed the fix-finding-remapped-source-osd branch from 43b4a58 to d564741 Compare April 2, 2019 11:17
Comment thread src/osd/PG.cc Resolved
@TheJJ
TheJJ force-pushed the fix-finding-remapped-source-osd branch from d564741 to 7947c93 Compare April 2, 2019 21:29
@TheJJ TheJJ changed the title osd/PG: discover unfound objects if PG is degraded osd/PG: perform missing objects discovery when a candidate OSD peers Apr 2, 2019
@TheJJ
TheJJ force-pushed the fix-finding-remapped-source-osd branch from 7947c93 to 8acc738 Compare April 2, 2019 23:29
Comment thread src/osd/PG.cc Resolved
@TheJJ
TheJJ force-pushed the fix-finding-remapped-source-osd branch from 8acc738 to 31ade33 Compare April 3, 2019 10:12

@xiexingguo xiexingguo left a comment

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.

👍

@TheJJ

TheJJ commented Apr 3, 2019

Copy link
Copy Markdown
Contributor Author

This is probably a hot candidate to be backported :)

Comment thread src/osd/PG.cc Resolved
@TheJJ
TheJJ force-pushed the fix-finding-remapped-source-osd branch 2 times, most recently from 32888aa to b21753a Compare April 4, 2019 20:59
@TheJJ TheJJ changed the title osd/PG: perform missing objects discovery when a candidate OSD peers osd/PG: discover missing objects when an OSD peers and PG is degraded Apr 4, 2019
@xiexingguo

xiexingguo commented Apr 8, 2019 •

Copy link
Copy Markdown
Member

@TheJJ @neha-ojha Sorry for not responding earlier(There was a national holiday last week).

I think a better idea would be combining those two checker together, e.g.:

if (pg->have_unfound() ||  (pg->is_degraded() && pg->might_have_unfound.count(notevt.from)))

because there are still some corner cases(e.g., because that peer is down, or has identical log with ours) we want to avoid sending out a MQuery message. (Not sure that will be causing problems, but since we are already aware of that, then we'd better not :-)

@TheJJ
TheJJ force-pushed the fix-finding-remapped-source-osd branch from b21753a to b3f0101 Compare April 8, 2019 08:56
@TheJJ

TheJJ commented Apr 8, 2019

Copy link
Copy Markdown
Contributor Author

I've update my patch but I'm more and more getting the feeling that the missing object discovery has to be somehow improved as it seems very fragile. In my intuition, calling PG::discover_all_missing should be very robust and only query actual candidate peers and is not able to crash other OSDs. 😃

@tchaikov

Copy link
Copy Markdown
Contributor

@neha-ojha good to merge?

@TheJJ

TheJJ commented Apr 11, 2019

Copy link
Copy Markdown
Contributor Author

I've applied the patch to one of my clusters and experienced horrible things, one OSD is now in such a broken state that whenever it is running, some PGs on it fail to peer and remain offline. When I shut down that OSD, the PGs become active again.

It seems unlikely that this patch causes such meltdown, but I just want to be sure my patch doesn't break things for other people unintentionally...

@neha-ojha

Copy link
Copy Markdown
Member

I've applied the patch to one of my clusters and experienced horrible things, one OSD is now in such a broken state that whenever it is running, some PGs on it fail to peer and remain offline. When I shut down that OSD, the PGs become active again.

It seems unlikely that this patch causes such meltdown, but I just want to be sure my patch doesn't break things for other people unintentionally...

Well, is just the application of this patch that caused problems or were there other things going on as well? If not, we should make sure that this patch is the right resolution.

@TheJJ

TheJJ commented Apr 12, 2019

Copy link
Copy Markdown
Contributor Author

Well, is just the application of this patch that caused problems or were there other things going on as well?

I've applied the patch and built the package for Ubuntu. Updated the ceph-osd-package and its dependencies. The cluster wasn't healthy, it's been plagued with the issue that this pullrequest aims to fix for a long time (i.e. ongoing rebalancing, then an OSD hangs/restarts/..., the remapped pg is degraded and tries to recover, wait until clean, repeat).

When I restarted some OSDs, some PGs became inactive and remained peering. In order to bring the cluster available again quickly, I didn't spend much time on investigating the exact reason, but after installing the original 14.2.0-osd again and restarting all OSDs, some (not all) PGs were still waiting for peering with one OSD, which is the one that had to be taken offline (systemctl stop) now.

As I said I'm really not sure if my patch caused this. Anyway, I'd really be glad if the bug this patch addresses is fixed one way or another 😃. I can imagine many clusters end up degraded and recovering even though not necessary.

When a PG is remapped from OSD `a` to OSD `b`, the objects are
backfilled. When OSD `a` is restarted, objects become degraded
as `a` is no longer queried or considered as a backfill source.

As the PG is degraded, `PG::discover_all_missing` is not called
when a candidate OSD peers with the primary: The PG is already
active, thus `PG::activate` (and in turn missing object discovery)
is not called. Discovery is also not initiated from
`PG::RecoveryState::Active::react(const MNotifyRec& notevt)`
as there are no unfound objects.

This patch adds a call to `discover_all_missing` when
when an OSD sends its `MNotifyRec` message and the PG is degraded.

Fixes: https://tracker.ceph.com/issues/37439
Signed-off-by: Jonas Jelten <[email protected]>
@TheJJ
TheJJ force-pushed the fix-finding-remapped-source-osd branch from b3f0101 to e152d09 Compare April 16, 2019 16:48
@TheJJ

TheJJ commented Apr 16, 2019

Copy link
Copy Markdown
Contributor Author

Do you need anything else or are we getting closer to a merge (and backport)? :)

@neha-ojha

Copy link
Copy Markdown
Member

Do you need anything else or are we getting closer to a merge (and backport)? :)

We were very close to merging this, but the fact that you saw problems after applying this patch, makes me a bit nervous.

I think I will run this through another round of testing, just to make sure we catch any bugs, before merging - better safe than sorry :)

@TheJJ

TheJJ commented Apr 16, 2019

Copy link
Copy Markdown
Contributor Author

Alright, that's good, thanks!

@liewegas
liewegas merged commit e152d09 into ceph:master Apr 22, 2019
liewegas added a commit that referenced this pull request Apr 22, 2019
* refs/pull/27288/head:
	osd/PG: discover missing objects when an OSD peers and PG is degraded

Reviewed-by: xie xingguo <[email protected]>
Reviewed-by: Neha Ojha <[email protected]>
@TheJJ

TheJJ commented Apr 23, 2019

Copy link
Copy Markdown
Contributor Author

\o/

@TheJJ
TheJJ deleted the fix-finding-remapped-source-osd branch April 23, 2019 13:41
@TheJJ

TheJJ commented Apr 30, 2019

Copy link
Copy Markdown
Contributor Author

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.

5 participants