Public bug reported: If a compute node references a deleted service, we will include it in the compute node statistics output. This happens even if the compute node record _is_ deleted, because of our join of the services table, which causes us to get back rows anyway. This results in the stats showing more resource than actually exists, and disagreeing with the sum of all the individual hypervisor-show operations.
This is the query we're doing: MariaDB [nova]> SELECT SUM(memory_mb) FROM compute_nodes JOIN services ON compute_nodes.host=services.host WHERE services.binary="nova-compute" AND compute_nodes.deleted=0; +----------------+ | SUM(memory_mb) | +----------------+ | 1047917 | +----------------+ 1 row in set (0.00 sec) And this is what we *should* be doing MariaDB [nova]> SELECT SUM(memory_mb) FROM compute_nodes JOIN services ON compute_nodes.host=services.host WHERE services.binary="nova-compute" AND compute_nodes.deleted=0 AND services.deleted=0; +----------------+ | SUM(memory_mb) | +----------------+ | 655097 | +----------------+ 1 row in set (0.00 sec) The second value is correct for the database in question. ** Affects: nova Importance: Undecided Status: Won't Fix -- 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/1693911 Title: compute node statistics will lie if service records are deleted Status in OpenStack Compute (nova): Won't Fix Bug description: If a compute node references a deleted service, we will include it in the compute node statistics output. This happens even if the compute node record _is_ deleted, because of our join of the services table, which causes us to get back rows anyway. This results in the stats showing more resource than actually exists, and disagreeing with the sum of all the individual hypervisor-show operations. This is the query we're doing: MariaDB [nova]> SELECT SUM(memory_mb) FROM compute_nodes JOIN services ON compute_nodes.host=services.host WHERE services.binary="nova-compute" AND compute_nodes.deleted=0; +----------------+ | SUM(memory_mb) | +----------------+ | 1047917 | +----------------+ 1 row in set (0.00 sec) And this is what we *should* be doing MariaDB [nova]> SELECT SUM(memory_mb) FROM compute_nodes JOIN services ON compute_nodes.host=services.host WHERE services.binary="nova-compute" AND compute_nodes.deleted=0 AND services.deleted=0; +----------------+ | SUM(memory_mb) | +----------------+ | 655097 | +----------------+ 1 row in set (0.00 sec) The second value is correct for the database in question. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1693911/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp