Earlier  
Posted Nick Remark
#openstack-nova - 2017-07-17
15:55:04 mriedem HostManager.get_host_states_by_uuids calls _get_host_states which returns a tuple
15:56:35 mriedem I think get_filtered_hosts is what converts to an iterator
15:56:41 mriedem hosts = six.itervalues(name_to_cls_map)
15:56:43 bauzas mriedem: the whole filters/weighers accepts an iterator
15:56:45 bauzas AFAIR
15:56:48 mriedem and passes that to filter_handler.get_filtered_objects
15:56:53 bauzas mriedem: yup
15:57:01 mriedem and ^ calls the filters
15:57:12 bauzas mriedem: but the thing is that we build a list once we get the weighed hosts
15:58:07 mriedem doesn't get_weighed_hosts return a sorted list?
15:59:36 mriedem ew now i see that WeighedObject is a wrapper around a HostState - wonder why someone used a wrapper rather than subclass HostState with a weight field?
15:59:45 mriedem WeighedHostState(HostState)
15:59:54 mriedem that's why we have that ugly host.obj.foo all over
16:00:37 mriedem anyway, i'm a bit lost in here wrt the iterator
16:01:13 bauzas yeah, seems like it's uglier than I thought
16:01:26 mriedem bauzas: the new _get_sorted_hosts method is still calling host_manager.get_filtered_hosts which still returns an iterator
16:01:44 bauzas mriedem: I was remembering we were using iterators, but looks like our filtering/weighing helpers work with lists...
16:01:46 mriedem and that iterator is still passed to host_manager.get_weighed_hosts
16:01:59 mriedem and weighed_hosts comes back as a sorted list
16:02:01 mriedem not an iterator
16:02:03 mriedem from what i can tell
16:02:07 bauzas yup
16:02:33 mriedem and by the time you get to chosen_host = hosts[0] it's really no different from before
16:02:38 mriedem so seems like something that doesn't matter to this change
16:02:42 bauzas I was just concerned by the new code taking more memory than previously, but it's just honestly not the case
16:02:48 bauzas yup
16:03:13 bauzas because we did work with iterators but once you enter filtering/weighting you're back to full lists of hosts anyway
16:03:42 bauzas anyway, I'm now looking at why that patch failed
16:05:23 bauzas mmmmpf http://logs.openstack.org/64/483564/2/gate/gate-nova-tox-functional-ubuntu-xenial/0f4534d/console.html#_2017-07-17_15_20_35_769898
16:09:25 mriedem shouldn't that also be running through other filters?
16:09:35 jaypipes mriedem, bauzas: that whole comment about it being an iterator is nonsense. As soon as it enters the filter host manager, it converts it all to a list: https://github.com/openstack/nova/blob/master/nova/filters.py#L69
16:09:39 mriedem like ServerGroupAntiAffinityFilter
16:09:58 mordred mriedem, sdague: if a client sends the legacy microversion header to a new nova, that's not an error, right? and if it sends both, that's also acceptable?
16:09:59 jaypipes mriedem: it was always trying to be too clever for its own good, IMHO.
16:10:07 bauzas jaypipes: yup, just saw that, see above the IRC discussion with matt
16:10:28 bauzas jaypipes: honestly, I'm not surprised
16:10:30 sdague mordred: correct, either are accepted
16:10:38 jaypipes mriedem: btw, I was trying to get rid of the host.obj foo nonsense.
16:10:48 sdague as are both, I think when both we take the standard one as gospel
16:10:58 mordred sdague: awesome. I believe I have a general solution to our earlier problem
16:11:06 bauzas jaypipes: someone probably did care of passing iterators, but someone else probably messed it up by just using lists afterwards
16:11:08 sdague cdent: I think you wrote the acceptor code, right?
16:11:16 mriedem jaypipes: yeah i noted that in the commit message
16:11:22 cdent sdague: yeah, it’s happy with both, prefers the newer one
16:11:22 mriedem less turducken is good
16:11:29 mordred cdent: sweet
16:11:40 bauzas jaypipes: anyway, it's not super critical, but something is : your patch is getting -1 because http://logs.openstack.org/64/483564/2/gate/gate-nova-tox-functional-ubuntu-xenial/0f4534d/console.html#_2017-07-17_15_20_35_769898
16:11:44 cdent it always sends both back in the response too
16:12:35 jaypipes bauzas: I can't reproduce that locally :(
16:12:57 openstackgerrit zhang zhenzhong proposed openstack/nova master: fix rp registration failed while placement endpoint created after compute start https://review.openstack.org/483460
16:13:15 bauzas jaypipes: I was just about to run it :)
16:13:38 mriedem http://logstash.openstack.org/#dashboard/file/logstash.json?query=message%3A%5C%22%2C%20in%20test_boot_servers_with_soft_anti_affinity_one_available_host%5C%22%20AND%20tags%3A%5C%22console%5C%22&from=7d
16:13:54 bauzas my child at home is killing my work because of netflix eating all the poor internet bandwidth FWIW
16:14:05 bauzas plex FTW
16:14:45 bauzas git pull is taking more than 1 min
16:14:53 mriedem fwiw, that test also failed in https://review.openstack.org/#/c/482288/
16:14:57 mriedem which would be totally unrelated
16:15:43 bauzas jaypipes: did you run the whole servergroup functional test group, or just the one failing?
16:15:51 jaypipes bauzas: both
16:15:53 bauzas k
16:16:14 bauzas last time I had such problem, it was because of the fixture
16:16:30 bauzas but I was able to reproduce it
16:19:39 mriedem so the test creates a soft-anti-affinity server group and kills the 2nd compute service so there should only be 1
16:19:51 mriedem since the 'soft' means it will go to the same host if there is only 1 available
16:19:56 sdague mriedem: you have an opinion on this - https://review.openstack.org/#/c/215385/21/nova/virt/ironic/client_wrapper.py - I thought we wanted N-1 compat
16:21:09 mriedem sdague: that's basically how it's always worked with nova + ironic as far as i know; yes it's not what we do with anything else
16:21:28 sdague mriedem: ok, well we definitely need upgrade stanza in the release notes then
16:22:06 mriedem i raised a similar concern in another nova ironic change,
16:22:36 mriedem https://review.openstack.org/#/c/419975/11/releasenotes/notes/add-interface-attach-detach-support-in-ironic-cb2bf11f3875350a.yaml@4
16:23:01 mriedem basically they implemented something in a driver and then started claiming support for hot plugging interfaces in nova
16:23:25 mriedem my argument was, what if my ironic is from ocata and i upgrade nova, and was told, that doesn't happen because everyone knows to upgrade ironic first
16:23:56 sdague mriedem: so... I'm extremely suspicious of "everybody knows"
16:24:10 sdague I'm fine with it being policy, but we still need upgrade notes
16:24:41 mriedem yeah they added one later here https://review.openstack.org/#/c/419975/17/releasenotes/notes/add-interface-attach-detach-support-in-ironic-cb2bf11f3875350a.yaml
16:25:16 sdague I'd be more happy with an N-1 policy, but we do need to communicate it every time it would trip people up
16:26:55 mriedem i don't disagree
16:29:56 mriedem jaypipes: bauzas: i have an idea on that failure
16:29:59 mriedem the functional test failure that is
16:30:07 jaypipes yeah?
16:30:09 bauzas ?
16:30:18 mriedem the test setup creates 2 compute services/nodes/hosts
16:30:25 mriedem you can see the 2nd host CN created here http://logs.openstack.org/64/483564/2/gate/gate-nova-tox-functional-ubuntu-xenial/0f4534d/console.html#_2017-07-17_15_20_35_768000
16:30:31 mriedem with uuid a945d18d-e6b6-4fd5-8b3b-e50c973a1ff9
16:30:35 mriedem and it's posted into placement
16:30:57 mriedem now the purpose of the test is to restrict to 1 host
16:30:58 mriedem so
16:30:59 mriedem self.compute2.kill()
16:31:02 mriedem HOWEVER
16:31:13 mriedem filter scheduler is getting it's hosties from placement now
16:31:19 mriedem so that RP is still floating around in placement
16:31:55 mriedem you can see the scheduler do it's thing here
16:31:55 mriedem GET /allocation_candidates?resources=DISK_GB%3A20%2CMEMORY_MB%3A2048%2CVCPU%3A1 HTTP/1.1" status: 200 len: 992 time: 0.0521650
16:32:02 mriedem and then
16:32:02 mriedem No compute service record found for host host2
16:32:10 mriedem because the test killed it
16:32:15 mriedem Filter RetryFilter returned 0 hosts
16:32:29 mriedem what i don't understand is why it doesn't try the other compute host
16:34:38 mriedem so one easy hack is deleting the host2 RP from test_boot_servers_with_soft_anti_affinity_one_available_host - but that's pretty hacky, it seems odd that the filtering wouldn't check the other host
16:35:34 jaypipes mriedem: it's also odd that this test fails randomly.
16:39:11 mriedem yeah so we get this https://github.com/openstack/nova/blob/master/nova/scheduler/host_manager.py#L674

Earlier   Later