Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Openstack Discoverer logs incorrect update #95

Closed
stevesloka opened this issue May 8, 2018 · 3 comments · Fixed by #149
Closed

Openstack Discoverer logs incorrect update #95

stevesloka opened this issue May 8, 2018 · 3 comments · Fixed by #149
Assignees
Labels
discoverer kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@stevesloka
Copy link
Member

The openstack discoverer logs updates for services when no updates have happened. The following example show the lb being added, then shows an update on each cycle when it wasn't updated in openstack.

time="2018-05-08T13:10:17Z" level=info msg="Successfully handled: add service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:10:17Z" level=info msg="Successfully handled: add endpoints 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:10:47Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:11:17Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:11:47Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:12:19Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:12:47Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:13:21Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:13:47Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
time="2018-05-08T13:14:17Z" level=info msg="Successfully handled: update service 'demo/lb1-2ad78ab3-aa94-43e4-a764-194a67601d16-openstack'"
@stevesloka stevesloka added the kind/bug Categorizes issue or PR as related to a bug. label May 8, 2018
@stevesloka stevesloka self-assigned this May 8, 2018
@alexbrand
Copy link
Contributor

alexbrand commented Jun 6, 2018

While running performance tests, this issue was very prominent. The discoverer is enqueuing updates at a faster rate than the workers are dequeuing items (Related to #140). This results in memory consumption and an ever growing queue.

Memory:
openstack-queue-issue-memory

Queue:
openstack queue issue

Bumping up the priority on this.

@alexbrand alexbrand added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. discoverer labels Jun 6, 2018
@alexbrand alexbrand self-assigned this Jun 8, 2018
@alexbrand
Copy link
Contributor

Currently, we are comparing the synced services/endpoints that are in Gimbal with the services/endpoints we produce after translation using reflect.DeepEquals.

The problem is that the resource we get from the Gimbal API Server includes creation timestamp, resource version, UID, etc. while the one we create during the translation process does not. This causes the equality comparison to return false, and thus the discoverer thinks it needs to perform an update.

One solution is to compare the fields we care about, instead of comparing the entire struct. The downside is that we create coupling where a change to the translation process will require a change to the diff process. For example, if we start translating a new field, we have to make sure we update the diff function to include that new field in the comparison. This is problematic because over time it could get out of sync, causing bugs in the diff process. I wonder what's the best way to mitigate this. Maybe a unit test?

With that said, I am not sure if there are other solutions.

@alexbrand
Copy link
Contributor

Turns out I jumped the gun. We are already only comparing the fields that we care about. The actual problem has been documented in the PR (#149) with the fixes.

@alexbrand alexbrand added this to the v0.3 milestone Jun 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discoverer kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants