Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions controllers/apps/cluster/transformer_cluster_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package cluster

import (
"fmt"
"time"

"k8s.io/apimachinery/pkg/util/json"
"sigs.k8s.io/controller-runtime/pkg/client"

Expand Down Expand Up @@ -71,6 +74,10 @@ func (c *clusterRestoreTransformer) Transform(ctx graph.TransformContext, dag *g
if err != nil {
return err
}
if int(spec.Shards) > len(backup.Status.Targets) && len(shardComponents) < int(spec.Shards) {
return intctrlutil.NewRequeueError(time.Second,
fmt.Sprintf(`the shard components of sharding "%s" are not ready, wait for next loop to allocate source targets`, spec.Name))
}
// obtain components that have already been assigned targets.
allocateTargetMap := map[string]string{}
restoreDoneForShardComponents := true
Expand Down