### CI Link

https://gradle-enterprise.elastic.co/s/xe5tsxwd6ky64

### Repro line

./gradlew ':modules:reindex:internalClusterTest' --tests "org.elasticsearch.migration.SystemIndexMigrationIT.testSystemIndexMigrationCanBeInterruptedWithShutdown" -Dtests.seed=21ABF49FDF24F147 -Dtests.locale=ar-DZ -Dtests.timezone=Europe/Vatican -Druntime.java=17

### Does it reproduce?

No

### Applicable branches

8.0

### Failure history

Looks like the first time it has failed

### Failure excerpt

```
org.elasticsearch.migration.SystemIndexMigrationIT > testSystemIndexMigrationCanBeInterruptedWithShutdown FAILED
    java.lang.AssertionError: expected migration to fail due to restarting only data node
    Expected: <ERROR>
         but: was <NO_MIGRATION_NEEDED>
        at __randomizedtesting.SeedInfo.seed([21ABF49FDF24F147:5E92BED7875328A5]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.junit.Assert.assertThat(Assert.java:956)
        at org.elasticsearch.migration.SystemIndexMigrationIT.lambda$testSystemIndexMigrationCanBeInterruptedWithShutdown$1(SystemIndexMigrationIT.java:119)
        at org.elasticsearch.test.ESTestCase.assertBusy(ESTestCase.java:1069)
        at org.elasticsearch.test.ESTestCase.assertBusy(ESTestCase.java:1042)
        at org.elasticsearch.migration.SystemIndexMigrationIT.testSystemIndexMigrationCanBeInterruptedWithShutdown(SystemIndexMigrationIT.java:110)
```
modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/SystemIndexMigrationIT.java
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.persistent.PersistentTasksCustomMetadata;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.reindex.ReindexPlugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.InternalTestCluster;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.elasticsearch.upgrades.SystemIndexMigrationTaskParams.SYSTEM_INDEX_UPGRADE_TASK_NAME;
import static org.hamcrest.Matchers.equalTo;
/**
 * This class is for testing that when restarting a node, SystemIndexMigrationTaskState can be read.
 */
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0, autoManageMasterNodes = false)
public class SystemIndexMigrationIT extends AbstractFeatureMigrationIntegTest {
    private static Logger logger = LogManager.getLogger(SystemIndexMigrationIT.class);
    @Override
    protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
        return Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings)).build();
    }
    @Override
    protected boolean forbidPrivateIndexSettings() {