magnum-conductor raise db_exc.DBDuplicateEntry when to start multiple processes concurrently

Bug #1711324 reported by Wang Bo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
New
Undecided
Wang Bo

Bug Description

ENV:
[root@node-1 ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node(s): 2

================================

conductor.log:
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task [-] Error during MagnumServicePeriodicTasks.update_magnum_service
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task Traceback (most recent call last):
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/site-packages/oslo_service/periodic_task.py", line 220, in run_periodic_tasks
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task task(self, context)
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/site-packages/magnum/service/periodic.py", line 42, in handler
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/site-packages/magnum/servicegroup/magnum_service_periodic.py", line 54, in update_magnum_service
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 223, in wrapper
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task return fn(self, *args, **kwargs)
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/site-packages/magnum/objects/magnum_service.py", line 101, in create
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/site-packages/magnum/db/sqlalchemy/api.py", line 915, in create_magnum_service
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task MagnumServiceAlreadyExists: A magnum service with ID None already exists.
2017-07-09 00:10:13.553 61213 ERROR oslo_service.periodic_task

we have enable multiple workers of magnum-conductor that result in different processes save same DB entry concurrently.

Wang Bo (chestack)
Changed in magnum:
assignee: nobody → Wang Bo (chestack)
Wang Bo (chestack)
description: updated
description: updated
summary: - magnum-conductor failed to start multiple processes concurrently
+ magnum-conductor raise db_exc.DBDuplicateEntry when to start multiple
+ processes concurrently
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/494473

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/497148

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/494473
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=c22f9cd882cd899b0e25796c40da67960d7a038d
Submitter: Jenkins
Branch: master

commit c22f9cd882cd899b0e25796c40da67960d7a038d
Author: chestack <wangbo_bupt@163.com>
Date: Thu Aug 17 18:05:02 2017 +0800

    Deal with db_exc.DBDuplicate of conductor startup

    we have enable multiple workers of magnum-conductor that
    result in multiple processes save same DB entry concurrently.

    This patch logs warning message instead of raising exception

    Change-Id: I548d50bed5d80e96042f88039e880075e1bffc53
    Close-Bug: #1711324

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (stable/pike)

Reviewed: https://review.openstack.org/497148
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=a8fe48685d7775e9dc439de08c1431ccdbacf8a9
Submitter: Jenkins
Branch: stable/pike

commit a8fe48685d7775e9dc439de08c1431ccdbacf8a9
Author: chestack <wangbo_bupt@163.com>
Date: Thu Aug 17 18:05:02 2017 +0800

    Deal with db_exc.DBDuplicate of conductor startup

    we have enable multiple workers of magnum-conductor that
    result in multiple processes save same DB entry concurrently.

    This patch logs warning message instead of raising exception

    Change-Id: I548d50bed5d80e96042f88039e880075e1bffc53
    Close-Bug: #1711324

tags: added: in-stable-pike
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.