← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1438503] [NEW] servicegroup.api.service_is_up() reports UP state for disabled hosts

 

Public bug reported:

In no way should a disabled service be considered "up". I checked the
code and indeed, there is no test for whether the service record from
the DB is disabled or not:

http://git.openstack.org/cgit/openstack/nova/tree/nova/servicegroup/drivers/db.py#n68

The DB driver's get_all() method -- which is used by, say, the scheduler
to grab a list of compute nodes that it can scheduler to -- *does* only
get the non-disabled hosts. You wouldn't know that by looking at the
servicegroup.drivers.db.Driver.get_all() code, though:

http://git.openstack.org/cgit/openstack/nova/tree/nova/servicegroup/drivers/db.py#n91

Since all it does is call the DB API's service_get_all_by_topic()
method.

However, look deeper in that method and lo and behold, there is a hard-
coded disabled=False filter in the SQLAlchemy query:

http://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/api.py#n479

The DB driver's is_up() method should check to see if the
service_ref['disabled'] field is False, otherwise, return False.

** Affects: nova
     Importance: Medium
         Status: New


** Tags: servicegroups

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1438503

Title:
  servicegroup.api.service_is_up() reports UP state for disabled hosts

Status in OpenStack Compute (Nova):
  New

Bug description:
  In no way should a disabled service be considered "up". I checked the
  code and indeed, there is no test for whether the service record from
  the DB is disabled or not:

  http://git.openstack.org/cgit/openstack/nova/tree/nova/servicegroup/drivers/db.py#n68

  The DB driver's get_all() method -- which is used by, say, the
  scheduler to grab a list of compute nodes that it can scheduler to --
  *does* only get the non-disabled hosts. You wouldn't know that by
  looking at the servicegroup.drivers.db.Driver.get_all() code, though:

  http://git.openstack.org/cgit/openstack/nova/tree/nova/servicegroup/drivers/db.py#n91

  Since all it does is call the DB API's service_get_all_by_topic()
  method.

  However, look deeper in that method and lo and behold, there is a
  hard-coded disabled=False filter in the SQLAlchemy query:

  http://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/api.py#n479

  The DB driver's is_up() method should check to see if the
  service_ref['disabled'] field is False, otherwise, return False.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1438503/+subscriptions


Follow ups

References