From 58bbc18be5d1d58e3e1d984d3944d5546331cf84 Mon Sep 17 00:00:00 2001 From: frouioui Date: Sun, 12 Jan 2025 00:05:00 +0000 Subject: [PATCH 1/2] upgrade vitess dependency to latest Signed-off-by: GitHub --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6a9b9b96..733e9e5f 100644 --- a/go.mod +++ b/go.mod @@ -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 ( diff --git a/go.sum b/go.sum index f0cf4a00..98d1ccd0 100644 --- a/go.sum +++ b/go.sum @@ -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= From aee8b55c6994366592f583bf9e9854bf2ab0ea23 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Mon, 13 Jan 2025 09:41:11 +0530 Subject: [PATCH 2/2] feat: fix build issues Signed-off-by: Manan Gupta --- .../vitessshardreplication/init_restored_shard.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controller/vitessshardreplication/init_restored_shard.go b/pkg/controller/vitessshardreplication/init_restored_shard.go index 266a66a5..00ca8aa5 100644 --- a/pkg/controller/vitessshardreplication/init_restored_shard.go +++ b/pkg/controller/vitessshardreplication/init_restored_shard.go @@ -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 @@ -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 } @@ -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) } @@ -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) }