Bug 811524

Summary: Get improper error when trying to add MySQL and PostgreSQL at the same time.
Product: OKD Reporter: yquan <yquan>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED UPSTREAM QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: dmcphers, jhonce, mpatel
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-14 18:00:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description yquan 2012-04-11 10:35:02 UTC
Description of problem:
Add the MySQL and PostgreSQL at the same time,there are two kinds of results:
1. both  MySQL and PostgreSQL will return a successful page. Actually only one of them has been added successfully.

2. both of them return error massage, and can't add them again.

Version-Release number of selected component (if applicable):
devenv_1713
mysql-5.1.61-1.el6_2.1.x86_64
postgresql-8.4.9-1.el6_1.1.x86_64

How reproducible:
Random

Steps to Reproduce:
1.Create an app via Web
2.Open adding MySql page in a new tab by selecting MySql
3.Open adding postgresql page in a new tab by selecting postgresql
4.Click the button "add" at the same time in two pages

  
Actual results:
There are two kinds of results:
1. both  MySQL and PostgreSQL will return a successful page. Actually only one of them has been added successfully.

2. both of them return error massage, and can't add them again.
Expected results:
One of MySQL and PostgreSQL will be added successfully, and the one that  failed to be added  will have error massage.

Additional info:

Comment 1 Mrunal Patel 2012-04-11 16:51:13 UTC
Looks like a race condition. Should we only allow one request at a time (at the broker level) for adding embedded cartridges?

Comment 2 Dan McPherson 2012-05-29 14:58:58 UTC
The cartridges are currently enforcing this limitation but not in a race condition proof way.  The carts need to be changed to write DB_TYPE and check for DB_TYPE in the same code block.  Currently they check for DB_TYPE up top and then add DB_TYPE much later.