empty replica_set from config can clobber url-based replica set for mongodb

Bug #1505669 reported by Chris Dent
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ceilometer
Invalid
Undecided
Unassigned
Liberty
Fix Released
High
Chris Dent

Bug Description

In <Mitaka, In ceilometer.storage.mongo.utils the value of CONF.database.mongodb_replica_set will always be used when creating a connection to mongodb. In situations where replica_set is being provided by the database connection URL the defalut value of '' can override the URL and cause connection failures.

The likely solution is to guard the creation of the MongoClient to check for replica_set having a value and only passing the arg if so.

This problem is not present in Mitaka because in that version the mongodb_replica_set version is gone.

Revision history for this message
Chris Dent (cdent) wrote :

Because of the change in config handling between Mitaka and Liberty for replica_set, we can't simply backport from Mitaka.

Alan Pevec (apevec)
tags: added: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/234254

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/liberty)

Reviewed: https://review.openstack.org/234254
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=d91e1916c6c34892dd1026954bc7327ee4c1898e
Submitter: Jenkins
Branch: stable/liberty

commit d91e1916c6c34892dd1026954bc7327ee4c1898e
Author: Chris Dent <email address hidden>
Date: Tue Oct 13 14:27:09 2015 +0000

    If mongodb_replica_set is empty do not pass it to client

    Otherwise a replicaSet parameter in a db connection URL will be
    clobbered by the empty configuration setting.

    Note that this is a direct patch to stable/liberty, not a backport from
    master because master has changed such that there is no longer a
    mongodb_replica_set configuration setting.

    Change-Id: Ic8de93f58ff1cf21888719597490f987d703cab6
    Closes-Bug: #1505669

gordon chung (chungg)
Changed in ceilometer:
status: New → Invalid
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/ceilometer 5.0.1

This issue was fixed in the openstack/ceilometer 5.0.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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