)]}'
{"neutron/db/migration/alembic_migrations/versions/ussuri/expand/dfe425060830_limit_vlan_allocation_id_values.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"adcd052958960605d590eb013d8f77d8224c6b9d","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from alembic import op"},{"line_number":17,"context_line":"from neutron_lib import constants"},{"line_number":18,"context_line":"import sqlalchemy as sa"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"\"\"\"limit vlan allocation id values"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_07c4e83e","line":18,"updated":"2020-04-02 23:36:28.000000000","message":"pep8: F401 \u0027sqlalchemy as sa\u0027 imported but unused","commit_id":"698477d9942c8deabee550f529e09087ffd64358"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"ae0e8adfed505d82b54244218f5f180c23551967","unresolved":false,"context_lines":[{"line_number":30,"context_line":"down_revision \u003d \u0027e4e236b0e1ff\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":"    # https://docs.sqlalchemy.org/en/13/core/constraints.html#check-constraint"},{"line_number":35,"context_line":"    constraint \u003d (\u0027vlan_id\u003e\u003d%(min_vlan)s AND vlan_id\u003c\u003d%(max_vlan)s\u0027 %"},{"line_number":36,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_efda0915","line":33,"updated":"2020-04-08 09:15:59.000000000","message":"It\u0027s baffling that we don\u0027t know how to reproduce the problem.\n\nStill if we assume there are systems out there with vlan_id\u003d0 records when they upgrade this will fail. Shouldn\u0027t we delete the vlan_id\u003d0 record and then install the new constraint? This delete should be safe, shouldn\u0027t it?","commit_id":"62ff06b400ccc1f45a724fe962b41796654af418"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"95e748c1933daccf1b52643a979d754f3e1247f0","unresolved":false,"context_lines":[{"line_number":30,"context_line":"down_revision \u003d \u0027e4e236b0e1ff\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":"    # https://docs.sqlalchemy.org/en/13/core/constraints.html#check-constraint"},{"line_number":35,"context_line":"    constraint \u003d (\u0027vlan_id\u003e\u003d%(min_vlan)s AND vlan_id\u003c\u003d%(max_vlan)s\u0027 %"},{"line_number":36,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_8e987a75","line":33,"in_reply_to":"df33271e_83aeb1e4","updated":"2020-04-09 09:01:43.000000000","message":"Another technical option may be to add a pre-upgrade check for the vlan_id\u003d0 record. That would give a chance to the administrator to handle it manually.","commit_id":"62ff06b400ccc1f45a724fe962b41796654af418"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c31074be5cf62352af9be01eb5ed23bbaafad365","unresolved":false,"context_lines":[{"line_number":30,"context_line":"down_revision \u003d \u0027e4e236b0e1ff\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":"    # https://docs.sqlalchemy.org/en/13/core/constraints.html#check-constraint"},{"line_number":35,"context_line":"    constraint \u003d (\u0027vlan_id\u003e\u003d%(min_vlan)s AND vlan_id\u003c\u003d%(max_vlan)s\u0027 %"},{"line_number":36,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4c43b2_c92cad9b","line":33,"in_reply_to":"df33271e_8e987a75","updated":"2020-04-14 11:36:39.000000000","message":"I agree. Since that situation (vlan_id out of valid interval) is an unstable condition, the administrator should solve manually this issue in the DB (by deleting the invalid registers).\n\nOnce the DB is healed, we can apply safely this patch.","commit_id":"62ff06b400ccc1f45a724fe962b41796654af418"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d6eac2d8a9d53f8ab010e6de277522ce1bd54e44","unresolved":false,"context_lines":[{"line_number":30,"context_line":"down_revision \u003d \u0027e4e236b0e1ff\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":"    # https://docs.sqlalchemy.org/en/13/core/constraints.html#check-constraint"},{"line_number":35,"context_line":"    constraint \u003d (\u0027vlan_id\u003e\u003d%(min_vlan)s AND vlan_id\u003c\u003d%(max_vlan)s\u0027 %"},{"line_number":36,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_83aeb1e4","line":33,"in_reply_to":"df33271e_c31c396c","updated":"2020-04-08 14:16:22.000000000","message":"Please, I would like more feedback on Bence\u0027s comment because this is important. Thanks Bence.","commit_id":"62ff06b400ccc1f45a724fe962b41796654af418"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ec25e51689eaeea18fee23b4dfe990b9f48bfec8","unresolved":false,"context_lines":[{"line_number":30,"context_line":"down_revision \u003d \u0027e4e236b0e1ff\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":"    # https://docs.sqlalchemy.org/en/13/core/constraints.html#check-constraint"},{"line_number":35,"context_line":"    constraint \u003d (\u0027vlan_id\u003e\u003d%(min_vlan)s AND vlan_id\u003c\u003d%(max_vlan)s\u0027 %"},{"line_number":36,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_c31c396c","line":33,"in_reply_to":"df33271e_efda0915","updated":"2020-04-08 14:15:14.000000000","message":"That\u0027s the point: a customer found this error in normal operation. Every time you modify the segment range allocations (with VLAN driver, this is the bug case), you\u0027ll sync the all of them. That means you\u0027ll retrieve all VLAN allocations. When this happens, the OVO will fail because vlan_id\u003d0 (or \u003eMAX_VLAN_TAG) is not a valid number. \n\nIf there is an invalid VLAN tag in the DB, should we delete it by default? This problem should be solved manually by the administrator, IMO.","commit_id":"62ff06b400ccc1f45a724fe962b41796654af418"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"ae0e8adfed505d82b54244218f5f180c23551967","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"},{"line_number":37,"context_line":"                   \u0027max_vlan\u0027: constants.MAX_VLAN_TAG})"},{"line_number":38,"context_line":"    op.create_check_constraint("},{"line_number":39,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vland_id\u0027,"},{"line_number":40,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":41,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_cfd585e7","line":39,"range":{"start_line":39,"start_character":56,"end_line":39,"end_character":57},"updated":"2020-04-08 09:15:59.000000000","message":"typo","commit_id":"62ff06b400ccc1f45a724fe962b41796654af418"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ec25e51689eaeea18fee23b4dfe990b9f48bfec8","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"},{"line_number":37,"context_line":"                   \u0027max_vlan\u0027: constants.MAX_VLAN_TAG})"},{"line_number":38,"context_line":"    op.create_check_constraint("},{"line_number":39,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vland_id\u0027,"},{"line_number":40,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":41,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_0328e183","line":39,"range":{"start_line":39,"start_character":56,"end_line":39,"end_character":57},"in_reply_to":"df33271e_cfd585e7","updated":"2020-04-08 14:15:14.000000000","message":"Done","commit_id":"62ff06b400ccc1f45a724fe962b41796654af418"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c6ffa7600f455943d6030be327868eaaeb8c36dd","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    op.create_check_constraint("},{"line_number":39,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vlan_id\u0027,"},{"line_number":40,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":41,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4c43b2_a8ff82a8","line":41,"updated":"2020-04-15 09:10:38.000000000","message":"how this constraint will work if there will be already in DB ID outside of this new range? Will it pass or fail to upgrade db? I don\u0027t have env now to test that so that\u0027s why I\u0027m asking :)","commit_id":"e223b71a470776ee3baa2df3737c5ce46639119a"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"abb716c16f5f91ef1c96791055134048cb3d80c7","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    op.create_check_constraint("},{"line_number":39,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vlan_id\u0027,"},{"line_number":40,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":41,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4c43b2_c8776e3a","line":41,"in_reply_to":"3f4c43b2_a8ff82a8","updated":"2020-04-15 09:33:41.000000000","message":"I don\u0027t think that migration will fail, as I understand this will be evaluated when we set/update data, also this will work from certain mysql version.","commit_id":"e223b71a470776ee3baa2df3737c5ce46639119a"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"0ed6909c5ee8b5007b04da1ea1642f61cc5ff07f","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    op.create_check_constraint("},{"line_number":39,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vlan_id\u0027,"},{"line_number":40,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":41,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4c43b2_cf275f12","line":41,"in_reply_to":"3f4c43b2_bec97879","updated":"2020-04-16 09:48:03.000000000","message":"Out of curiousity I wanted to test if the upgrade fails or not, but I couldn\u0027t really.\n\nThe reason is that MySQL until version 8.0.16 does not support CHECK CONSTRAINTS, instead it silently ignores them:\n\nhttps://dev.mysql.com/doc/refman/8.0/en/check-constraints-table.html\n\nAlso mentioned in sqlalchemy documentation:\n\nhttps://docs.sqlalchemy.org/en/13/core/constraints.html#check-constraint\n\nMy ubuntu 18.04 based devstack has way older mysql (5.7.26).\n\nAll this may be worth a comment here.\n\nPlus I think this also means that we could end up with two different actual db schemas based on the underlying mysql version when the upgrade is performed.","commit_id":"e223b71a470776ee3baa2df3737c5ce46639119a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"49bb06f8a95689af8ac311ad72307930c714026b","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    op.create_check_constraint("},{"line_number":39,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vlan_id\u0027,"},{"line_number":40,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":41,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4c43b2_bec97879","line":41,"in_reply_to":"3f4c43b2_c8776e3a","updated":"2020-04-15 11:21:43.000000000","message":"As recommended by Bence, I added an upgrade check [1] to ensure that this situation is not happening during the DB migration. BTW, having a vlan allocation \"out of bonds\" should never happen and if happens, should be solved manually by the administrator.\n\n\n[1]https://review.opendev.org/#/c/717083/5/neutron/cmd/upgrade_checks/checks.py","commit_id":"e223b71a470776ee3baa2df3737c5ce46639119a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0d01beb28c2d03f35457c1ac91ea4ce50d6c88c6","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    op.create_check_constraint("},{"line_number":39,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vlan_id\u0027,"},{"line_number":40,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":41,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4c43b2_52bc8068","line":41,"in_reply_to":"3f4c43b2_cf275f12","updated":"2020-04-17 08:21:14.000000000","message":"As you mention, MySQL 8.0.16 [1] is the first version supporting check constrains and this version is quite recent (from 2018). Other DB started supporting this feature in the last years:\n- https://mariadb.com/kb/en/constraint/#check-constraints (version 10.2.1, 2016).\n- https://www.postgresql.org/docs/9.4/ddl-constraints.html (version 9.4, 2014).\n\nThe point is:\n- Those versions not supporting this feature will ignore it. This upgrade will always work.\n- You will have a different schema depending on the DB engine, but once you update the engine, you can always perform a full DB migration. In any case, this difference won\u0027t affect you. The VLAN limitation is enforced in the code; this DB engine enforcement is just an extra check.\n- In new deployments, this check will be present.\n\n\nI\u0027ll add a comment here.\n\n[1]https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-16.html","commit_id":"e223b71a470776ee3baa2df3737c5ce46639119a"}],"neutron/db/migration/alembic_migrations/versions/victoria/expand/dfe425060830_limit_vlan_allocation_id_values.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"c871c8329a4552d1494eb16f2a7d4074a9b8c6d5","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"},{"line_number":51,"context_line":"                   \u0027max_vlan\u0027: constants.MAX_VLAN_TAG})"},{"line_number":52,"context_line":"    op.create_check_constraint("},{"line_number":53,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vlan_id\u0027,"},{"line_number":54,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":55,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff570b3c_770d8736","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":23},"updated":"2020-05-09 23:18:28.000000000","message":"Shouldn\u0027t we add this constraint in the db model as well?\n\nhttps://opendev.org/openstack/neutron/src/branch/master/neutron/db/models/plugins/ml2/vlanallocation.py#L39","commit_id":"15aef4138fb24ecee0e417982bee7c0cecd62c78"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"8edb15d1ada33018092c30a9703981fb85d7bacc","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                  {\u0027min_vlan\u0027: constants.MIN_VLAN_TAG,"},{"line_number":51,"context_line":"                   \u0027max_vlan\u0027: constants.MAX_VLAN_TAG})"},{"line_number":52,"context_line":"    op.create_check_constraint("},{"line_number":53,"context_line":"        constraint_name\u003d\u0027check_ml2_vlan_allocations0vlan_id\u0027,"},{"line_number":54,"context_line":"        table_name\u003d\u0027ml2_vlan_allocations\u0027,"},{"line_number":55,"context_line":"        condition\u003dconstraint)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff570b3c_51596858","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":23},"in_reply_to":"ff570b3c_770d8736","updated":"2020-05-11 11:05:53.000000000","message":"Good catch! I need to add this constraint to the DB model.","commit_id":"15aef4138fb24ecee0e417982bee7c0cecd62c78"}],"releasenotes/notes/limit_vlan_allocations_in_db-93083c6c4923403a.yaml":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"fde12f603edbed2955735168a04158107fa3a677","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"upgrade:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Limit the ML2 VLAN allocations to [1, 4096] values in the database engine."},{"line_number":5,"context_line":"    This constraint, enforced in the database engine, could not be supported"},{"line_number":6,"context_line":"    yet. In this case, it will be ignored. For more information, see the note"},{"line_number":7,"context_line":"    in"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"ff570b3c_6ed31061","line":4,"range":{"start_line":4,"start_character":42,"end_line":4,"end_character":46},"updated":"2020-06-05 09:46:44.000000000","message":"nit but I think it\u0027s worth to fix before merge: it is in fact limited to 4094 according to https://opendev.org/openstack/neutron-lib/src/branch/master/neutron_lib/constants.py#L309 which is used in constraint.","commit_id":"cb469fc00b1bbefd80123b9afeddb4d266f4d397"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"5ccced731b0f8b51edbf70987a9e1e33e28833ef","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"upgrade:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Limit the ML2 VLAN allocations to [1, 4096] values in the database engine."},{"line_number":5,"context_line":"    This constraint, enforced in the database engine, could not be supported"},{"line_number":6,"context_line":"    yet. In this case, it will be ignored. For more information, see the note"},{"line_number":7,"context_line":"    in"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"ff570b3c_2e759832","line":4,"range":{"start_line":4,"start_character":42,"end_line":4,"end_character":46},"in_reply_to":"ff570b3c_6ed31061","updated":"2020-06-05 10:01:17.000000000","message":"Ups!!!","commit_id":"cb469fc00b1bbefd80123b9afeddb4d266f4d397"}]}
