Red Hat Bugzilla – Bug 852976
Race condition : one of the embedded cartridges will be corrupt when adding two cartridges to same app at same time
Last modified: 2015-05-14 18:59:01 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):
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
3.Only one cartridge can be list in the app info.
4.Cannot remove the missing one.
5.Cannot add the missing one again.
Both of the two carts can be added to the app.
Attached the development log for debug.
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'
Both of the db cartridge can be added to the app.
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.
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.