-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report: vtctldclient fails to apply routing rules #16095
Comments
The problem is here: https://github.com/vitessio/vitess/blob/main/go/cmd/vtctldclient/command/routing_rules.go#L84-L87 I think that we should be using Test case that fails on main:
That same test case works as expected after this patch/fix: diff --git a/go/cmd/vtctldclient/command/routing_rules.go b/go/cmd/vtctldclient/command/routing_rules.go
index 0ffee0c2c2..119c8dbb41 100644
--- a/go/cmd/vtctldclient/command/routing_rules.go
+++ b/go/cmd/vtctldclient/command/routing_rules.go
@@ -23,9 +23,9 @@ import (
"strings"
"github.com/spf13/cobra"
+ "google.golang.org/protobuf/encoding/protojson"
"vitess.io/vitess/go/cmd/vtctldclient/cli"
- "vitess.io/vitess/go/json2"
vschemapb "vitess.io/vitess/go/vt/proto/vschema"
vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata"
@@ -82,7 +82,7 @@ func commandApplyRoutingRules(cmd *cobra.Command, args []string) error {
}
rr := &vschemapb.RoutingRules{}
- if err := json2.Unmarshal(rulesBytes, &rr); err != nil {
+ if err := protojson.Unmarshal(rulesBytes, rr); err != nil {
return err
} I'm not sure if that's the right/best ultimate fix, but it points to the problem space. |
This seems wrong. Lines 35 to 38 in 6fb0f0e
|
fixed via #16096 |
Overview of the Issue
I am using
ApplyRoutingRules --rules '<valid json>'
to add routing rules to my Vitess cluster.The vtctld response parses the correct number of routing rules but the fromTable and toTables reponses are empty:
Example
Reproduction Steps
vtctldclient
Binary Version
$ vtctldclient --version vtctldclient version Version: 18.0.5 (Git revision 4bd2e1c2f88cbff68f8b969a9ee6dad236713490 branch 'HEAD') built on Wed May 8 12:04:27 UTC 2024 by runner@fv-az1024-873 using go1.21.10 linux/amd64
Operating System and Environment details
The text was updated successfully, but these errors were encountered: