From b6ff221d4212bc013f86cb87ef1dcc76b996cc18 Mon Sep 17 00:00:00 2001 From: anshikavashistha <93611566+anshikavashistha@users.noreply.github.com> Date: Wed, 5 Feb 2025 00:55:14 +0530 Subject: [PATCH] Update vschema.go Signed-off-by: anshikavashistha <93611566+anshikavashistha@users.noreply.github.com> --- go/vt/topo/vschema.go | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/go/vt/topo/vschema.go b/go/vt/topo/vschema.go index 5c62c3c395a..4ef5a077a54 100644 --- a/go/vt/topo/vschema.go +++ b/go/vt/topo/vschema.go @@ -328,42 +328,4 @@ func (ts *Server) SaveMirrorRules(ctx context.Context, mirrorRules *vschemapb.Mi return err } -type VSchemaInfo struct { - keyspace string - version Version - *vschemapb.Keyspace -} - -func (ts *Server) GetVSchema(ctx context.Context, keyspace string) (*VSchemaInfo, error) { - ksvs, err := ts.GetVSchema(ctx, keyspace) - if err != nil { - return nil, err - } - return &VSchemaInfo{ - keyspace: ksvs.Name, - version: ksvs.version, - Keyspace: ksvs.Keyspace, - }, nil -} - -func (ts *Server) SaveVSchema(ctx context.Context, keyspace string, vschema *VSchemaInfo) error { - if err := ctx.Err(); err != nil { - return err - } - - nodePath := path.Join(KeyspacesPath, keyspace, VSchemaFile) - data, err := vschema.MarshalVT() - if err != nil { - return err - } - - version, err := ts.globalCell.Update(ctx, nodePath, data, vschema.version) - if err != nil { - log.Errorf("failed to update vschema for keyspace %s: %v", keyspace, err) - return err - } - vschema.version = version - log.Infof("successfully updated vschema for keyspace %s: %+v", keyspace, vschema.Keyspace) - - return nil -} +