Currently when the ilm rollup step is being retried the same target index is being used. This can cause the subsequent downsample api invocation to index rolled up data into shards of the target index that already exists and while the previous downsample api invocation is still partially running (and also rolling up data into the same target shard).

Note that, the rollup step may fail in case a cluster is being restarted in a rolling manner (for example for an upgrade) or when the elected master node fails (the downsample action is coordinated from the elected master node).

The fix would be that the `RollupStep` isn't retried on its own incase it fails to execute, but that the step that generates the target index name for downsampling is retried first and then the rollup step.

server/src/main/java/org/elasticsearch/cluster/metadata/LifecycleExecutionState.java
return this;
        }
        public Builder setAction(String action) {
            this.action = action;
            return this;
        }
        public Builder setStep(String step) {
            this.step = step;
            return this;
        }
        public Builder setFailedStep(String failedStep) {
            this.failedStep = failedStep;
            return this;
        }
        public Builder setStepInfo(String stepInfo) {
            this.stepInfo = stepInfo;
            return this;
        }
        public Builder setPhaseDefinition(String phaseDefinition) {
            this.phaseDefinition = phaseDefinition;
            return this;
        }
        public Builder setIndexCreationDate(Long indexCreationDate) {
            this.indexCreationDate = indexCreationDate;
            return this;
        }
        public Builder setPhaseTime(Long phaseTime) {
            this.phaseTime = phaseTime;
            return this;
        }