[
https://issues.apache.org/jira/browse/CLOUDSTACK-7073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14258413#comment-14258413
]
Alena Prokharchyk commented on CLOUDSTACK-7073:
-----------------------------------------------
Prachi, reverting the fix wasn't the right idea. In the other bug you are
saying:
1) "So the databases prior to 4.5, which allowed the duplicate usernames will
fail to upgrade to 4.5 due to this schema change."
We NEVER allowed duplicated usernames in the code, you can see the restriction
on that from the very beginning; if it happened, it was result of this very
same bug "Account/User creation: able to create user with the same name in the
same domain in Clustered MS setup". The correct fix for the bug you've fixed,
would be removing the duplicated records, and then making the upgrade.
2) Your other comment "Also, traditionally we have the 'removed' column in the
DB to mark a user as removed, and no unique constraint allowing us to add
another user with same name.". We should file a different bug for that - on
removed event we should simply NULL the userName field in cloud.users table. It
should be done by overriding remove() call in UserDaoImpl class.
There is no other way to fix this bug but by introducing the domain_id field
for unique constraint check. We can't do it in the code as it won't work in
cluster management setup. We should put back the original fix, provide the
customer with the steps to fix their environments, and fix #2
> Account/User creation: able to create user with the same name in the same
> domain in Clustered MS setup
> ------------------------------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-7073
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7073
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Management Server
> Affects Versions: 4.5.0
> Reporter: Alena Prokharchyk
> Assignee: Alena Prokharchyk
> Fix For: 4.6.0
>
>
> In the Java code we prohibit user to have duplicated names inside the same
> domain. But in the DB the constraint is missing in cloud.account/cloud.user
> table, so it is still possible to violate the rule by initiating the create
> call from parallel threads issued either by the same MS, or by multiple MS in
> the clustered MS setup.
> To fix, have to introduce some kind of the global lock, or db constraint
> preventing multiple threads to insert the record with the same username.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)