Skip to content

mgr/cephadm: add config section to ServiceSpec#39648

Merged
sebastian-philipp merged 3 commits intoceph:masterfrom
liewegas:cephadm-spec-config
Feb 26, 2021
Merged

mgr/cephadm: add config section to ServiceSpec#39648
sebastian-philipp merged 3 commits intoceph:masterfrom
liewegas:cephadm-spec-config

Conversation

@liewegas
Copy link
Member

Pass config key/value pairs through and set them in teh appropriate section.
Disallow options that are managed by cephadm itself.

Checklist

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

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@liewegas liewegas requested a review from a team as a code owner February 23, 2021 18:56
Comment on lines +457 to +467
self.log.warning(
f'Ignoring invalid {spec.service_name()} config option {k}'
)
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

raise and make it a HEALTH warning? I don't like silent fails, as they make it super hard to debug stuff. Like "why is this config option not working at all?"

Also, would be great to validate them in the cli handler synchronously

Copy link
Member Author

Choose a reason for hiding this comment

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

very tedious to raise a health warning from here, but i added validation at apply time, so this would only happen if a spec had a config option that was removed from ceph (and i think that's pretty harmless)

Copy link
Contributor

Choose a reason for hiding this comment

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

might be harmless for the cluster, but not for users. Can you add something like

self.mgr.events.for_service(spec, 'ERROR', msg)

this is then displayed in https://docs.ceph.com/en/latest/cephadm/troubleshooting/#per-service-and-per-daemon-events and https://tracker.ceph.com/issues/49262

@sebastian-philipp
Copy link
Contributor

relates to https://tracker.ceph.com/issues/49490

Copy link
Contributor

@sebastian-philipp sebastian-philipp left a comment

Choose a reason for hiding this comment

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

lgtm! (except for the missing events)

Comment on lines +470 to +480
self.log.warning(
f'Failed to set {spec.service_name()} option {k}: {e}'
)
Copy link
Contributor

Choose a reason for hiding this comment

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

also

self.mgr.events.for_service(spec, 'ERROR', msg)

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Signed-off-by: Sage Weil <sage@newdream.net>
If a service is managing a config option, prevent the user from specifying
it in the spec.

Signed-off-by: Sage Weil <sage@newdream.net>
Make sure config options are valid/exist.

Signed-off-by: Sage Weil <sage@newdream.net>
@liewegas
Copy link
Member Author

@sebastian-philipp
Copy link
Contributor

one thing is missing: we're not cleaning those configs when removing the service. for that you need to hook into

def purge(self, service_name: str) -> None:
"""Called to carry out any purge tasks following service removal"""
logger.debug(f'Purge called for {self.TYPE} - no action taken')

@sebastian-philipp sebastian-philipp merged commit 6434723 into ceph:master Feb 26, 2021
@sebastian-philipp
Copy link
Contributor

sebastian-philipp commented Feb 26, 2021

I have a slight impression that this feature is a bit too generic. I wonder if we'll get tracker issues, cause this is a bit too generic. I don't know if we should advertise this as a cool new feature just yet. To some degree this feels like #37106 which we already know is not properly supported when upgrading.

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.

2 participants