Files
gerrit/java/com
Edwin Kempin 97aca53208 CreateAccount: Create account and external IDs atomically
At the moment the accounts creation is done by several transactions:

1. create external ID for username + external IDs from external ID
   creators
2. create external ID for email
3. create account
4. add group memberships
5. add SSH keys

With this change the transactions 1 to 3 will become a single
transaction. As result of this we no longer need to rollback 1. if 2.
fail because the email already exists. It also means that we will leave
no orphaned external IDs behind if 3. fails.

Future changes may also include the addition of group memberships and
SSH keys in the account creation transaction.

In addition we remove the checks for existing external IDs. They are
unneeded since we can just try the account creation and fail if any
external ID already exists. The checks were not bulletproof anyway since
a racing thread could have created the external IDs after we checked but
before we did the account creation.

Change-Id: I51d6f62045ff4b9a833b9a96ab0f253c45bf3376
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-12-19 17:06:14 +01:00
..