Revision number not bumped after update of router's description

Bug #1865173 reported by Slawek Kaplonski
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Triveni Gurram

Bug Description

When router's description is updated, it's revision number isn't bumped:

[16:23:20] vagrant@devstack-ubuntu-ovs:~$ neutron router-show router1-updated
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | False |
| availability_zone_hints | |
| availability_zones | nova |
| created_at | 2020-02-05T11:15:42Z |
| description | Test 3 |
| distributed | False |
| external_gateway_info | {"network_id": "b5623d28-a48e-4fca-a4bc-8490e35b8b99", "external_fixed_ips": [{"subnet_id": "6e83aac3-3fd1-4b22-bcaf-64a20e047c68", "ip_address": "10.10.0.130"}, {"subnet_id": "19192cb1-ab0a-4b6d-ac69-51cd5f2183d4", "ip_address": "2001:db8::3cc"}], "enable_snat": true} |
| flavor_id | |
| ha | False |
| id | 07ee9def-6cf7-4dce-b898-014924c43c88 |
| name | router1-updated |
| project_id | 7436d2571300417f97abf1dc232fbf20 |
| revision_number | 9 |
| routes | |
| status | ACTIVE |
| tags | |
| tenant_id | 7436d2571300417f97abf1dc232fbf20 |
| updated_at | 2020-02-27T15:23:20Z |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
[16:23:25] vagrant@devstack-ubuntu-ovs:~$ neutron router-update router1-updated --description "Test revision 1"
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Updated router: router1-updated
[16:23:47] vagrant@devstack-ubuntu-ovs:~$ neutron router-show router1-updated
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | False |
| availability_zone_hints | |
| availability_zones | nova |
| created_at | 2020-02-05T11:15:42Z |
| description | Test revision 1 |
| distributed | False |
| external_gateway_info | {"network_id": "b5623d28-a48e-4fca-a4bc-8490e35b8b99", "external_fixed_ips": [{"subnet_id": "6e83aac3-3fd1-4b22-bcaf-64a20e047c68", "ip_address": "10.10.0.130"}, {"subnet_id": "19192cb1-ab0a-4b6d-ac69-51cd5f2183d4", "ip_address": "2001:db8::3cc"}], "enable_snat": true} |
| flavor_id | |
| ha | False |
| id | 07ee9def-6cf7-4dce-b898-014924c43c88 |
| name | router1-updated |
| project_id | 7436d2571300417f97abf1dc232fbf20 |
| revision_number | 9 |
| routes | |
| status | ACTIVE |
| tags | |
| tenant_id | 7436d2571300417f97abf1dc232fbf20 |
| updated_at | 2020-02-27T15:23:46Z |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

But when I updated e.g. router's name or admin_state, revision number was updated properly.

Also when I updated description of e.g. port or floating ip revision number was bumped properly.

Revision history for this message
LIU Yulong (dragon889) wrote :

stable/eueens does not have such issue, this is my test:
http://paste.openstack.org/show/790299/

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

The code related was changed in [1]. If a DB object or a related object to this main object, are updated, the main object "revision_number" is bumped.

For example, when a port "description" is updated, the PortBinding is always updated; I'm not stating that this is something correct (actually I would like to review why we do this). That means [2] will add this port object to the "_related_bumped" set and the "revision_number" will be increased.

This is not happening in a router update. When [3] checks the objects to be bumped, the only DB object modified is the "StandardAttribute" associated to the router ("description" is an standard attribute, another DB register), but not the router DB register itself. That means, according to this logic, that the "revision_number" of router should not be bumped.

Regarding to the "StandardAttribute", associated to any DB register. A change in any parameter won't trigger the "revises_on_change" flag. That means changing the "description" parameter won't be considered as a change in the main object.

This is, indeed, an inconsistency on how the "revision_number" is updated between objects and is due to the way some objects are handled in the ML2 plugin.

Regards.

[1]https://review.opendev.org/#/c/635671/
[2]https://github.com/openstack/neutron/blob/master/neutron/services/revisions/revision_plugin.py#L69-L70
[3]https://github.com/openstack/neutron/blob/master/neutron/services/revisions/revision_plugin.py#L57-L59

Changed in neutron:
assignee: nobody → Triveni Gurram (triveni12)
Revision history for this message
Triveni Gurram (triveni12) wrote :

Hello,

I have gone through the code flow when description of router is updated and my observation is it is creating only one object which has revision number,date,description of the router(neutron.db.standard_attr) and when it checks if the object is an instance of HasStandardAttributes class it gives False because description is not a part in router database models(neutron.db.models).But revision number gets bumped if the object is from neutron.db.models so,for router description update revision number is not getting bumped.

I have observed for router name update revision number is getting bumped and this is because it creates 2 objects one object which has revision number,date,description of the router(neutron.db.standard_attr) while other object has details of the router name ,status and etc (neutron.db.models).so,revision number gets bumped for neutron.models.db object.

so,for router description update if revision number has to be bumped description should also be a part of
neutron.models.db object or changes should be made in checking if the object is an instance of HasStandardAttributes class.

Revision history for this message
Slawek Kaplonski (slaweq) wrote :

Thx Rodolfo and Triveni for analysis of this issue. According to Trivieni's comment, I think that better way would be to change this checking it the object is an instance of HasStandardAttributes class as that should hopefully fix this issue for all such objects, not only for router.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/851733

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851733
Committed: https://opendev.org/openstack/neutron/commit/4c9cb83d6b46a6425e603194649a61f51a07a307
Submitter: "Zuul (22348)"
Branch: master

commit 4c9cb83d6b46a6425e603194649a61f51a07a307
Author: Slawek Kaplonski <email address hidden>
Date: Mon Aug 1 13:00:28 2022 +0200

    Bump revision number of objects when description is changed

    "Description" attribute belongs to the StandardAttribute class from
    which many other classes inherits (like e.g. Network, Port or Subnet).
    In case when only description of object is updated, revision number of
    the object should be bumped but it wasn't the case for all of the
    objects. For example updated description of the Network or Router didn't
    bumped its revision_number. It was like that because StandardAttribute
    object was the only one which was dirty in the session, and as it is not
    member of the HasStandardAttibutes class, it was filtered out.

    Now, to fix that problem revision_plugin looks in the session.dirty list
    for objects which inherits from HasStandardAttibutes class (as it was
    before) but also for StandardAttribute objects to bump revision numbers.

    Closes-Bug: #1981817
    Closes-Bug: #1865173
    Change-Id: I79b40a8ae5d594ed6fc875572663469c8b701202

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/neutron/+/854905

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/854906

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/854907

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/854908

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/854909

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/854990

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/854907
Committed: https://opendev.org/openstack/neutron/commit/d0592d06e8835d529a5f6e25bba063743cd7bc73
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit d0592d06e8835d529a5f6e25bba063743cd7bc73
Author: Slawek Kaplonski <email address hidden>
Date: Mon Aug 1 13:00:28 2022 +0200

    Bump revision number of objects when description is changed

    "Description" attribute belongs to the StandardAttribute class from
    which many other classes inherits (like e.g. Network, Port or Subnet).
    In case when only description of object is updated, revision number of
    the object should be bumped but it wasn't the case for all of the
    objects. For example updated description of the Network or Router didn't
    bumped its revision_number. It was like that because StandardAttribute
    object was the only one which was dirty in the session, and as it is not
    member of the HasStandardAttibutes class, it was filtered out.

    Now, to fix that problem revision_plugin looks in the session.dirty list
    for objects which inherits from HasStandardAttibutes class (as it was
    before) but also for StandardAttribute objects to bump revision numbers.

    Closes-Bug: #1981817
    Closes-Bug: #1865173
    Change-Id: I79b40a8ae5d594ed6fc875572663469c8b701202
    (cherry picked from commit 4c9cb83d6b46a6425e603194649a61f51a07a307)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/854909
Committed: https://opendev.org/openstack/neutron/commit/39f7e1299364f3eca6375c178b604f70a05c0d81
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 39f7e1299364f3eca6375c178b604f70a05c0d81
Author: Slawek Kaplonski <email address hidden>
Date: Mon Aug 1 13:00:28 2022 +0200

    Bump revision number of objects when description is changed

    "Description" attribute belongs to the StandardAttribute class from
    which many other classes inherits (like e.g. Network, Port or Subnet).
    In case when only description of object is updated, revision number of
    the object should be bumped but it wasn't the case for all of the
    objects. For example updated description of the Network or Router didn't
    bumped its revision_number. It was like that because StandardAttribute
    object was the only one which was dirty in the session, and as it is not
    member of the HasStandardAttibutes class, it was filtered out.

    Now, to fix that problem revision_plugin looks in the session.dirty list
    for objects which inherits from HasStandardAttibutes class (as it was
    before) but also for StandardAttribute objects to bump revision numbers.

    Closes-Bug: #1981817
    Closes-Bug: #1865173
    Change-Id: I79b40a8ae5d594ed6fc875572663469c8b701202
    (cherry picked from commit 4c9cb83d6b46a6425e603194649a61f51a07a307)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/854908
Committed: https://opendev.org/openstack/neutron/commit/05e37d891cefd2268a4a72bdf752d12b5b2f2f24
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 05e37d891cefd2268a4a72bdf752d12b5b2f2f24
Author: Slawek Kaplonski <email address hidden>
Date: Mon Aug 1 13:00:28 2022 +0200

    Bump revision number of objects when description is changed

    "Description" attribute belongs to the StandardAttribute class from
    which many other classes inherits (like e.g. Network, Port or Subnet).
    In case when only description of object is updated, revision number of
    the object should be bumped but it wasn't the case for all of the
    objects. For example updated description of the Network or Router didn't
    bumped its revision_number. It was like that because StandardAttribute
    object was the only one which was dirty in the session, and as it is not
    member of the HasStandardAttibutes class, it was filtered out.

    Now, to fix that problem revision_plugin looks in the session.dirty list
    for objects which inherits from HasStandardAttibutes class (as it was
    before) but also for StandardAttribute objects to bump revision numbers.

    Closes-Bug: #1981817
    Closes-Bug: #1865173
    Change-Id: I79b40a8ae5d594ed6fc875572663469c8b701202
    (cherry picked from commit 4c9cb83d6b46a6425e603194649a61f51a07a307)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/854906
Committed: https://opendev.org/openstack/neutron/commit/0fe77594c5a55f909733761c64ee03271a8d4ecd
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 0fe77594c5a55f909733761c64ee03271a8d4ecd
Author: Slawek Kaplonski <email address hidden>
Date: Mon Aug 1 13:00:28 2022 +0200

    Bump revision number of objects when description is changed

    "Description" attribute belongs to the StandardAttribute class from
    which many other classes inherits (like e.g. Network, Port or Subnet).
    In case when only description of object is updated, revision number of
    the object should be bumped but it wasn't the case for all of the
    objects. For example updated description of the Network or Router didn't
    bumped its revision_number. It was like that because StandardAttribute
    object was the only one which was dirty in the session, and as it is not
    member of the HasStandardAttibutes class, it was filtered out.

    Now, to fix that problem revision_plugin looks in the session.dirty list
    for objects which inherits from HasStandardAttibutes class (as it was
    before) but also for StandardAttribute objects to bump revision numbers.

    Closes-Bug: #1981817
    Closes-Bug: #1865173
    Change-Id: I79b40a8ae5d594ed6fc875572663469c8b701202
    (cherry picked from commit 4c9cb83d6b46a6425e603194649a61f51a07a307)

tags: added: in-stable-xena
tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/854905
Committed: https://opendev.org/openstack/neutron/commit/edc26807dd8d4a39b1638a74895f6d9876101721
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit edc26807dd8d4a39b1638a74895f6d9876101721
Author: Slawek Kaplonski <email address hidden>
Date: Mon Aug 1 13:00:28 2022 +0200

    Bump revision number of objects when description is changed

    "Description" attribute belongs to the StandardAttribute class from
    which many other classes inherits (like e.g. Network, Port or Subnet).
    In case when only description of object is updated, revision number of
    the object should be bumped but it wasn't the case for all of the
    objects. For example updated description of the Network or Router didn't
    bumped its revision_number. It was like that because StandardAttribute
    object was the only one which was dirty in the session, and as it is not
    member of the HasStandardAttibutes class, it was filtered out.

    Now, to fix that problem revision_plugin looks in the session.dirty list
    for objects which inherits from HasStandardAttibutes class (as it was
    before) but also for StandardAttribute objects to bump revision numbers.

    Closes-Bug: #1981817
    Closes-Bug: #1865173
    Change-Id: I79b40a8ae5d594ed6fc875572663469c8b701202
    (cherry picked from commit 4c9cb83d6b46a6425e603194649a61f51a07a307)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/854990
Committed: https://opendev.org/openstack/neutron/commit/bbaf496bd6d5af34d71df794368b902fbd4d8452
Submitter: "Zuul (22348)"
Branch: stable/train

commit bbaf496bd6d5af34d71df794368b902fbd4d8452
Author: Slawek Kaplonski <email address hidden>
Date: Mon Aug 1 13:00:28 2022 +0200

    Bump revision number of objects when description is changed

    "Description" attribute belongs to the StandardAttribute class from
    which many other classes inherits (like e.g. Network, Port or Subnet).
    In case when only description of object is updated, revision number of
    the object should be bumped but it wasn't the case for all of the
    objects. For example updated description of the Network or Router didn't
    bumped its revision_number. It was like that because StandardAttribute
    object was the only one which was dirty in the session, and as it is not
    member of the HasStandardAttibutes class, it was filtered out.

    Now, to fix that problem revision_plugin looks in the session.dirty list
    for objects which inherits from HasStandardAttibutes class (as it was
    before) but also for StandardAttribute objects to bump revision numbers.

    Closes-Bug: #1981817
    Closes-Bug: #1865173
    Change-Id: I79b40a8ae5d594ed6fc875572663469c8b701202
    (cherry picked from commit 4c9cb83d6b46a6425e603194649a61f51a07a307)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 21.0.0.0rc1

This issue was fixed in the openstack/neutron 21.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.6.0

This issue was fixed in the openstack/neutron 18.6.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.5.0

This issue was fixed in the openstack/neutron 19.5.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 20.3.0

This issue was fixed in the openstack/neutron 20.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron train-eol

This issue was fixed in the openstack/neutron train-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron ussuri-eol

This issue was fixed in the openstack/neutron ussuri-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron victoria-eom

This issue was fixed in the openstack/neutron victoria-eom release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.