)]}'
{"networking_ovn/common/constants.py":[{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0d6d27c7d0c52b55e11c630fc372ec495677583e","unresolved":false,"context_lines":[{"line_number":152,"context_line":"DEFAULT_ADDR_FOR_LSP_WITH_PEER \u003d \u0027router\u0027"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"# Hash Ring constants"},{"line_number":155,"context_line":"HASH_RING_NODES_TIMEOUT \u003d 60"},{"line_number":156,"context_line":"HASH_RING_CACHE_TIMEOUT \u003d 30"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_36a8d6d9","line":156,"range":{"start_line":155,"start_character":0,"end_line":156,"end_character":28},"updated":"2019-05-22 10:25:59.000000000","message":"any specific reasons for these timeouts?","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"43fc11eefe60fead1c162414d9ddea5a645cbcf2","unresolved":false,"context_lines":[{"line_number":152,"context_line":"DEFAULT_ADDR_FOR_LSP_WITH_PEER \u003d \u0027router\u0027"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"# Hash Ring constants"},{"line_number":155,"context_line":"HASH_RING_NODES_TIMEOUT \u003d 60"},{"line_number":156,"context_line":"HASH_RING_CACHE_TIMEOUT \u003d 30"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_96ac228d","line":156,"range":{"start_line":155,"start_character":0,"end_line":156,"end_character":28},"in_reply_to":"bfb3d3c7_36a8d6d9","updated":"2019-05-22 10:28:35.000000000","message":"I was wondering the same. Then I realized it\u0027s best to do some empiric testing and tune those values later. Because to do the testing, you need the code in first :)","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e619b5e3c9e416e154ab18f4104c0858818d006e","unresolved":false,"context_lines":[{"line_number":152,"context_line":"DEFAULT_ADDR_FOR_LSP_WITH_PEER \u003d \u0027router\u0027"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"# Hash Ring constants"},{"line_number":155,"context_line":"HASH_RING_NODES_TIMEOUT \u003d 60"},{"line_number":156,"context_line":"HASH_RING_CACHE_TIMEOUT \u003d 30"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_f6c6be49","line":156,"range":{"start_line":155,"start_character":0,"end_line":156,"end_character":28},"in_reply_to":"bfb3d3c7_36a8d6d9","updated":"2019-05-22 10:35:28.000000000","message":"Most common sense and small tests results. We soon will test it at scale (we got a hand on an env to try) so we can stress it a lot more.","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"}],"networking_ovn/common/exceptions.py":[{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0d6d27c7d0c52b55e11c630fc372ec495677583e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"class HashRingIsEmpty(n_exc.NeutronException):"},{"line_number":40,"context_line":"    _message \u003d _(\u0027Hash Ring returned empty when hashing \"%(key)s\". \u0027"},{"line_number":41,"context_line":"                 \u0027This should never happen in a normal situation, please \u0027"},{"line_number":42,"context_line":"                 \u0027check the status of your cluster\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_96b8a22a","line":42,"range":{"start_line":42,"start_character":50,"end_line":42,"end_character":52},"updated":"2019-05-22 10:25:59.000000000","message":"nit: \".\"","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e619b5e3c9e416e154ab18f4104c0858818d006e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"class HashRingIsEmpty(n_exc.NeutronException):"},{"line_number":40,"context_line":"    _message \u003d _(\u0027Hash Ring returned empty when hashing \"%(key)s\". \u0027"},{"line_number":41,"context_line":"                 \u0027This should never happen in a normal situation, please \u0027"},{"line_number":42,"context_line":"                 \u0027check the status of your cluster\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_76e08ecd","line":42,"range":{"start_line":42,"start_character":50,"end_line":42,"end_character":52},"in_reply_to":"bfb3d3c7_96b8a22a","updated":"2019-05-22 10:35:28.000000000","message":"I actually removed the period because the rest of the exceptions above are not using it either. Trying to be consistent.","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"}],"networking_ovn/common/hash_ring_manager.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"8d75b1505f9c93abeb1fb8f95bcc308c2e2da510","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        except KeyError:"},{"line_number":66,"context_line":"            LOG.warning(\"The Hash Ring is empty. This should never happen \""},{"line_number":67,"context_line":"                        \"in a normal situation, please check the status of \""},{"line_number":68,"context_line":"                        \"your cluster.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_768660de","line":68,"updated":"2019-05-21 16:11:45.000000000","message":"Maybe we should raise en exception here too instead of returning None. I imagine the manager is used in a followup patch and we will need to bail out in case cluster is in wrong state and no node was found in the hashring.","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"82cba88ea8dff139d4f967b13fe9f5747da6f80a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        except KeyError:"},{"line_number":66,"context_line":"            LOG.warning(\"The Hash Ring is empty. This should never happen \""},{"line_number":67,"context_line":"                        \"in a normal situation, please check the status of \""},{"line_number":68,"context_line":"                        \"your cluster.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_6b766ba7","line":68,"in_reply_to":"bfb3d3c7_483e0ddb","updated":"2019-05-22 09:21:10.000000000","message":"Sounds good! I will update the code to do it","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c99cf81ccfe9c67da5ed04c6af6490c4a88a447f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        except KeyError:"},{"line_number":66,"context_line":"            LOG.warning(\"The Hash Ring is empty. This should never happen \""},{"line_number":67,"context_line":"                        \"in a normal situation, please check the status of \""},{"line_number":68,"context_line":"                        \"your cluster.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_a821c9fd","line":68,"in_reply_to":"bfb3d3c7_768660de","updated":"2019-05-22 09:10:41.000000000","message":"The problem of raising an exception here is that it will bubble up to the IDL class (the OVSDB connection), it\u0027s not gonna be visible to the user.\n\nI don\u0027t envision this happening, but it\u0027s a safe-guard to keep the services running even when things go bad, because, nodes can join/leave the cluster at any time and it would auto-correct itself. If we send an exception and the connection stops (if we don\u0027t handle there) we may have a bigger problem.\n\nWhat you think ? Perhaps bumping the LOG level to ERROR or CRITICAL would be something to consider ?","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f2e29e6045b76d30b087de0db7c881bcc6d2fbc6","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        except KeyError:"},{"line_number":66,"context_line":"            LOG.warning(\"The Hash Ring is empty. This should never happen \""},{"line_number":67,"context_line":"                        \"in a normal situation, please check the status of \""},{"line_number":68,"context_line":"                        \"your cluster.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_483e0ddb","line":68,"in_reply_to":"bfb3d3c7_a821c9fd","updated":"2019-05-22 09:18:58.000000000","message":"I thought that when we use get_node() somewhere and this unlike scenario happens, we\u0027ll get None while expecting node-uuid. And we will need to do some error handling anyways there, won\u0027t we. So if we raise the exception here, we can do error handling in the caller in except block.","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0d6d27c7d0c52b55e11c630fc372ec495677583e","unresolved":false,"context_lines":[{"line_number":64,"context_line":"            # KeyError is raised"},{"line_number":65,"context_line":"            return self._hash_ring[key].pop()"},{"line_number":66,"context_line":"        except KeyError:"},{"line_number":67,"context_line":"            raise exceptions.HashRingIsEmpty(key\u003dkey)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_969e6261","line":67,"range":{"start_line":67,"start_character":29,"end_line":67,"end_character":44},"updated":"2019-05-22 10:25:59.000000000","message":"I dont think there would ever be a case where the _hash_ring has the key but it doesnt have a value to pop ?(Guess the exception would go up directly in that case)","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e619b5e3c9e416e154ab18f4104c0858818d006e","unresolved":false,"context_lines":[{"line_number":64,"context_line":"            # KeyError is raised"},{"line_number":65,"context_line":"            return self._hash_ring[key].pop()"},{"line_number":66,"context_line":"        except KeyError:"},{"line_number":67,"context_line":"            raise exceptions.HashRingIsEmpty(key\u003dkey)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_f639de3e","line":67,"range":{"start_line":67,"start_character":29,"end_line":67,"end_character":44},"in_reply_to":"bfb3d3c7_969e6261","updated":"2019-05-22 10:35:28.000000000","message":"The key is never in the hash ring, although tooz uses a dict-like syntax, see [0].\n\nOnly the values it returns are part of the ring and if it contains no node or if all nodes timeout it will raise an KeyError exception. I also find it very unlikely to happen in any real scenario but, I wanna be on the safe side and not let the service explode if it does since the idea of the ring is to be flexible. Nodes can leave or join the cluster at any time and it should correct itself.\n\n[0]\n\nIn [1]: from tooz import hashring                   \n\nIn [2]: hr \u003d hashring.HashRing({\u0027node1\u0027, \u0027node2\u0027})  \n\nIn [3]: hr[b\u0027key-does-not-exist-in-the-ring\u0027]       \nOut[3]: {\u0027node2\u0027}","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"7945000354e73ab43a622bbc023699cced6a9360","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # startup time and since many services may be started concurrently"},{"line_number":41,"context_line":"        # we do not want to use a cached hash ring at that point. This"},{"line_number":42,"context_line":"        # method checks if the created_at and updated_at columns from the"},{"line_number":43,"context_line":"        # nodes in the ring from this node is equal, and if so it means"},{"line_number":44,"context_line":"        # that the service just started."},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # If the startup timeout already expired, there\u0027s no reason to"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfb3d3c7_5728e484","line":43,"range":{"start_line":43,"start_character":38,"end_line":43,"end_character":42},"updated":"2019-05-22 12:31:43.000000000","message":"nit: host\n\nWould be less confusing I think","commit_id":"30bb380c7f03a0f65becdb15c0dc00861af9f5d6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"73263b37b4a87b333aa2a3a4c56e72844c40b8e7","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        # that the service just started."},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # If the startup timeout already expired, there\u0027s no reason to"},{"line_number":47,"context_line":"        # keep reading from the DB. From now on this will always"},{"line_number":48,"context_line":"        # return False"},{"line_number":49,"context_line":"        if not self._cache_startup_timeout:"},{"line_number":50,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfb3d3c7_97dadc14","line":47,"range":{"start_line":47,"start_character":36,"end_line":47,"end_character":52},"updated":"2019-05-22 13:08:33.000000000","message":"nit:at this point?","commit_id":"30bb380c7f03a0f65becdb15c0dc00861af9f5d6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"72cae56746f93bf208974d59fe037b0533c007d0","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        # that the service just started."},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # If the startup timeout already expired, there\u0027s no reason to"},{"line_number":47,"context_line":"        # keep reading from the DB. From now on this will always"},{"line_number":48,"context_line":"        # return False"},{"line_number":49,"context_line":"        if not self._cache_startup_timeout:"},{"line_number":50,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfb3d3c7_9f50b20c","line":47,"range":{"start_line":47,"start_character":36,"end_line":47,"end_character":52},"in_reply_to":"bfb3d3c7_97dadc14","updated":"2019-05-22 14:30:48.000000000","message":"Done","commit_id":"30bb380c7f03a0f65becdb15c0dc00861af9f5d6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"73263b37b4a87b333aa2a3a4c56e72844c40b8e7","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        cache_timeout \u003d timeutils.utcnow() - datetime.timedelta("},{"line_number":62,"context_line":"            seconds\u003dconstants.HASH_RING_CACHE_TIMEOUT)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        # If the hash ring is forced to refresh or just started up or"},{"line_number":65,"context_line":"        # not yet instantiated or cache timed out."},{"line_number":66,"context_line":"        if (refresh or"},{"line_number":67,"context_line":"                self._wait_startup_before_caching or"},{"line_number":68,"context_line":"                self._hash_ring is None or"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfb3d3c7_b7ee00b2","line":65,"range":{"start_line":64,"start_character":9,"end_line":65,"end_character":50},"updated":"2019-05-22 13:08:33.000000000","message":"too many ors :)\nMaybe you can write it differently, like:\n\n # Active nodes are retrieved if :\n # - Hash Ring is Refreshed\n # - Hash Ring just started\n # - Hash Ring is not instantiatied\n # - Cache has timed out","commit_id":"30bb380c7f03a0f65becdb15c0dc00861af9f5d6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"72cae56746f93bf208974d59fe037b0533c007d0","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        cache_timeout \u003d timeutils.utcnow() - datetime.timedelta("},{"line_number":62,"context_line":"            seconds\u003dconstants.HASH_RING_CACHE_TIMEOUT)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        # If the hash ring is forced to refresh or just started up or"},{"line_number":65,"context_line":"        # not yet instantiated or cache timed out."},{"line_number":66,"context_line":"        if (refresh or"},{"line_number":67,"context_line":"                self._wait_startup_before_caching or"},{"line_number":68,"context_line":"                self._hash_ring is None or"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfb3d3c7_ff40ce37","line":65,"range":{"start_line":64,"start_character":9,"end_line":65,"end_character":50},"in_reply_to":"bfb3d3c7_b7ee00b2","updated":"2019-05-22 14:30:48.000000000","message":"Heh true yeah","commit_id":"30bb380c7f03a0f65becdb15c0dc00861af9f5d6"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"459baac09c4109461097d1b622bb4a134b2eda61","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @property"},{"line_number":38,"context_line":"    def _wait_startup_before_caching(self):"},{"line_number":39,"context_line":"        # NOTE(lucasagomes): Some events are processed at the service\u0027s"},{"line_number":40,"context_line":"        # startup time and since many services may be started concurrently"},{"line_number":41,"context_line":"        # we do not want to use a cached hash ring at that point. This"},{"line_number":42,"context_line":"        # method checks if the created_at and updated_at columns from the"},{"line_number":43,"context_line":"        # nodes in the ring from this host is equal, and if so it means"},{"line_number":44,"context_line":"        # that the service just started."},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # If the startup timeout already expired, there\u0027s no reason to"},{"line_number":47,"context_line":"        # keep reading from the DB. At this point this will always"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfb3d3c7_a7dd5d71","line":44,"range":{"start_line":39,"start_character":0,"end_line":44,"end_character":40},"updated":"2019-05-23 09:11:34.000000000","message":"++ Thanks!!!","commit_id":"3af381003e8ae78f56cae81a58dbc641c23485ee"}],"networking_ovn/db/hash_ring.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"8d75b1505f9c93abeb1fb8f95bcc308c2e2da510","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    session \u003d db_api.get_writer_session()"},{"line_number":48,"context_line":"    with session.begin():"},{"line_number":49,"context_line":"        session.query(models.OVNHashRing).filter_by("},{"line_number":50,"context_line":"            hostname\u003dCONF.host).update({\u0027updated_at\u0027: timeutils.utcnow()})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def get_active_nodes(interval):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_76e0a0fb","line":50,"range":{"start_line":50,"start_character":54,"end_line":50,"end_character":72},"updated":"2019-05-21 16:11:45.000000000","message":"I\u0027m a bit confused about onupdate on the db model and manual update here. AFAIU we\u0027re gonna get update_at bumped whenever we update the particular row, which we never do. What I\u0027m afraid of is any side-effect caused by updating the column on two places.","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c99cf81ccfe9c67da5ed04c6af6490c4a88a447f","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    session \u003d db_api.get_writer_session()"},{"line_number":48,"context_line":"    with session.begin():"},{"line_number":49,"context_line":"        session.query(models.OVNHashRing).filter_by("},{"line_number":50,"context_line":"            hostname\u003dCONF.host).update({\u0027updated_at\u0027: timeutils.utcnow()})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def get_active_nodes(interval):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_a8fd493b","line":50,"range":{"start_line":50,"start_character":54,"end_line":50,"end_character":72},"in_reply_to":"bfb3d3c7_76e0a0fb","updated":"2019-05-22 09:10:41.000000000","message":"That\u0027s a good point. At first I had added a column called \"online\" (boolean) and I was updating it but, I found that column useless and decided to reuse the \"updated_at\" which would let me achieve the same.\n\nI think we can change the model to remove the onupdate as you pointed out.","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f2e29e6045b76d30b087de0db7c881bcc6d2fbc6","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    session \u003d db_api.get_writer_session()"},{"line_number":48,"context_line":"    with session.begin():"},{"line_number":49,"context_line":"        session.query(models.OVNHashRing).filter_by("},{"line_number":50,"context_line":"            hostname\u003dCONF.host).update({\u0027updated_at\u0027: timeutils.utcnow()})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def get_active_nodes(interval):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_eb3b3bce","line":50,"range":{"start_line":50,"start_character":54,"end_line":50,"end_character":72},"in_reply_to":"bfb3d3c7_a8fd493b","updated":"2019-05-22 09:18:58.000000000","message":"Yes, maybe I\u0027m too paranoid but I was afraid of side-effect when update_at will be bumped by the sql backend, although I see we never change any other column. We\u0027ll just need to pass updated_at manually when creating the record.","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6e82370b34b708c314918d7695e3125c7f70690b","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    session \u003d db_api.get_writer_session()"},{"line_number":48,"context_line":"    with session.begin():"},{"line_number":49,"context_line":"        session.query(models.OVNHashRing).filter_by("},{"line_number":50,"context_line":"            hostname\u003dCONF.host).update({\u0027updated_at\u0027: timeutils.utcnow()})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def get_active_nodes(interval):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_ab07831c","line":50,"range":{"start_line":50,"start_character":54,"end_line":50,"end_character":72},"in_reply_to":"bfb3d3c7_eb3b3bce","updated":"2019-05-22 10:03:44.000000000","message":"Oh, we actually don\u0027t need to create the timestamp as it uses default and not onupdate :) Sorry","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0d6d27c7d0c52b55e11c630fc372ec495677583e","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def touch_nodes_from_host():"},{"line_number":47,"context_line":"    session \u003d db_api.get_writer_session()"},{"line_number":48,"context_line":"    with session.begin():"},{"line_number":49,"context_line":"        session.query(models.OVNHashRing).filter_by("},{"line_number":50,"context_line":"            hostname\u003dCONF.host).update({\u0027updated_at\u0027: timeutils.utcnow()})"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_165a72f2","line":47,"range":{"start_line":47,"start_character":21,"end_line":47,"end_character":39},"updated":"2019-05-22 10:25:59.000000000","message":"can we get the reader/writer session in a single go?\nI think it can be done in another patch, but just wondering, since the functions all retrieve the session before proceeding forward. If its working more like a semaphore, I think this works","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e619b5e3c9e416e154ab18f4104c0858818d006e","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def touch_nodes_from_host():"},{"line_number":47,"context_line":"    session \u003d db_api.get_writer_session()"},{"line_number":48,"context_line":"    with session.begin():"},{"line_number":49,"context_line":"        session.query(models.OVNHashRing).filter_by("},{"line_number":50,"context_line":"            hostname\u003dCONF.host).update({\u0027updated_at\u0027: timeutils.utcnow()})"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_168352ce","line":47,"range":{"start_line":47,"start_character":21,"end_line":47,"end_character":39},"in_reply_to":"bfb3d3c7_165a72f2","updated":"2019-05-22 10:35:28.000000000","message":"I believe the writer session can also be used to read ? Not sure if that\u0027s what u mean.\n\nIn this case, this function only writes to the database so I need a writer session for it regardless.","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"73263b37b4a87b333aa2a3a4c56e72844c40b8e7","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def touch_nodes_from_host():"},{"line_number":47,"context_line":"    session \u003d db_api.get_writer_session()"},{"line_number":48,"context_line":"    with session.begin():"},{"line_number":49,"context_line":"        session.query(models.OVNHashRing).filter_by("},{"line_number":50,"context_line":"            hostname\u003dCONF.host).update({\u0027updated_at\u0027: timeutils.utcnow()})"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_b74360af","line":47,"range":{"start_line":47,"start_character":21,"end_line":47,"end_character":39},"in_reply_to":"bfb3d3c7_168352ce","updated":"2019-05-22 13:08:33.000000000","message":"You can ignore the comment, what I thought was keep the get_writer_session in a common function, but it doesnt give any sort of benefits","commit_id":"75e40fafd5458efb530ddc64e2c27c35e6bb1c4f"}],"networking_ovn/db/migration/alembic_migrations/versions/stein/expand/4a478c5c1e16_add_ovn_hash_ring_table.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"8d75b1505f9c93abeb1fb8f95bcc308c2e2da510","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        sa.Column(\u0027created_at\u0027, sa.DateTime, nullable\u003dFalse,"},{"line_number":39,"context_line":"                  default\u003dsa.func.now()),"},{"line_number":40,"context_line":"        sa.Column(\u0027updated_at\u0027, sa.TIMESTAMP, default\u003dsa.func.now(),"},{"line_number":41,"context_line":"                  onupdate\u003dsa.func.now(), nullable\u003dTrue),"},{"line_number":42,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_16d0441f","line":41,"range":{"start_line":41,"start_character":42,"end_line":41,"end_character":55},"updated":"2019-05-21 16:11:45.000000000","message":"Do we need nullable when we have the default set?","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c99cf81ccfe9c67da5ed04c6af6490c4a88a447f","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        sa.Column(\u0027created_at\u0027, sa.DateTime, nullable\u003dFalse,"},{"line_number":39,"context_line":"                  default\u003dsa.func.now()),"},{"line_number":40,"context_line":"        sa.Column(\u0027updated_at\u0027, sa.TIMESTAMP, default\u003dsa.func.now(),"},{"line_number":41,"context_line":"                  onupdate\u003dsa.func.now(), nullable\u003dTrue),"},{"line_number":42,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_c8719d0e","line":41,"range":{"start_line":41,"start_character":42,"end_line":41,"end_character":55},"in_reply_to":"bfb3d3c7_16d0441f","updated":"2019-05-22 09:10:41.000000000","message":"No, too much CTRL+C/CTRL+V. My bad","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"}],"networking_ovn/db/models.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"8d75b1505f9c93abeb1fb8f95bcc308c2e2da510","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class OVNHashRing(model_base.BASEV2):"},{"line_number":44,"context_line":"    __tablename__ \u003d \u0027ovn_hash_ring\u0027"},{"line_number":45,"context_line":"    __table_args__ \u003d ("},{"line_number":46,"context_line":"        model_base.BASEV2.__table_args__"},{"line_number":47,"context_line":"    )"},{"line_number":48,"context_line":"    node_uuid \u003d sa.Column(sa.String(36), nullable\u003dFalse, primary_key\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_56b6bcfc","line":45,"updated":"2019-05-21 16:11:45.000000000","message":"nit: Do we need to wrap a line here?","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c99cf81ccfe9c67da5ed04c6af6490c4a88a447f","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class OVNHashRing(model_base.BASEV2):"},{"line_number":44,"context_line":"    __tablename__ \u003d \u0027ovn_hash_ring\u0027"},{"line_number":45,"context_line":"    __table_args__ \u003d ("},{"line_number":46,"context_line":"        model_base.BASEV2.__table_args__"},{"line_number":47,"context_line":"    )"},{"line_number":48,"context_line":"    node_uuid \u003d sa.Column(sa.String(36), nullable\u003dFalse, primary_key\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_485fed71","line":45,"in_reply_to":"bfb3d3c7_56b6bcfc","updated":"2019-05-22 09:10:41.000000000","message":"No, too much CTRL+C/CTRL+V. My bad","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"}],"networking_ovn/tests/unit/common/test_hash_ring_manager.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"8d75b1505f9c93abeb1fb8f95bcc308c2e2da510","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        # Now assert that the ring was re-balanced and only the node from"},{"line_number":85,"context_line":"        # another host is marked as alive"},{"line_number":86,"context_line":"        self.hash_ring_manager.refresh()"},{"line_number":87,"context_line":"        self.assertEqual(1, len(self.hash_ring_manager._hash_ring.nodes))"},{"line_number":88,"context_line":"        self.assertEqual([another_host_node],"},{"line_number":89,"context_line":"                         list(self.hash_ring_manager._hash_ring.nodes.keys()))"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_24cc3269","line":87,"updated":"2019-05-21 16:11:45.000000000","message":"Isn\u0027t this redundant to the below? We test that the list having one item is equal.","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c99cf81ccfe9c67da5ed04c6af6490c4a88a447f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        # Now assert that the ring was re-balanced and only the node from"},{"line_number":85,"context_line":"        # another host is marked as alive"},{"line_number":86,"context_line":"        self.hash_ring_manager.refresh()"},{"line_number":87,"context_line":"        self.assertEqual(1, len(self.hash_ring_manager._hash_ring.nodes))"},{"line_number":88,"context_line":"        self.assertEqual([another_host_node],"},{"line_number":89,"context_line":"                         list(self.hash_ring_manager._hash_ring.nodes.keys()))"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bfb3d3c7_68c75114","line":87,"in_reply_to":"bfb3d3c7_24cc3269","updated":"2019-05-22 09:10:41.000000000","message":"++ true, will be removed","commit_id":"09eba181f5cfb3573c839778dcdc672d0bfd9b61"}],"networking_ovn/tests/unit/db/test_hash_ring.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"840745bfad0e8f5edabf16f96c65f8c0c093d212","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        another_host_id \u003d \u0027another-host-52359446-c366\u0027"},{"line_number":125,"context_line":"        with mock.patch.object(db_hash_ring, \u0027CONF\u0027) as mock_conf:"},{"line_number":126,"context_line":"            mock_conf.host \u003d another_host_id"},{"line_number":127,"context_line":"            self._add_nodes_and_assert_exists()[0]"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        # Assert only the 3 nodes from this host is returned"},{"line_number":130,"context_line":"        active_nodes \u003d db_hash_ring.get_active_nodes(interval\u003d60,"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfb3d3c7_fcac5f36","line":127,"range":{"start_line":127,"start_character":47,"end_line":127,"end_character":50},"updated":"2019-05-22 13:13:06.000000000","message":"nit: I assume we don\u0027t need this as we don\u0027t store the node anywhere.","commit_id":"30bb380c7f03a0f65becdb15c0dc00861af9f5d6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"72cae56746f93bf208974d59fe037b0533c007d0","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        another_host_id \u003d \u0027another-host-52359446-c366\u0027"},{"line_number":125,"context_line":"        with mock.patch.object(db_hash_ring, \u0027CONF\u0027) as mock_conf:"},{"line_number":126,"context_line":"            mock_conf.host \u003d another_host_id"},{"line_number":127,"context_line":"            self._add_nodes_and_assert_exists()[0]"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        # Assert only the 3 nodes from this host is returned"},{"line_number":130,"context_line":"        active_nodes \u003d db_hash_ring.get_active_nodes(interval\u003d60,"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfb3d3c7_6cf67efc","line":127,"range":{"start_line":127,"start_character":47,"end_line":127,"end_character":50},"in_reply_to":"bfb3d3c7_fcac5f36","updated":"2019-05-22 14:30:48.000000000","message":"Oops!\n\nSure I will remove it when/if I need to send a new patch-set","commit_id":"30bb380c7f03a0f65becdb15c0dc00861af9f5d6"}]}
