Skip to content

Commit

Permalink
Merge pull request #652 from planetscale/create-pull-request/patch
Browse files Browse the repository at this point in the history
Upgrade Vitess Dependency to Latest
  • Loading branch information
frouioui authored Jan 13, 2025
2 parents b129bb4 + aee8b55 commit 9ab5f87
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
sigs.k8s.io/controller-runtime v0.19.0
sigs.k8s.io/controller-tools v0.16.1
sigs.k8s.io/kustomize v2.0.3+incompatible
vitess.io/vitess v0.10.3-0.20250103182021-b36b2284176d
vitess.io/vitess v0.10.3-0.20250110203148-54dfd6005bcd
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -866,5 +866,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77Vzej
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
vitess.io/vitess v0.10.3-0.20250103182021-b36b2284176d h1:inpCTEIciqQtuSCLJbFlgToS+dFnPC3/OiSfmWEKKxs=
vitess.io/vitess v0.10.3-0.20250103182021-b36b2284176d/go.mod h1:D8Hkm8b/5vxA798FWZcn9WeZthOVFt3ko+yGPQZ/DGE=
vitess.io/vitess v0.10.3-0.20250110203148-54dfd6005bcd h1:go7v1XHtzBNk6iwuUntTT80NmPrdEfUU8L5rEnsxHUI=
vitess.io/vitess v0.10.3-0.20250110203148-54dfd6005bcd/go.mod h1:D8Hkm8b/5vxA798FWZcn9WeZthOVFt3ko+yGPQZ/DGE=
8 changes: 4 additions & 4 deletions pkg/controller/vitessshardreplication/init_restored_shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (

corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"vitess.io/vitess/go/vt/vtctl/reparentutil/policy"

"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/mysql/replication"
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"

// register grpc tabletmanager client
Expand Down Expand Up @@ -156,7 +156,7 @@ func electInitialShardPrimary(ctx context.Context, keyspaceName, shardName strin
if err != nil {
return nil, err
}
durability, err := reparentutil.GetDurabilityPolicy(keyspaceDurability)
durability, err := policy.GetDurabilityPolicy(keyspaceDurability)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -243,7 +243,7 @@ func electInitialShardPrimary(ctx context.Context, keyspaceName, shardName strin
return nil, fmt.Errorf("lost topology lock; aborting: %v", err)
}
// Promote the candidate to primary.
_, err = wr.TabletManagerClient().PromoteReplica(ctx, candidatePrimary.tablet.Tablet, reparentutil.SemiSyncAckers(durability, candidatePrimary.tablet.Tablet) > 0)
_, err = wr.TabletManagerClient().PromoteReplica(ctx, candidatePrimary.tablet.Tablet, policy.SemiSyncAckers(durability, candidatePrimary.tablet.Tablet) > 0)
if err != nil {
return nil, fmt.Errorf("failed to promote tablet %v to primary: %v", candidatePrimary.tablet.AliasString(), err)
}
Expand All @@ -269,7 +269,7 @@ func electInitialShardPrimary(ctx context.Context, keyspaceName, shardName strin
wg.Add(1)
go func(tablet *topo.TabletInfo) {
defer wg.Done()
err := wr.TabletManagerClient().SetReplicationSource(ctx, tablet.Tablet, candidatePrimary.tablet.Alias, 0 /* don't try to wait for a reparent journal entry */, "" /* don't wait for any position */, true /* forceStartReplication */, reparentutil.IsReplicaSemiSync(durability, candidatePrimary.tablet.Tablet, tablet.Tablet), 0)
err := wr.TabletManagerClient().SetReplicationSource(ctx, tablet.Tablet, candidatePrimary.tablet.Alias, 0 /* don't try to wait for a reparent journal entry */, "" /* don't wait for any position */, true /* forceStartReplication */, policy.IsReplicaSemiSync(durability, candidatePrimary.tablet.Tablet, tablet.Tablet), 0)
if err != nil {
log.Warningf("best-effort configuration of replication for tablet %v failed: %v", tablet.AliasString(), err)
}
Expand Down

0 comments on commit 9ab5f87

Please sign in to comment.