I can not reproduce the problem, I see SQL has used
'compute_nodes.deleted = 0' to filter deleted services as the following
debug info shows (mitaka).

(Pdb) <oslo_db.sqlalchemy.orm.Query object at 0x7f97672b9810>
(Pdb) 'SELECT count(compute_nodes.id) AS count_1, sum(compute_nodes.vcpus) AS 
sum_1, sum(compute_nodes.memory_mb) AS sum_2, sum(compute_nodes.local_gb) AS 
sum_3, sum(compute_nodes.vcpus_used) AS sum_4, 
sum(compute_nodes.memory_mb_used) AS sum_5, sum(compute_nodes.local_gb_used) AS 
sum_6, sum(compute_nodes.free_ram_mb) AS sum_7, sum(compute_nodes.free_disk_gb) 
AS sum_8, sum(compute_nodes.current_workload) AS sum_9, 
sum(compute_nodes.running_vms) AS sum_10, 
sum(compute_nodes.disk_available_least) AS sum_11 \nFROM compute_nodes, 
services \nWHERE compute_nodes.deleted = :deleted_1 AND services.disabled = 0 
AND services."binary" = :binary_1 AND (services.host = compute_nodes.host OR 
services.id = compute_nodes.service_id)'

This is result I run above SQL in mysql directly, all are OK.

mysql> SELECT count(compute_nodes.id) AS count_1, sum(compute_nodes.vcpus) AS 
sum_1, sum(compute_nodes.memory_mb) AS sum_2, sum(compute_nodes.local_gb) AS 
sum_3, sum(compute_nodes.vcpus_used) AS sum_4, 
sum(compute_nodes.memory_mb_used) AS sum_5, sum(compute_nodes.local_gb_used) AS 
sum_6, sum(compute_nodes.free_ram_mb) AS sum_7, sum(compute_nodes.free_disk_gb) 
AS sum_8, sum(compute_nodes.current_workload) AS sum_9, 
sum(compute_nodes.running_vms) AS sum_10, 
sum(compute_nodes.disk_available_least) AS sum_11 FROM compute_nodes, services 
WHERE compute_nodes.deleted = 0 AND services.disabled = 0 AND services.binary = 
'nova-compute' AND (services.host = compute_nodes.host OR services.id = 
compute_nodes.service_id);
+---------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+
| count_1 | sum_1 | sum_2 | sum_3 | sum_4 | sum_5 | sum_6 | sum_7 | sum_8 | 
sum_9 | sum_10 | sum_11 |
+---------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+
|       2 |     4 |  7902 |    76 |     0 |  1024 |     0 |  6878 |    76 |     
0 |      0 |     72 |
+---------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+
1 row in set (0.00 sec)

mysql> SELECT sum(compute_nodes.vcpus) FROM compute_nodes, services WHERE 
compute_nodes.deleted = 0 AND services.disabled = 0 AND services.binary = 
'nova-compute' AND (services.host = compute_nodes.host OR services.id = 
compute_nodes.service_id);
+--------------------------+
| sum(compute_nodes.vcpus) |
+--------------------------+
|                        4 |
+--------------------------+
1 row in set (0.00 sec)

Below are steps I used to create test env:

1, There are 3 nova-compute nodes initially.

2, Then use 'openstack compute service delete 10' to delete one compute
service.

3, 'select * from services where id=10' will show deleted field of this
record is not 0 no longer.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1719770

Title:
  hypervisor stats issue after charm removal if nova-compute service not
  disabled first

To manage notifications about this bug go to:
https://bugs.launchpad.net/charm-nova-compute/+bug/1719770/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to