)]}'
{"nova/objects/instance_group.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c9892c7ea2277e4722418ffb08ca146ab3715849","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        filters \u003d {\u0027uuid\u0027: filter_uuids, \u0027deleted\u0027: False}"},{"line_number":202,"context_line":"        instances \u003d objects.InstanceList.get_by_filters(self._context,"},{"line_number":203,"context_line":"                                                        filters\u003dfilters)"},{"line_number":204,"context_line":"        # Determine the creation time of \"instance_uuid\""},{"line_number":205,"context_line":"        instance_created \u003d next(i.created_at for i in instances"},{"line_number":206,"context_line":"                                if i.uuid \u003d\u003d instance_uuid)"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da9b358b_2d09d431","line":204,"updated":"2015-03-31 22:09:10.000000000","message":"I really don\u0027t like using created_at for this level of protection. If we changed how and where created_at is set in the boot process, this would silently stop working. How about instance.id?","commit_id":"7e4a7998c27b735e75289c6dc7747e52c010970a"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"494077e41fdc41412361139986ddea86bfc5f26f","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        filters \u003d {\u0027uuid\u0027: filter_uuids, \u0027deleted\u0027: False}"},{"line_number":202,"context_line":"        instances \u003d objects.InstanceList.get_by_filters(self._context,"},{"line_number":203,"context_line":"                                                        filters\u003dfilters)"},{"line_number":204,"context_line":"        # Determine the creation time of \"instance_uuid\""},{"line_number":205,"context_line":"        instance_created \u003d next(i.created_at for i in instances"},{"line_number":206,"context_line":"                                if i.uuid \u003d\u003d instance_uuid)"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da9b358b_489886c0","line":204,"in_reply_to":"da9b358b_2d09d431","updated":"2015-03-31 22:14:22.000000000","message":"Yes, that should work.  I\u0027ll update this change and the following one.","commit_id":"7e4a7998c27b735e75289c6dc7747e52c010970a"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"a7606e1ca297946982c3e1f0b6cbaf05a8e3d19c","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        # Unique hosts for instances that were created earlier"},{"line_number":209,"context_line":"        # than instance_uuid."},{"line_number":210,"context_line":"        return list(set([i.host for i in instances"},{"line_number":211,"context_line":"                         if i.host and i.id \u003c instance_id]))"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    @base.remotable"},{"line_number":214,"context_line":"    def count_members_by_user(self, user_id):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da9b358b_9a9a416d","line":211,"updated":"2015-04-01 12:03:21.000000000","message":"The id doesn\u0027t mean it\u0027s landed on a host yet, that\u0027s allocated in the API, which means that the early items might still be moving around due to scheduler fails, right?","commit_id":"ec482145a9076c9f0712d56c0c458a01d8d8a95e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"b32ac553f95b086670a98bf206b74400ae9e234f","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        # Unique hosts for instances that were created earlier"},{"line_number":209,"context_line":"        # than instance_uuid."},{"line_number":210,"context_line":"        return list(set([i.host for i in instances"},{"line_number":211,"context_line":"                         if i.host and i.id \u003c instance_id]))"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    @base.remotable"},{"line_number":214,"context_line":"    def count_members_by_user(self, user_id):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa041b7_b4a918e2","line":211,"in_reply_to":"da9b358b_9a9a416d","updated":"2015-04-13 16:30:08.000000000","message":"It\u0027s landed on \"a\" host, but you\u0027re right that there\u0027s no guarantee that it\u0027s the final host for any but the earliest-created group member. Seems to help a lot in practice though, at least for the case of a few group members.\n\nFor the affinity case there\u0027s a followup patch that just checks the host of the earliest-created group member and makes sure all the others are the same.","commit_id":"ec482145a9076c9f0712d56c0c458a01d8d8a95e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"76cf5311e9a1a586474871a0840b681fe7e9c65f","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        This method allows you to get a list of the hosts where instances in"},{"line_number":196,"context_line":"        this group are currently running.  Instances which were created"},{"line_number":197,"context_line":"        after the specified instance are not considered (to avoid races with"},{"line_number":198,"context_line":"        multiple instances being created in close succession)."},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        filter_uuids \u003d self.members"},{"line_number":201,"context_line":"        filters \u003d {\u0027uuid\u0027: filter_uuids, \u0027deleted\u0027: False}"}],"source_content_type":"text/x-python","patch_set":9,"id":"dac4157f_7ba0c49f","line":198,"updated":"2015-04-21 16:49:16.000000000","message":"Adding a new remotable method is always like paying a debt and for each of those, we need to make sure it\u0027s really useful.\n\nBy looking at this one, I think we can just do the logic outside of that method by calling get_hosts() which should return a finite number of hosts (scales by O(n), n being the number of instances in the server group) and verifying for each that it doesn\u0027t contain instances whose ID is higher than the current instance ID to check","commit_id":"b91a6c02476d4ebb8daa0e9867d4b1a5500de851"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"5e81e0b1c4dcb32a5fb0245f1cfd625a69277cf2","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        This method allows you to get a list of the hosts where instances in"},{"line_number":196,"context_line":"        this group are currently running.  Instances which were created"},{"line_number":197,"context_line":"        after the specified instance are not considered (to avoid races with"},{"line_number":198,"context_line":"        multiple instances being created in close succession)."},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        filter_uuids \u003d self.members"},{"line_number":201,"context_line":"        filters \u003d {\u0027uuid\u0027: filter_uuids, \u0027deleted\u0027: False}"}],"source_content_type":"text/x-python","patch_set":9,"id":"dac4157f_ac4ce042","line":198,"in_reply_to":"dac4157f_7ba0c49f","updated":"2015-04-21 17:48:28.000000000","message":"As I understand it you are suggesting having nova-compute call get_hosts() to get a list of hosts.  Then for each host nova-compute would need to go and call InstanceList.get_by_host() to get the list of instances on that host. (Potentially tens to hundreds of instances.) It would then need to figure out the subset of those instances which are in the group, and then check their instance id and ignore instances newer than the current instance.  Any host with instances left would be added to the list.\n\nThat seems like a lot of work just to avoid a single remotable function.","commit_id":"b91a6c02476d4ebb8daa0e9867d4b1a5500de851"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"9e121694c4345ff300c7c5b9c7977b0aa3d5b202","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        This method allows you to get a list of the hosts where instances in"},{"line_number":196,"context_line":"        this group are currently running.  Instances which were created"},{"line_number":197,"context_line":"        after the specified instance are not considered (to avoid races with"},{"line_number":198,"context_line":"        multiple instances being created in close succession)."},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        filter_uuids \u003d self.members"},{"line_number":201,"context_line":"        filters \u003d {\u0027uuid\u0027: filter_uuids, \u0027deleted\u0027: False}"}],"source_content_type":"text/x-python","patch_set":9,"id":"dac4157f_ccb394e8","line":198,"in_reply_to":"dac4157f_ac4ce042","updated":"2015-04-21 17:55:27.000000000","message":"Okay, having thought about that, why not adding more in get_hosts() using a new argument ? I don\u0027t want to nitpick, I just need more time to think about the problem","commit_id":"b91a6c02476d4ebb8daa0e9867d4b1a5500de851"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"b17c1fc9e492fbd8efd9824d278c85532874d8f5","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        This method allows you to get a list of the hosts where instances in"},{"line_number":196,"context_line":"        this group are currently running.  Instances which were created"},{"line_number":197,"context_line":"        after the specified instance are not considered (to avoid races with"},{"line_number":198,"context_line":"        multiple instances being created in close succession)."},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        filter_uuids \u003d self.members"},{"line_number":201,"context_line":"        filters \u003d {\u0027uuid\u0027: filter_uuids, \u0027deleted\u0027: False}"}],"source_content_type":"text/x-python","patch_set":9,"id":"dac4157f_8c223c00","line":198,"in_reply_to":"dac4157f_ac4ce042","updated":"2015-04-21 18:06:52.000000000","message":"Sorry, brain wasn\u0027t working.  Rather than calling get_hosts() we could just call objects.InstanceList.get_by_filters() on the compute node and do the same logic as below.  I just assumed that it would be better to make it remotable to minimize overhead (from serializing all the instances in the group and passing them all over RPC to nova-compute) .  If the increased overhead is more acceptable than a new remotable function then I can certainly make that change.","commit_id":"b91a6c02476d4ebb8daa0e9867d4b1a5500de851"}]}
