[openstack-dev] [ceilometer] Possible issue with MongoDB storage resource ID

Julien Danjou julien at danjou.info
Fri Nov 16 13:57:45 UTC 2012


Hi,

I was working on fixing a bug in the API, and wrote a test that
unexpectedly failed.

Digging, I've discovered that it's currently a problem on how the
MongoDB storage handles its `resource' collection: you can't have 2
resource with the same id even if they came from 2 different sources.
Meaning that if you record:

  Counter(source='abc', resource_id='foobar')
  Counter(source='def', resource_id='foobar')

You'll end up with the 'source' field being overwritte because the
resource collection use resource_id as its MongoDB _id field.

So in the end, the request '/sources/abc/resources/foobar' returns
nothing.

This seems like a bug to me, because I easily imagine external systems
with different source values having resource-id that can collide,
because they're not UUID or the like.

Doug, what's your opinion this, and how to fix it?

-- 
Julien Danjou
# Free Software hacker & freelance
# http://julien.danjou.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121116/3c7ffe7f/attachment.pgp>


More information about the OpenStack-dev mailing list