Bug 852976 - Race condition : one of the embedded cartridges will be corrupt when adding two cartridges to same app at same time
Summary: Race condition : one of the embedded cartridges will be corrupt when adding t...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-30 07:14 UTC by Meng Bo
Modified: 2015-05-14 22:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-11 15:36:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
race_add_cartridges (29.75 KB, text/x-log)
2012-08-30 07:14 UTC, Meng Bo
no flags Details

Description Meng Bo 2012-08-30 07:14:14 UTC
Created attachment 608060 [details]
race_add_cartridges

Description of problem:
Add to embedded cartridges two a same app at the same time, eg. mysql and mongodb.
All the action will exit with correct result. But when trying to check the application info via rhc app show, only one cartridge will show in the app info.
And then try too remove the missing one from the app, will get the cartridge doesn't embed to the app, and try to embed the missing one to the app again, it can not be embedded.

Version-Release number of selected component (if applicable):
devenv_2097

How reproducible:
always

Steps to Reproduce:
1.Create an app
$rhc app create -a php1 -t php-5.3
2.Add mysql and mongodb to the app at the same time
Open two terminals and send the commands rapidly
3.Check the app info via 'rhc app show'
4.Try to remove the missing cartridge
5.Try to add the missing cartridge again

  
Actual results:
3.Only one cartridge can be list in the app info.
4.Cannot remove the missing one.
5.Cannot add the missing one again.

Expected results:
Both of the two carts can be added to the app.

Additional info:
Attached the development log for debug.

Comment 1 joycezhang 2012-09-05 02:57:11 UTC
When add postgresql and mongodb to an app at the same time, incorrect error message is shown as below:

# rhc app cartridge add -a myscapp2 -c postgresql-8.4 -p ab
Problem reported from server. Response code was 500.
Re-run with -d for more information.
RESULT:
Only 1 embedded database permitted - application currently has 'mongodb'

Expected results:
Both of the db cartridge can be added to the app.

Comment 2 Dan McPherson 2012-09-05 14:48:15 UTC
I am missing in the code how the issue from comment 2 is happening appears to be mongodb is being set as the env var for db type.  The original issue from comment 1 is still there and being fixed upstream in kraman/features/model_refactor.  Sending to the runtime team to look at item 2.

Comment 3 Dan Mace 2012-09-11 15:36:27 UTC
Closing, as the originally reported issue is being fixed upstream in the broker. The runtime does not yet support adding multiple DB carts to an application, so bugs shouldn't be filed against that functionality.


Note You need to log in before you can comment on or make changes to this bug.