From http://logs.openstack.org/80/49580/2/check/check-tempest-devstack-vm-postgres-full/9fbd338/logs
2013-10-09 16:31:59.651 23708 ERROR ceilometer.collector.dispatcher.database [req-0d709c16-9e46-4eac-be31-0c2c4499dec5 admin None] Failed to record metering data: (IntegrityError) duplicate key value violates unique constraint "project_pkey"
2013-10-09 16:32:30.476 23708 ERROR ceilometer.collector.dispatcher.database [req-636bd715-dac8-44d2-9fb9-8651b748e025 None None] Failed to record metering data: (IntegrityError) duplicate key value violates unique constraint "resource_pkey"
2013-10-09 16:32:31.298 23708 ERROR ceilometer.collector.dispatcher.database [req-a355551e-da8d-400a-90a8-56b3053cf36b None None] Failed to record metering data: (IntegrityError) duplicate key value violates unique constraint "resource_pkey"
2013-10-09 16:32:32.542 23708 ERROR ceilometer.collector.dispatcher.database [req-35402a60-f548-435f-b560-2243521dba07 None None] Failed to record metering data: (IntegrityError) duplicate key value violates unique constraint "resource_pkey"
Reviewed: https:/ /review. openstack. org/53321 github. com/openstack/ ceilometer/ commit/ dd62f9ce0d8d5ab ac0fb34b0520515 b6c4566c1f
Committed: http://
Submitter: Jenkins
Branch: master
commit dd62f9ce0d8d5ab ac0fb34b0520515 b6c4566c1f
Author: Mehdi Abaakouk <email address hidden>
Date: Wed Oct 23 13:33:53 2013 +0200
make record_ metering_ data concurrency safe
Recording metering might happen in parallel, and if two sqlalchemy
session try to create a source, a user, a project or a resource at the
same time, one of them fail with a IntegrityError.
This patch ensure the record_ metering_ data sqlalchemy session always
have the needed source, user, project and a resource by creating missing
obj in an other sqlalchemy session.
Fixes bug: #1237671
Change-Id: Ie8761ce1615c31 42ad6ad2a400537 f465f3bbf0a