)]}'
{"zun/db/etcd/api.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"a8419b28e0d81dbe5d7f6d4272a107b9127e6cfb","unresolved":false,"context_lines":[{"line_number":490,"context_line":"    @lockutils.synchronized(\u0027etcd_resource_class\u0027)"},{"line_number":491,"context_line":"    def update_resource_class(self, context, class_name, values):"},{"line_number":492,"context_line":"        # Note(yuywz): Because \u0027ResourceClass\u0027 object does not have \u0027uuid\u0027,"},{"line_number":493,"context_line":"        # and etcd will not generate an \u0027id\u0027 for each \u0027ResourceClass\u0027, we"},{"line_number":494,"context_line":"        # must use \u0027name\u0027 as the unique ident and subpath for \u0027ResourceClass\u0027"},{"line_number":495,"context_line":"        # in etcd. Thus, a \u0027ResourceClass\u0027 whose \u0027name\u0027 is \u0027XYZ\u0027 will be"},{"line_number":496,"context_line":"        # stored under \u0027/resource_classes/XYZ\u0027 path, so when updating the"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_26041ac5","line":493,"range":{"start_line":493,"start_character":14,"end_line":493,"end_character":44},"updated":"2017-02-16 20:34:09.000000000","message":"@Wenzhi,\n\nI think this might cause some problem in the future. In the object layer, it expects both etcd and mysql will have the same data structure. If etcd returns {\u0027name\u0027: xxx} and mysql returns {\u0027name\u0027: xxx, \u0027id\u0027 x}, it might cause complication on processing and error-prompt.\n\nI think it is better to figure out a walk around for this. For example, how about generate an \u0027id\u0027 by ourselves and persist it to etcd?","commit_id":"a53d020d0985aa9afa1514bc192f4ddff8d275c8"},{"author":{"_account_id":13248,"name":"Wenzhi Yu","email":"wenzhi_yu@163.com","username":"yuywz"},"change_message_id":"d53ebf5e88f2199575d5464e0bf866fa36306a45","unresolved":false,"context_lines":[{"line_number":490,"context_line":"    @lockutils.synchronized(\u0027etcd_resource_class\u0027)"},{"line_number":491,"context_line":"    def update_resource_class(self, context, class_name, values):"},{"line_number":492,"context_line":"        # Note(yuywz): Because \u0027ResourceClass\u0027 object does not have \u0027uuid\u0027,"},{"line_number":493,"context_line":"        # and etcd will not generate an \u0027id\u0027 for each \u0027ResourceClass\u0027, we"},{"line_number":494,"context_line":"        # must use \u0027name\u0027 as the unique ident and subpath for \u0027ResourceClass\u0027"},{"line_number":495,"context_line":"        # in etcd. Thus, a \u0027ResourceClass\u0027 whose \u0027name\u0027 is \u0027XYZ\u0027 will be"},{"line_number":496,"context_line":"        # stored under \u0027/resource_classes/XYZ\u0027 path, so when updating the"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_63eb59b1","line":493,"range":{"start_line":493,"start_character":14,"end_line":493,"end_character":44},"in_reply_to":"fa31d9ce_26041ac5","updated":"2017-02-17 02:43:32.000000000","message":"@Hongbin, Sorry my note message confused you. Actually we do generate an \u0027id\u0027 in current etcd implementation. But the \u0027id\u0027 is hardcoded to be \u00271\u0027 for every objects, just to ensure the consistency with mysql, see [1].\n\nSo the \u0027id\u0027 makes no sense in etcd implementation, and we cannot use \u0027id\u0027 as ident to identify any objects in etcd implementation.\n\n[1]https://github.com/openstack/zun/blob/master/zun/db/etcd/models.py#L85\n\nPS: Do you think we need to insert a unique \u0027id\u0027 to objects stored in etcd as a ident?","commit_id":"a53d020d0985aa9afa1514bc192f4ddff8d275c8"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"688844895f57041f01706a44d943408ae62aa366","unresolved":false,"context_lines":[{"line_number":490,"context_line":"    @lockutils.synchronized(\u0027etcd_resource_class\u0027)"},{"line_number":491,"context_line":"    def update_resource_class(self, context, class_name, values):"},{"line_number":492,"context_line":"        # Note(yuywz): Because \u0027ResourceClass\u0027 object does not have \u0027uuid\u0027,"},{"line_number":493,"context_line":"        # and etcd will not generate an \u0027id\u0027 for each \u0027ResourceClass\u0027, we"},{"line_number":494,"context_line":"        # must use \u0027name\u0027 as the unique ident and subpath for \u0027ResourceClass\u0027"},{"line_number":495,"context_line":"        # in etcd. Thus, a \u0027ResourceClass\u0027 whose \u0027name\u0027 is \u0027XYZ\u0027 will be"},{"line_number":496,"context_line":"        # stored under \u0027/resource_classes/XYZ\u0027 path, so when updating the"}],"source_content_type":"text/x-python","patch_set":1,"id":"da36d5c6_8fc6d914","line":493,"range":{"start_line":493,"start_character":14,"end_line":493,"end_character":44},"in_reply_to":"fa31d9ce_63eb59b1","updated":"2017-02-17 21:10:41.000000000","message":"@Wenzhi,\n\nPersonally, I think we need to insert a unique \u0027id\u0027 in etcd. For resource class, I have a patch to convert between resource id and resource name: https://review.openstack.org/#/c/433994/3/zun/objects/resource_class.py . In addition, inventory/allocation needs to locate its resource provider by id, so the id needs to be unique.\n\nHowever, this seems to be a different topic. Please feel free to address it in a separated patch if you like.","commit_id":"a53d020d0985aa9afa1514bc192f4ddff8d275c8"}]}
