[agent][dhcp] When revision_number matches the one in cache it is not considered stale
Bug #1874400 reported by
Arun S A G
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Triaged
|
Low
|
Miguel Lavalle |
Bug Description
The revision_number is used to check if the message received at the agent is stale or not. A message is treated as stale only if the revision_number in NetworkCache is greater than the revision_number in incoming payload
IMO, we should consider making a message stale if the NetworkCache[
This will discard lot more messages as stale than the current logic and remove dhcp bottleneck in busy openstack environments.
description: | updated |
description: | updated |
Changed in neutron: | |
assignee: | nobody → Miguel Lavalle (minsel) |
To post a comment you must log in.
I think this was slightly broken with https:/ /review. opendev. org/#/c/ 373566/ a few years ago:
def is_port_ message_ stale(self, payload): port_by_ id(payload[ 'id']) 'revision' , 0) > payload. get('revision' , 0): port_by_ id(payload[ 'id']) or {} 'revision_ number' , 0) > payload. get('revision_ number' , 0):
- orig = self.get_
- if orig and orig.get(
+ orig = self.get_
+ if orig.get(
return True
if payload['id'] in self.deleted_ports:
return True
If the line had stayed 'if orig and orig.get(... ' then it would have also returned False if there was no original port, where now it can return True. So I think you are correct and something like this works better:
if orig and orig.get( 'revision_ number' , 0) >= payload. get('revision_ number' , 0):
return True
We can then add tests to cover the two new cases:
1) original port not found
2) revision numbers the same