Agent resource cache updates

Bug #2047100 reported by LIU Yulong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Medium
LIU Yulong

Bug Description

1. Agent resource cache has an infinite growth set: _satisfied_server_queries
https://github.com/openstack/neutron/blob/master/neutron/agent/resource_cache.py#L41

there is no entry removal for this set.

2. Because this set has a non-standard structure, for instance:
set([('Port', ('id', (u'830d035e-5138-49ae-bbe4-324f4096656d',))), ('Network', ('id', ('e04208de-1006-4a6b-881a-83129856afa6',))), ('Network', ('id', ('505155ea-8fbb-42d1-a8c9-cc2c78f8476e',))), ('Port', ('id', (u'ac825cc9-906a-45db-a77d-4e336fc1c4ea',))), ('Port', ('id', (u'c3a72a39-dbd5-4737-a68c-120de93b186c',))), ('Network', ('id', ('cd5155df-9777-4487-a730-b5ee533c4f80',))), ('Port', ('id', (u'340e02f2-fe54-4f31-8858-7f6413fb0010',))), ('Port', ('id', (u'64fc4d85-04d6-453f-8d20-f4d1308d34fd',))), ('Network', ('id', ('a6201723-a237-433c-b357-82a6a24526e5',))), ('Network', ('id', ('71a80697-1705-4bd0-b65b-0fd7dd616836',))), ('Port', ('security_group_ids', ('48a2ebb8-16ea-4a0a-9d45-eabc6a6b3dcf',))), ('Network', ('id', ('7e83c48a-b246-4a02-bb87-10016ac4b47e',))), ('SecurityGroupRule', ('security_group_id', (u'48a2ebb8-16ea-4a0a-9d45-eabc6a6b3dcf',))), ('Port', ('id', (u'2cc656ba-b07b-4e85-ad56-ee6da4b2e763',))), ('Port', ('id', (u'89d0aab8-82f7-4e5e-98b1-e009e31498ce',))), ('Port', ('id', (u'd820dbc2-bf4f-463b-9a67-6b704202bee0',))), ('Network', ('id', ('aea5771b-9655-4936-b9f4-f94d482c0b15',))), ('Port', ('id', (u'68c3e31b-9bf6-45e9-bfbb-3da1cafebcec',)))])

It's hardly to remove all entries for one resource at all, because if some codes query cache by filter=None, some codes use fitler={"x":y, "a": b}, the entries are various, especially when the code is not in Neutron.

3. If the port removed, and added again, because the query is in the _satisfied_server_queries: https://github.com/openstack/neutron/blob/master/neutron/agent/resource_cache.py#L75

It may return None or stale resource.

4. If users query one resource like:
q1 = {"id": 1}, and return R
q1 = {"id": 1, name="2"}, and return None
q1 = {"id": 1, device="3"}, and return None

The set will also grow up. And it does not avoid bulk_pull call to neutron-server at all.

So, it's better to remove such "server_queries" records. Because, if the resource is in cache, just return it. If it is not, get it from neutron-server.

LIU Yulong (dragon889)
description: updated
description: updated
LIU Yulong (dragon889)
description: updated
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/+/904169

Changed in neutron:
status: New → In Progress
yatin (yatinkarel)
Changed in neutron:
importance: Undecided → Medium
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
assignee: Rodolfo Alonso (rodolfo-alonso-hernandez) → LIU Yulong (dragon889)
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.