yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #89586
[Bug 1981817] Re: neutron revision_number does not bump on network update
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 <skaplons@xxxxxxxxxx>
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
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1981817
Title:
neutron revision_number does not bump on network update
Status in neutron:
Fix Released
Bug description:
neutron revision_number does not bump on network update
I tested the exact same mechanism with the subnet resource and an
update to the same field (description) and it works like a charm. For
the network resource, the revision number is not updated when updating
the field, instead there's an inconsitency checker which fixesthe
inconsistency from time to time
Here's the output of my go application calling into the API and updating resources (with a slightly modified version of gophercloud):
~~~
[stack@standalone gophercloud-test]$ go run main.go -network-id 674bf675-0382-4524-86f6-be1b677e1c12 -subnet-id 10ee214c-e8df-4f1a-af0b-4c9b64db64e3 -port-id c808500a-70b8-45e8-b0df-cbf0336d3139
I0715 13:06:18.881525 561527 main.go:101] Getting network
================> akaris GET map[network:map[admin_state_up:true availability_zone_hints:[] availability_zones:[] created_at:2022-07-15T11:15:29Z description: dns_domain: id:674bf675-0382-4524-86f6-be1b677e1c12 ipv4_address_scope:<nil> ipv6_address_scope:<nil> l2_adjacency:true mtu:1442 name:akaris-test port_security_enabled:true project_id:6f69c87fe95b469c8c7709382818acf6 qos_policy_id:<nil> revision_number:40 router:external:false shared:false status:ACTIVE subnets:[10ee214c-e8df-4f1a-af0b-4c9b64db64e3] tags:[] tenant_id:6f69c87fe95b469c8c7709382818acf6 updated_at:2022-07-15T13:04:20Z]]
I0715 13:06:19.063586 561527 main.go:103] Revision number is: 40
I0715 13:06:21.063986 561527 main.go:107] Updating network
-----> akaris PUT https://10.1.8.109:13696/v2.0/networks/674bf675-0382-4524-86f6-be1b677e1c12 &{map[network:map[description:test]] <nil> 0xc0005f6b10 [200 201] map[If-Match:revision_number=40] [] <nil> false}
I0715 13:06:25.666203 561527 main.go:124] Updating network again
I0715 13:06:25.666231 561527 main.go:130] Revision number is: 40
-----> akaris PUT https://10.1.8.109:13696/v2.0/networks/674bf675-0382-4524-86f6-be1b677e1c12 &{map[network:map[description:test2]] <nil> 0xc000615a70 [200 201] map[If-Match:revision_number=40] [] <nil> false}
================> akaris GET map[network:map[admin_state_up:true availability_zone_hints:[] availability_zones:[] created_at:2022-07-15T11:15:29Z description:test2 dns_domain: id:674bf675-0382-4524-86f6-be1b677e1c12 ipv4_address_scope:<nil> ipv6_address_scope:<nil> l2_adjacency:true mtu:1442 name:akaris-test port_security_enabled:true project_id:6f69c87fe95b469c8c7709382818acf6 qos_policy_id:<nil> revision_number:40 router:external:false shared:false status:ACTIVE subnets:[10ee214c-e8df-4f1a-af0b-4c9b64db64e3] tags:[] tenant_id:6f69c87fe95b469c8c7709382818acf6 updated_at:2022-07-15T13:06:25Z]]
I0715 13:06:28.093811 561527 main.go:138] &{674bf675-0382-4524-86f6-be1b677e1c12 akaris-test test2 true ACTIVE [10ee214c-e8df-4f1a-af0b-4c9b64db64e3] 6f69c87fe95b469c8c7709382818acf6 2022-07-15 13:06:25 +0000 UTC 2022-07-15 11:15:29 +0000 UTC 6f69c87fe95b469c8c7709382818acf6 false [] [] 40}
I0715 13:06:30.094846 561527 main.go:142] Getting network
================> akaris GET map[network:map[admin_state_up:true availability_zone_hints:[] availability_zones:[] created_at:2022-07-15T11:15:29Z description:test2 dns_domain: id:674bf675-0382-4524-86f6-be1b677e1c12 ipv4_address_scope:<nil> ipv6_address_scope:<nil> l2_adjacency:true mtu:1442 name:akaris-test port_security_enabled:true project_id:6f69c87fe95b469c8c7709382818acf6 qos_policy_id:<nil> revision_number:40 router:external:false shared:false status:ACTIVE subnets:[10ee214c-e8df-4f1a-af0b-4c9b64db64e3] tags:[] tenant_id:6f69c87fe95b469c8c7709382818acf6 updated_at:2022-07-15T13:06:25Z]]
I0715 13:06:30.210418 561527 main.go:144] Revision number is: 40
I0715 13:06:32.211495 561527 main.go:148] Resetting network
-----> akaris PUT https://10.1.8.109:13696/v2.0/networks/674bf675-0382-4524-86f6-be1b677e1c12 &{map[network:map[description:]] <nil> 0xc0005f62a0 [200 201] map[If-Match:revision_number=40] [] <nil> false}
~~~
Here's the neutron output for that same test:
~~~
stack@standalone gophercloud]$ while true; do date ; openstack network show 674bf675-0382-4524-86f6-be1b677e1c12 ; sleep 1; done
Fri Jul 15 13:06:15 UTC 2022
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| description | |
| revision_number | 40 |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Fri Jul 15 13:06:18 UTC 2022
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| description | |
| revision_number | 40 |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Fri Jul 15 13:06:22 UTC 2022
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| description | test |
| revision_number | 40 |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Fri Jul 15 13:06:25 UTC 2022
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| description | test2 |
| revision_number | 40 |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Fri Jul 15 13:06:29 UTC 2022
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| description | test2 |
| revision_number | 40 |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
~~~
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1981817/+subscriptions
References