Repository navigation
mgr/cephadm: get rbd-mirror daemon-id when checking for strays - #37397
Merged
Merged
Conversation
mgfritch
reviewed
Sep 25, 2020
mgfritch
left a comment
Contributor
There was a problem hiding this comment.
This works or could also use a defaultdict ?
defaults = defaultdict(lambda: None, {'id' : None})
metadata = self.get_metadata(s.get('type'), s.get('id')), default=defaults)
if metadata['id']:
name = '%s.%s' % (s.get('type'), metadata['id'])
else:
self.log.debug(f"Failed to find daemon id for rbd-mirror service {s.get('id')}")
Contributor
|
jenkins test make check |
jmolmo
reviewed
Sep 25, 2020
Currently, list_servers() gets the rbd-mirror service-id instead of the daemon-id so the daemon is marked as stray. This PR uses that service-id to find the daemon-id and uses that to check if the daemon is stray. Fixes: https://tracker.ceph.com/issues/47639 Signed-off-by: Adam King <[email protected]>
Contributor
Author
|
Swapped to using a defaultdict rather than try, catch block. More in line with #35161 |
Contributor
Author
|
jenkins test docs |
Contributor
|
can we add a teuthology test for this? I.e. removeing an rbd-mirror service and validating the daemons go away |
jmolmo
approved these changes
Sep 28, 2020
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.
Currently, list_servers() gets the rbd-mirror service-id instead
of the daemon-id so the daemon is marked as stray. This PR uses
that service-id to find the daemon-id and uses that to check if
the daemon is stray.
Fixes: https://tracker.ceph.com/issues/47639
Signed-off-by: Adam King [email protected]
NOTE: There is a chance that after removing the rbd-mirror service
_check_for_strayscan run again before the metadata has updated causing an rbd-mirror daemon that doesn't exist anymore to be marked as a stray daemon until the_check_for_straysis run again after the metadata updates itself. This PR doesn't cause that issue (it could already happen before) but it doesn't fix it either.