Skip to content

Commit

Permalink
update call to PlannedReparentShard
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Feb 27, 2024
1 parent 18d34b0 commit e75084c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/controller/vitessshardreplication/reconcile_drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/topo/topoproto"
"vitess.io/vitess/go/vt/vtctl/reparentutil"
"vitess.io/vitess/go/vt/wrangler"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -312,7 +313,12 @@ func (r *ReconcileVitessShard) reconcileDrain(ctx context.Context, vts *planetsc
if vts.Spec.UsingExternalDatastore() {
reparentErr = r.handleExternalReparent(ctx, vts, wr, newPrimary.Alias, shard.PrimaryAlias)
} else {
reparentErr = wr.PlannedReparentShard(reparentCtx, keyspaceName, vts.Spec.Name, newPrimary.Alias, nil, plannedReparentTimeout, tolerableReplicationLag)
reparentErr = wr.PlannedReparentShard(reparentCtx, keyspaceName, vts.Spec.Name, reparentutil.PlannedReparentOptions{
NewPrimaryAlias: newPrimary.Alias,
AvoidPrimaryAlias: nil,
WaitReplicasTimeout: plannedReparentTimeout,
TolerableReplLag: tolerableReplicationLag,
})
}

if reparentErr != nil {
Expand Down

0 comments on commit e75084c

Please sign in to comment.