**Build scan:**
https://gradle-enterprise.elastic.co/s/nmjznurkclizw/tests/:x-pack:plugin:security:internalClusterTest/org.elasticsearch.xpack.security.profile.ProfileDomainIntegTests/testConcurrentCreationOfNewProfiles

**Reproduction line:**
`./gradlew ':x-pack:plugin:security:internalClusterTest' --tests "org.elasticsearch.xpack.security.profile.ProfileDomainIntegTests.testConcurrentCreationOfNewProfiles" -Dtests.seed=DF7A58E7374EF2C7 -Dtests.locale=id-ID -Dtests.timezone=Europe/Ljubljana -Druntime.java=17`

**Applicable branches:**
master

**Reproduces locally?:**
No

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.security.profile.ProfileDomainIntegTests&tests.test=testConcurrentCreationOfNewProfiles

**Failure excerpt:**
```
com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=339, name=Thread-17, state=RUNNABLE, group=TGRP-ProfileDomainIntegTests]


  Caused by: java.lang.AssertionError: caught error when creating new profile: org.elasticsearch.action.UnavailableShardsException: at least one primary shard for the index [.security-profile-8] is unavailable

    at __randomizedtesting.SeedInfo.seed([DF7A58E7374EF2C7]:0)
    at org.junit.Assert.fail(Assert.java:88)
    at org.elasticsearch.xpack.security.profile.ProfileDomainIntegTests.lambda$testConcurrentCreationOfNewProfiles$0(ProfileDomainIntegTests.java:321)
    at java.lang.Thread.run(Thread.java:833)

```
x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/profile/ProfileDomainIntegTests.java
assertThat(currentUid.substring(0, currentUid.length() - 2), equalTo(lastUid.substring(0, lastUid.length() - 2)));
            }
            final String newUsername = i == otherRacUserIndex ? OTHER_RAC_USER_NAME : "some-other-name-" + randomAlphaOfLength(8);
            
            final UpdateRequest updateRequest = client().prepareUpdate(SECURITY_PROFILE_ALIAS, "profile_" + currentUid).setDoc("""
                {
                  "user_profile": {
                    "user": { "username": "%s" }
                  }
                }
                """.formatted(newUsername), XContentType.JSON).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).request();
            client().update(updateRequest).actionGet();
            if (newUsername.equals(OTHER_RAC_USER_NAME)) {
                
                assertThat(doActivateProfile(OTHER_RAC_USER_NAME, TEST_PASSWORD_SECURE_STRING).uid(), equalTo(currentUid));
            }
            lastUid = currentUid;
        }
        final ElasticsearchException e = expectThrows(
            ElasticsearchException.class,
            () -> doActivateProfile(RAC_USER_NAME, TEST_PASSWORD_SECURE_STRING)
        );
        assertThat(e.getMessage(), containsString("differentiator value is too high"));
    }
    public void testBackoffDepletion() {
        final Subject subject = new Subject(
            new User(randomAlphaOfLengthBetween(5, 12)),
            AuthenticationTests.randomRealmRef(randomBoolean())
        );
        final ProfileDocument profileDocument = ProfileDocument.fromSubject(subject);