Skip to content

Commit

Permalink
MysqlCtl: implement missing ReadBinlogFilesTimestamps function (#14525
Browse files Browse the repository at this point in the history
)

Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach authored Nov 15, 2023
1 parent c823b86 commit 4a0aa63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions go/test/endtoend/mysqlctld/mysqlctld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

"vitess.io/vitess/go/constants/sidecar"
"vitess.io/vitess/go/vt/mysqlctl/mysqlctlclient"
"vitess.io/vitess/go/vt/proto/mysqlctl"

"vitess.io/vitess/go/test/endtoend/cluster"
)
Expand Down Expand Up @@ -169,3 +170,10 @@ func TestVersionString(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, version)
}

func TestReadBinlogFilesTimestamps(t *testing.T) {
client, err := mysqlctlclient.New("unix", primaryTablet.MysqlctldProcess.SocketFile)
require.NoError(t, err)
_, err = client.ReadBinlogFilesTimestamps(context.Background(), &mysqlctl.ReadBinlogFilesTimestampsRequest{})
require.ErrorContains(t, err, "empty binlog list in ReadBinlogFilesTimestampsRequest")
}
5 changes: 5 additions & 0 deletions go/vt/mysqlctl/grpcmysqlctlserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func (s *server) ApplyBinlogFile(ctx context.Context, request *mysqlctlpb.ApplyB
return &mysqlctlpb.ApplyBinlogFileResponse{}, s.mysqld.ApplyBinlogFile(ctx, request)
}

// ReadBinlogFilesTimestamps implements the server side of the MysqlctlClient interface.
func (s *server) ReadBinlogFilesTimestamps(ctx context.Context, request *mysqlctlpb.ReadBinlogFilesTimestampsRequest) (*mysqlctlpb.ReadBinlogFilesTimestampsResponse, error) {
return s.mysqld.ReadBinlogFilesTimestamps(ctx, request)
}

// ReinitConfig implements the server side of the MysqlctlClient interface.
func (s *server) ReinitConfig(ctx context.Context, request *mysqlctlpb.ReinitConfigRequest) (*mysqlctlpb.ReinitConfigResponse, error) {
return &mysqlctlpb.ReinitConfigResponse{}, s.mysqld.ReinitConfig(ctx, s.cnf)
Expand Down

0 comments on commit 4a0aa63

Please sign in to comment.