Currently the datasources publish each of their tables individually on the DSE message bus. Those tables can therefore be received by the policy engine at different points in time, depending on message delivery. This can cause the policy engine to flag policy violations when none actually exists.
Some of these inconsistencies are unavoidable. If we are polling data from 2 API calls for the same datasource, and the data in that datasources changes in between API calls, then we may end up pulling inconsistent data.
But this bug is concerned with inconsistencies arising simply because of our implementation. Suppose we make a single API call to grab, for example, all of Neutron's ports. Our datasource driver converts that into multiple tables and publishes each of those multiple tables to the message bus independently, even though they were derived from a single API call.
The policy engine currently subscribes to many different dataindexes for each datasource--one subscription for each table. Instead, we may want the policy engine to subscribe to each datasource exactly once and include all the tables it is interested in. Then the datasource can send all the updates for all the tables that it knows about in one message on the bus. This would not fix the problem of inconsistency entirely, but it would ensure we don't introduce any more simply because of our implementation choices.
Reviewed: https:/ /review. openstack. org/108519 /git.openstack. org/cgit/ stackforge/ congress/ commit/ ?id=5932a3549d4 a58b1b7bf636590 31ef31db348c66
Committed: https:/
Submitter: Jenkins
Branch: master
commit 5932a3549d4a58b 1b7bf63659031ef 31db348c66
Author: Tim Hinrichs <email address hidden>
Date: Mon Jul 21 13:16:31 2014 -0700
Avoid redundant datasource tuple translation
Every time Neutron is queried for its
current information, the Neutron driver
converts that information to tuples, even
if the data is exactly the same as it was
previously.
This change only runs the conversion to
tuples when the data is different than
it was previously. This has the benefit
that bug #1344475 has less impact
in the common case where data has not changed.
Related-bug: 1344462 f8020f07d46dc25 15aa23ee368
Change-Id: I53132258804eef