)]}'
{"octavia/api/v2/controllers/listener.py":[{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"575a01b14a03fe6931528cc5a65e89e45dac52b8","unresolved":false,"context_lines":[{"line_number":40,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"L4_PROTOCOL_MAP \u003d {"},{"line_number":44,"context_line":"    constants.PROTOCOL_TCP: ("},{"line_number":45,"context_line":"        constants.PROTOCOL_TCP,"},{"line_number":46,"context_line":"        constants.PROTOCOL_HTTP,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_ed4a9d59","line":43,"updated":"2019-08-08 15:48:07.000000000","message":"This might be valuable in other places, we should move it to octavia/common/constants.py","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"dbbd883ceaf2e515ea0afc6c5bdf6feaf34b4927","unresolved":false,"context_lines":[{"line_number":40,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"L4_PROTOCOL_MAP \u003d {"},{"line_number":44,"context_line":"    constants.PROTOCOL_TCP: ("},{"line_number":45,"context_line":"        constants.PROTOCOL_TCP,"},{"line_number":46,"context_line":"        constants.PROTOCOL_HTTP,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_9638cdee","line":43,"in_reply_to":"7faddb67_ed4a9d59","updated":"2019-08-09 08:30:03.000000000","message":"done, and the map was inverted","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"9879d6ea947fc84da40a1ae96b23f456afd0b380","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                listener_dict.get(\u0027client_crl_container_id\u0027, None))"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # Validate that the L4 protocol (UDP or TCP) is not already used for"},{"line_number":247,"context_line":"        # the specified protocol_port in this load balancer"},{"line_number":248,"context_line":"        l4_protocol \u003d None"},{"line_number":249,"context_line":"        for p in L4_PROTOCOL_MAP:"},{"line_number":250,"context_line":"            if listener_protocol in L4_PROTOCOL_MAP[p]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_cbbe1b64","line":247,"updated":"2019-08-01 16:10:14.000000000","message":"I\u0027m not sure why we need to do this. Won\u0027t the DB constraint catch this and raise the appropriate error for the user?\nIt would be nice to avoid this additional DB query and simply rely on the DB constraint to catch these.","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"575a01b14a03fe6931528cc5a65e89e45dac52b8","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                listener_dict.get(\u0027client_crl_container_id\u0027, None))"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # Validate that the L4 protocol (UDP or TCP) is not already used for"},{"line_number":247,"context_line":"        # the specified protocol_port in this load balancer"},{"line_number":248,"context_line":"        l4_protocol \u003d None"},{"line_number":249,"context_line":"        for p in L4_PROTOCOL_MAP:"},{"line_number":250,"context_line":"            if listener_protocol in L4_PROTOCOL_MAP[p]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_b0a2bcfb","line":247,"in_reply_to":"7faddb67_91ae147f","updated":"2019-08-08 15:48:07.000000000","message":"Thank you, I get it now. It\u0027s that there are a class of protocols that all come down to being TCP or UDP.","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"9a8c0ef1b095ae3e34cceef6ce177bf208e9b4b4","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                listener_dict.get(\u0027client_crl_container_id\u0027, None))"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # Validate that the L4 protocol (UDP or TCP) is not already used for"},{"line_number":247,"context_line":"        # the specified protocol_port in this load balancer"},{"line_number":248,"context_line":"        l4_protocol \u003d None"},{"line_number":249,"context_line":"        for p in L4_PROTOCOL_MAP:"},{"line_number":250,"context_line":"            if listener_protocol in L4_PROTOCOL_MAP[p]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_91ae147f","line":247,"in_reply_to":"7faddb67_cbbe1b64","updated":"2019-08-01 17:34:23.000000000","message":"The goal is to raise exception when 2 protocols that share the same l4 protocol, use the same port (we want to allow 2 listeners such as udp:53 and tcp:53, but also we want to detect when 2 listeners use tcp:80 and http:80 in the same LB), I don\u0027t know if we can do this using only a constraint.\n\nTo avoid this query, we could add a `l4_protocol` in the listener table that could be only one of UDP or TCP (so for HTTP/HTTPS/TCP/etc.. listeners), and use this field in the constraint.","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"575a01b14a03fe6931528cc5a65e89e45dac52b8","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        # Validate that the L4 protocol (UDP or TCP) is not already used for"},{"line_number":247,"context_line":"        # the specified protocol_port in this load balancer"},{"line_number":248,"context_line":"        l4_protocol \u003d None"},{"line_number":249,"context_line":"        for p in L4_PROTOCOL_MAP:"},{"line_number":250,"context_line":"            if listener_protocol in L4_PROTOCOL_MAP[p]:"},{"line_number":251,"context_line":"                l4_protocol \u003d p"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_cda7a10b","line":249,"updated":"2019-08-08 15:48:07.000000000","message":"If we flip this to a dict, {constants.PROTOCOL_HTTP: constants.PROTOCOL_TCP} we can avoid looping over this list by doing a simple dict lookup. Though this might make the later lookup harder.","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"dbbd883ceaf2e515ea0afc6c5bdf6feaf34b4927","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        # Validate that the L4 protocol (UDP or TCP) is not already used for"},{"line_number":247,"context_line":"        # the specified protocol_port in this load balancer"},{"line_number":248,"context_line":"        l4_protocol \u003d None"},{"line_number":249,"context_line":"        for p in L4_PROTOCOL_MAP:"},{"line_number":250,"context_line":"            if listener_protocol in L4_PROTOCOL_MAP[p]:"},{"line_number":251,"context_line":"                l4_protocol \u003d p"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_1605bd14","line":249,"in_reply_to":"7faddb67_cda7a10b","updated":"2019-08-09 08:30:03.000000000","message":"I flipped the dict and changed the code, now we loop over protocols only if the load balancer has multiple listeners that share the same port.","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"}],"octavia/db/migration/alembic_migrations/versions/a5762a99609a_add_protocol_in_listener_keys.py":[{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"9879d6ea947fc84da40a1ae96b23f456afd0b380","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    op.execute(\"ALTER TABLE `listener` \""},{"line_number":32,"context_line":"               \"DROP INDEX `uq_listener_load_balancer_id_protocol_port`, \""},{"line_number":33,"context_line":"               \"ADD UNIQUE KEY \""},{"line_number":34,"context_line":"               \"`uq_listener_load_balancer_id_protocol_protocol_port` \""},{"line_number":35,"context_line":"               \"(`load_balancer_id`, `protocol`, `protocol_port`)\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_abd2bfcf","line":34,"updated":"2019-08-01 16:10:14.000000000","message":"I think we should maintain the name of the constraint as `uq_listener_load_balancer_id_protocol_port`\nHere are the reasons:\n1. It still reads ok for what it does.\n2. It would make this migration compatible with downstream patches to correct this issue. It would simple drop the downstream change and apply the fix over the top.","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"9a8c0ef1b095ae3e34cceef6ce177bf208e9b4b4","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    op.execute(\"ALTER TABLE `listener` \""},{"line_number":32,"context_line":"               \"DROP INDEX `uq_listener_load_balancer_id_protocol_port`, \""},{"line_number":33,"context_line":"               \"ADD UNIQUE KEY \""},{"line_number":34,"context_line":"               \"`uq_listener_load_balancer_id_protocol_protocol_port` \""},{"line_number":35,"context_line":"               \"(`load_balancer_id`, `protocol`, `protocol_port`)\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_b1b310e9","line":34,"in_reply_to":"7faddb67_abd2bfcf","updated":"2019-08-01 17:34:23.000000000","message":"ok, I can fix it","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"},{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"dbbd883ceaf2e515ea0afc6c5bdf6feaf34b4927","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    op.execute(\"ALTER TABLE `listener` \""},{"line_number":32,"context_line":"               \"DROP INDEX `uq_listener_load_balancer_id_protocol_port`, \""},{"line_number":33,"context_line":"               \"ADD UNIQUE KEY \""},{"line_number":34,"context_line":"               \"`uq_listener_load_balancer_id_protocol_protocol_port` \""},{"line_number":35,"context_line":"               \"(`load_balancer_id`, `protocol`, `protocol_port`)\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_36547921","line":34,"in_reply_to":"7faddb67_b1b310e9","updated":"2019-08-09 08:30:03.000000000","message":"Done","commit_id":"6954505ef1d5f685b3333d1028b144342b7194b1"}]}
