Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

1080609 - pulp-manage-db now ensures the admin. #905

Merged
merged 1 commit into from Apr 21, 2014
Merged

Conversation

bowlofeggs
Copy link
Contributor

The webserver used to create the admin role and user if it didn't exist
upon startup. Once Pulp started to be deployed to multiple processes,
this caused a uniqueness constraint to be raised during the first
startup of Apache, as each process raced to create the admin user
simultaneously.

This commit moves the admin role and user creation into the
pulp-manage-db script.

https://bugzilla.redhat.com/show_bug.cgi?id=1080609

The webserver used to create the admin role and user if it didn't exist
upon startup. Once Pulp started to be deployed to multiple processes,
this caused a uniqueness constraint to be raised during the first
startup of Apache, as each process raced to create the admin user
simultaneously.

This commit moves the admin role and user creation into the
pulp-manage-db script.

https://bugzilla.redhat.com/show_bug.cgi?id=1080609
@jortel
Copy link
Contributor

jortel commented Apr 21, 2014

LGTM

One comment pertaining to the two managers involved here (which I know you did not write). I'm not a fan of checking to see if something exists before creating it in concurrent systems. I would favor catching the duplicate key instead which would account for race conditions.

@bowlofeggs
Copy link
Contributor Author

Yeah I agree with that in general. This shouldn't affect us anymore since we are using pulp-manage-db in these particular cases, so I will avoid refactoring those methods at this time. Thanks!

@bowlofeggs bowlofeggs merged commit 8ace3d6 into master Apr 21, 2014
@bowlofeggs bowlofeggs deleted the rbarlow-1080609 branch April 21, 2014 21:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants