Skip to content

mgr/progress: Add recovery event when OSD marked in - #28498

Merged
tchaikov merged 3 commits into
ceph:masterfrom
kamoltat:wip-mgr-progress-add-event-osd-marked-in
Jun 20, 2019
Merged

tchaikov merged 3 commits into
ceph:masterfrom
kamoltat:wip-mgr-progress-add-event-osd-marked-in

Conversation

@kamoltat

Copy link
Copy Markdown
Member

Basically keeps track of affected PGs
similar to how funciton _osd_out works
but instead of tracking up+acting set
we only care about acting. Also made
a minor change on the function pg_update:
we consider pg to be complete when it
is active and clean and nothing else.
Removed the variable "unmoved" since
If the pg wasn't moved, we shouldn't
have an event for it in the first place.

Signed-off-by: Kamoltat (Junior) Sirivadhna [email protected]

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Basically keeps track of affected PGs
similar to how funciton _osd_out works
but instead of tracking up+acting set
we only care about acting. Also made
a minor change on the function pg_update:
we consider pg to be complete when it
is active and clean and nothing else.
Removed the variable "unmoved" since
If the pg wasn't moved, we shouldn't
have an event for it in the first place.

Signed-off-by: Kamoltat (Junior) Sirivadhna <[email protected]>
@kamoltat kamoltat changed the title mgr/progress: Add event when OSD marked in mgr/progress: Add recovery event when OSD marked in Jun 11, 2019
@tchaikov

Copy link
Copy Markdown
Contributor

jenkins, retest this please.

Comment thread src/pybind/mgr/progress/module.py Outdated
self._events[ev.id] = ev

def _osd_in(self, osd_id):
def _osd_in(self, old_map, old_dump, new_map, osd_id):

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.

since this is almost the same as _osd_out(), perhaps they could be combined into a single method with a parameter for in/out

Comment thread src/pybind/mgr/progress/module.py Outdated
for pool in old_dump['pools']:
pool_id = pool['pool']
for ps in range(0, pool['pg_num']):
up_acting = old_map.pg_to_up_acting_osds(pool['pool'], ps)

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.

for an osd being marked in, being in the new acting set, but not the old acting set, would be expected

Comment thread src/pybind/mgr/progress/module.py Outdated
up_acting = old_map.pg_to_up_acting_osds(pool['pool'], ps)

# Was this OSD affected by the OSD coming in?
old_osds = set(up_acting['acting'])

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.

@liewegas do you remember why the _osd_out case considers up + acting changes? since the current placement is defined by acting, it seems intuitive to only look at that

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.

I don't :(...

Combine the functions _osd_in and _osd_out in
to a single function call _osd_in_out, which
has a parameter called marked (string) that
will indicate if the event is when an osd is
marked in or out. Consider only the 'acting'
set of an osd for both when 'in' and 'out'
event of the osd to calculate affected PGs

Signed-off-by: Kamoltat (Junior) Sirivadhna <[email protected]>
Comment thread src/pybind/mgr/progress/module.py Outdated
old_osds = set(old_up_acting['acting'])

was_on_out_osd = osd_id in old_osds
if not was_on_out_osd:

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.

this check for the osd_id being in the acting set could be checking both the old and new maps, to cover both out and in cases, respectively

@jdurgin

jdurgin commented Jun 13, 2019

Copy link
Copy Markdown
Member

looks good! just one comment on the osd_id check

Added the check for osd_id to account for
the acting set of both the old and new maps
to cover both osd marked out and in
respectively

Signed-off-by: Kamoltat (Junior) Sirivadhna <[email protected]>
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