[17.08][ocata][pike] mongodb (shared-db) relation is required unconditionally

Bug #1717337 reported by Dmitrii Shcherbakov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Ceilometer Charm
Won't Fix
Medium
Unassigned

Bug Description

With gnocchi used for measure storage and ceilometer API deprecation we no longer need mongodb to be always present. However, we still need to maintain compatibility with old OpenStack versions and telemetry stack where ceilometer has metric storage responsibilities. Another complication is that ceilometer-upgrade in the ceilometer code itself tries to use mongodb on upgrade even if it is not configured.

https://github.com/openstack/charm-ceilometer/commit/72522a34

The problematic code-path:

assess_status|
https://github.com/openstack/charm-ceilometer/blob/stable/17.08/lib/ceilometer_utils.py#L355-L369
assess_status_func
https://github.com/openstack/charm-ceilometer/blob/stable/17.08/lib/ceilometer_utils.py#L384-L397

resolve_required_interfaces
required_ints = deepcopy(REQUIRED_INTERFACES)
https://github.com/openstack/charm-ceilometer/blob/stable/17.08/lib/ceilometer_utils.py#L372-L381

REQUIRED_INTERFACES = {
    'database': ['mongodb'],
https://github.com/openstack/charm-ceilometer/blob/stable/17.08/lib/ceilometer_utils.py#L104-L105

James pointed out that mongodb needs to be present on Ocata even if it is not needed:

https://github.com/openstack/charm-ceilometer/commit/72522a34#diff-d9b91c0550e242fbf5d1e4ee86924a35R161

This is due to the fact that the database upgrade code on Ocata

https://github.com/openstack/ceilometer/blob/stable/ocata/releasenotes/notes/rename-ceilometer-dbsync-eb7a1fa503085528.yaml

https://github.com/openstack/ceilometer/blob/stable/ocata/setup.cfg#L265
https://github.com/openstack/ceilometer/blob/stable/ocata/ceilometer/cmd/storage.py#L30-L53

https://github.com/openstack/ceilometer/commit/779673534fefc39633aed18bb020885bd6020e06

requires mongodb to be present unconditionally:

"connection" or "metering_connection" fetched by get_connection_from_config:
https://github.com/openstack/ceilometer/blob/stable/ocata/ceilometer/storage/__init__.py#L71-L73

get_connection_from_config used in "def upgrade":
https://github.com/openstack/ceilometer/blob/stable/ocata/ceilometer/cmd/storage.py#L46

on the charm side, connection option is only rendered if mongodb is present
https://github.com/openstack/charm-ceilometer/blob/stable/17.08/templates/ocata/ceilometer.conf#L43-L53

ceilometer_upgrade executes ceilometer-upgrade which triggers that ceilometer code:
https://github.com/openstack/charm-ceilometer/blob/master/lib/ceilometer_utils.py#L461-L470

--

We need to figure out some way around this while providing compatibility and a clear upgrade experience.

Could try to backport this change to Ocata https://github.com/openstack/ceilometer/commit/7905ff3a3 as well.

Changed in charm-ceilometer:
status: New → Triaged
importance: Undecided → Medium
Ante Karamatić (ivoks)
tags: added: cpe-onsite
removed: cpec
Ryan Beisner (1chb1n)
tags: added: uosci
Revision history for this message
James Page (james-page) wrote :

Note that for queens, mongodb is not required and that's implemented in the current next charms.

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

So, for 18.02 charms and Pike+ this is now usable without mongodb.

https://github.com/openstack/charm-ceilometer/blame/stable/18.02/lib/ceilometer_utils.py#L566-L570

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

This has been overtaken by events. No current supported version of the charm requires mongodb.

Changed in charm-ceilometer:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.