LOG the wrong attached configuration

Bug #1693466 reported by zhanggang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Undecided
zhanggang

Bug Description

location: trove/cluster/models.py
Class Cluster
method: rolling_configuration_update.

******************************************************************************************
 if not (instance.configuration and
     instance.configuration.id != configuration_id):
   self.context.notification = (
     DBaaSInstanceAttachConfiguration(self.context,
                     **request_info))
   with StartNotification(self.context,               instance_id=instance.id,
              configuration_id=configuration_id):
     with EndNotification(self.context):
       instance.save_configuration(configuration)
 else:
      LOG.debug(
                "Node '%(inst_id)s' already has the configuration "
                "'%(conf_id)s' attached.",
               {'inst_id': instance.id, 'conf_id': configuration_id})
******************************************************************************************

if condition False means the instance has attached a configuration, but the configuration is not the one I want to attach.
So, in else block, should use "instance.configuration.id" instead of "configuration_id", one is a attached configuration, one is a wanted configuration, and they are not the same.

zhanggang (gangzh)
Changed in trove:
assignee: nobody → zhanggang (gangzh)
description: updated
description: updated
description: updated
description: updated
zhanggang (gangzh)
description: updated
Revision history for this message
Trevor McCasland (twm2016) wrote :

I think the intent of the log is to say the configuration_id is the same. So it doesn't matter which one you use.

Changed in trove:
status: New → Confirmed
status: Confirmed → Invalid
Revision history for this message
Trevor McCasland (twm2016) wrote :

Oh I see now, in the event where configuration is attached you need to log the config that is acutally attached. The log message in the code now is just for the configuration_ids being the same. I think if we break it up into a if, elif, else with an additional log that will be better.

Changed in trove:
status: Invalid → Confirmed
Revision history for this message
zhanggang (gangzh) wrote :

There are some comments about this part: " # Allow re-applying the same configuration (e.g. on configuration updates)."

It allow attach the same configuration to a attached instance. So I think use a if and a else is fine, just consider two conditions: 1.The instance has attached a different configuration. 2. All of the rest conditions.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/469351

Changed in trove:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/469351
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=650235435d599a2151cdaf8a46c91651fa6d7a08
Submitter: Jenkins
Branch: master

commit 650235435d599a2151cdaf8a46c91651fa6d7a08
Author: zhanggang <email address hidden>
Date: Wed May 31 02:28:30 2017 -0400

    Log the right attached configuration id

    Method 'rolling_configuration_update' in trove/cluster/models.py.
    It allow re-applying the same configuration to an instance.In if code
    block, if the instance does not attach any configuration or it has
    attached the configuration that the parameter passed, then do attach
    thing. "else" block means the instance has attached another config,
    should use "instance.configuration.id" instead of "configuration_id",
    one is a attached configuration, one is a wanted configuration, and
    they are not the same.
    Besides, fix a spelling mistake in trove/instance/models.py

    Change-Id: I4b6fb338de611ce39a8173dcf4b6e17714c380b9
    Closes-Bug: 1693466

Changed in trove:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/trove 8.0.0.0b3

This issue was fixed in the openstack/trove 8.0.0.0b3 development milestone.

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.