Bug 852976 - Race condition : one of the embedded cartridges will be corrupt when adding two cartridges to same app at same time
Race condition : one of the embedded cartridges will be corrupt when adding t...
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rob Millner
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2012-08-30 03:14 EDT by Meng Bo
Modified: 2015-05-14 18:59 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-09-11 11:36:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Meng Bo 2012-08-30 03:14:14 EDT
Created attachment 608060 [details]

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):

How reproducible:

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-04 22:57:11 EDT
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.
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 10:48:15 EDT
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 11:36:27 EDT
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.