)]}'
{"neutron/plugins/bigswitch/db/consistency_db.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d4600133a1901bbc9b32942480624516997657d2","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        # one is in the middle of a transaction"},{"line_number":81,"context_line":"        res \u003d (self.session.query(ConsistencyHash)."},{"line_number":82,"context_line":"               filter_by(hash_id\u003dself.hash_id)."},{"line_number":83,"context_line":"               with_lockmode(\u0027update\u0027).first())"},{"line_number":84,"context_line":"        if not res:"},{"line_number":85,"context_line":"            self.session.close()"},{"line_number":86,"context_line":"            self.session_started \u003d False"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_8bb0b98c","line":83,"updated":"2014-06-10 14:50:44.000000000","message":"Consider that Galera doesn\u0027t not handle SELECT FOR...UPDATE well. More details here http://lists.openstack.org/pipermail/openstack-dev/2014-May/035264.html\n\nI don\u0027t think a lock is really needed here. Locking the table here is just adding a race condition between the read_for_update and put_hash in acquiring the lock. There is always the possibility that the read_for_update acquires it before and reads data that are gonna been stale the next second. Adding a lock is also making a rollback more possible, especially in an HA setup. The node that acquired that lock will win and the other will have to rollback the transaction.\n\nMy suggestion is avoid locking here and adding a strategy that consider the possibility of getting stale data. Maybe refreshing the data every interval?","commit_id":"437e8542fb7af2fb51b1fcb633eeed5c0fe058fe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d4600133a1901bbc9b32942480624516997657d2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"               filter_by(hash_id\u003dself.hash_id)."},{"line_number":83,"context_line":"               with_lockmode(\u0027update\u0027).first())"},{"line_number":84,"context_line":"        if not res:"},{"line_number":85,"context_line":"            self.session.close()"},{"line_number":86,"context_line":"            self.session_started \u003d False"},{"line_number":87,"context_line":"            return \u0027\u0027"},{"line_number":88,"context_line":"        self.hash_db_obj \u003d res"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_86543055","line":85,"updated":"2014-06-10 14:50:44.000000000","message":"If this condition is not verified, where are you closing the session?","commit_id":"437e8542fb7af2fb51b1fcb633eeed5c0fe058fe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d4600133a1901bbc9b32942480624516997657d2","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        self.session.commit()"},{"line_number":101,"context_line":"        self.session.close()"},{"line_number":102,"context_line":"        self.session_started \u003d False"},{"line_number":103,"context_line":"        LOG.error(_(\"Consistency hash for group %(hash_id)s updated \""},{"line_number":104,"context_line":"                    \"to %(hash)s\"), {\u0027hash_id\u0027: self.hash_id, \u0027hash\u0027: hash})"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_46586832","line":103,"updated":"2014-06-10 14:50:44.000000000","message":"why error level?","commit_id":"437e8542fb7af2fb51b1fcb633eeed5c0fe058fe"}]}
