diff --git a/go/vt/proto/query/query.pb.go b/go/vt/proto/query/query.pb.go index 4bf07e52fc..5b39b60ba3 100644 --- a/go/vt/proto/query/query.pb.go +++ b/go/vt/proto/query/query.pb.go @@ -398,21 +398,13 @@ func (m *GetSessionIdRequest) GetImmediateCallerId() *VTGateCallerID { // GetSessionIdResponse is the returned value from GetSessionId type GetSessionIdResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - SessionId int64 `protobuf:"varint,2,opt,name=session_id" json:"session_id,omitempty"` + SessionId int64 `protobuf:"varint,1,opt,name=session_id" json:"session_id,omitempty"` } func (m *GetSessionIdResponse) Reset() { *m = GetSessionIdResponse{} } func (m *GetSessionIdResponse) String() string { return proto.CompactTextString(m) } func (*GetSessionIdResponse) ProtoMessage() {} -func (m *GetSessionIdResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - // ExecuteRequest is the payload to Execute type ExecuteRequest struct { EffectiveCallerId *vtrpc.CallerID `protobuf:"bytes,1,opt,name=effective_caller_id" json:"effective_caller_id,omitempty"` @@ -457,21 +449,13 @@ func (m *ExecuteRequest) GetQuery() *BoundQuery { // ExecuteResponse is the returned value from Execute type ExecuteResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - Result *QueryResult `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"` + Result *QueryResult `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` } func (m *ExecuteResponse) Reset() { *m = ExecuteResponse{} } func (m *ExecuteResponse) String() string { return proto.CompactTextString(m) } func (*ExecuteResponse) ProtoMessage() {} -func (m *ExecuteResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - func (m *ExecuteResponse) GetResult() *QueryResult { if m != nil { return m.Result @@ -524,21 +508,13 @@ func (m *ExecuteBatchRequest) GetQueries() []*BoundQuery { // ExecuteBatchResponse is the returned value from ExecuteBatch type ExecuteBatchResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - Results []*QueryResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` + Results []*QueryResult `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` } func (m *ExecuteBatchResponse) Reset() { *m = ExecuteBatchResponse{} } func (m *ExecuteBatchResponse) String() string { return proto.CompactTextString(m) } func (*ExecuteBatchResponse) ProtoMessage() {} -func (m *ExecuteBatchResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - func (m *ExecuteBatchResponse) GetResults() []*QueryResult { if m != nil { return m.Results @@ -589,21 +565,13 @@ func (m *StreamExecuteRequest) GetQuery() *BoundQuery { // StreamExecuteResponse is the returned value from StreamExecute type StreamExecuteResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - Result *QueryResult `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"` + Result *QueryResult `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` } func (m *StreamExecuteResponse) Reset() { *m = StreamExecuteResponse{} } func (m *StreamExecuteResponse) String() string { return proto.CompactTextString(m) } func (*StreamExecuteResponse) ProtoMessage() {} -func (m *StreamExecuteResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - func (m *StreamExecuteResponse) GetResult() *QueryResult { if m != nil { return m.Result @@ -646,21 +614,13 @@ func (m *BeginRequest) GetTarget() *Target { // BeginResponse is the returned value from Begin type BeginResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - TransactionId int64 `protobuf:"varint,2,opt,name=transaction_id" json:"transaction_id,omitempty"` + TransactionId int64 `protobuf:"varint,1,opt,name=transaction_id" json:"transaction_id,omitempty"` } func (m *BeginResponse) Reset() { *m = BeginResponse{} } func (m *BeginResponse) String() string { return proto.CompactTextString(m) } func (*BeginResponse) ProtoMessage() {} -func (m *BeginResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - // CommitRequest is the payload to Commit type CommitRequest struct { EffectiveCallerId *vtrpc.CallerID `protobuf:"bytes,1,opt,name=effective_caller_id" json:"effective_caller_id,omitempty"` @@ -697,20 +657,12 @@ func (m *CommitRequest) GetTarget() *Target { // CommitResponse is the returned value from Commit type CommitResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` } func (m *CommitResponse) Reset() { *m = CommitResponse{} } func (m *CommitResponse) String() string { return proto.CompactTextString(m) } func (*CommitResponse) ProtoMessage() {} -func (m *CommitResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - // RollbackRequest is the payload to Rollback type RollbackRequest struct { EffectiveCallerId *vtrpc.CallerID `protobuf:"bytes,1,opt,name=effective_caller_id" json:"effective_caller_id,omitempty"` @@ -747,20 +699,12 @@ func (m *RollbackRequest) GetTarget() *Target { // RollbackResponse is the returned value from Rollback type RollbackResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` } func (m *RollbackResponse) Reset() { *m = RollbackResponse{} } func (m *RollbackResponse) String() string { return proto.CompactTextString(m) } func (*RollbackResponse) ProtoMessage() {} -func (m *RollbackResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - // SplitQueryRequest is the payload for SplitQuery type SplitQueryRequest struct { EffectiveCallerId *vtrpc.CallerID `protobuf:"bytes,1,opt,name=effective_caller_id" json:"effective_caller_id,omitempty"` @@ -826,21 +770,13 @@ func (m *QuerySplit) GetQuery() *BoundQuery { // SplitQueryResponse is returned by SplitQuery and represents all the queries // to execute in order to get the entire data set. type SplitQueryResponse struct { - Error *vtrpc.RPCError `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - Queries []*QuerySplit `protobuf:"bytes,2,rep,name=queries" json:"queries,omitempty"` + Queries []*QuerySplit `protobuf:"bytes,1,rep,name=queries" json:"queries,omitempty"` } func (m *SplitQueryResponse) Reset() { *m = SplitQueryResponse{} } func (m *SplitQueryResponse) String() string { return proto.CompactTextString(m) } func (*SplitQueryResponse) ProtoMessage() {} -func (m *SplitQueryResponse) GetError() *vtrpc.RPCError { - if m != nil { - return m.Error - } - return nil -} - func (m *SplitQueryResponse) GetQueries() []*QuerySplit { if m != nil { return m.Queries diff --git a/go/vt/tabletserver/gorpctabletconn/conn.go b/go/vt/tabletserver/gorpctabletconn/conn.go index b0cf6c4811..12d39eb4ff 100644 --- a/go/vt/tabletserver/gorpctabletconn/conn.go +++ b/go/vt/tabletserver/gorpctabletconn/conn.go @@ -15,6 +15,7 @@ import ( "github.com/youtube/vitess/go/netutil" "github.com/youtube/vitess/go/rpcplus" "github.com/youtube/vitess/go/rpcwrap/bsonrpc" + "github.com/youtube/vitess/go/vt/callerid" "github.com/youtube/vitess/go/vt/rpc" tproto "github.com/youtube/vitess/go/vt/tabletserver/proto" "github.com/youtube/vitess/go/vt/tabletserver/tabletconn" @@ -132,6 +133,26 @@ func (conn *TabletBson) Execute(ctx context.Context, query string, bindVars map[ return qr, nil } +func getEffectiveCallerID(ctx context.Context) *tproto.CallerID { + if ef := callerid.EffectiveCallerIDFromContext(ctx); ef != nil { + return &tproto.CallerID{ + Principal: ef.Principal, + Component: ef.Component, + Subcomponent: ef.Subcomponent, + } + } + return nil +} + +func getImmediateCallerID(ctx context.Context) *tproto.VTGateCallerID { + if im := callerid.ImmediateCallerIDFromContext(ctx); im != nil { + return &tproto.VTGateCallerID{ + Username: im.Username, + } + } + return nil +} + // Execute2 should not be used now other than in tests. // It is the CallerID enabled version of Execute // Execute2 sends to query to VTTablet @@ -143,6 +164,9 @@ func (conn *TabletBson) Execute2(ctx context.Context, query string, bindVars map } req := &tproto.ExecuteRequest{ + Target: conn.target, + EffectiveCallerID: getEffectiveCallerID(ctx), + ImmediateCallerID: getImmediateCallerID(ctx), QueryRequest: tproto.Query{ Sql: query, BindVariables: bindVars, @@ -206,6 +230,9 @@ func (conn *TabletBson) ExecuteBatch2(ctx context.Context, queries []tproto.Boun } req := tproto.ExecuteBatchRequest{ + Target: conn.target, + EffectiveCallerID: getEffectiveCallerID(ctx), + ImmediateCallerID: getImmediateCallerID(ctx), QueryBatch: tproto.QueryList{ Queries: queries, AsTransaction: asTransaction, @@ -290,13 +317,17 @@ func (conn *TabletBson) StreamExecute2(ctx context.Context, query string, bindVa return nil, nil, tabletconn.ConnClosed } - q := &tproto.Query{ - Sql: query, - BindVariables: bindVars, - TransactionId: transactionID, - SessionId: conn.sessionID, + req := &tproto.StreamExecuteRequest{ + Target: conn.target, + EffectiveCallerID: getEffectiveCallerID(ctx), + ImmediateCallerID: getImmediateCallerID(ctx), + Query: &tproto.Query{ + Sql: query, + BindVariables: bindVars, + TransactionId: transactionID, + SessionId: conn.sessionID, + }, } - req := &tproto.StreamExecuteRequest{Query: q} // Use QueryResult instead of StreamExecuteResult for now, due to backwards compatability reasons. // It'll be easuer to migrate all end-points to using StreamExecuteResult instead of // maintaining a mixture of QueryResult and StreamExecuteResult channel returns. @@ -373,7 +404,10 @@ func (conn *TabletBson) Begin2(ctx context.Context) (transactionID int64, err er } beginRequest := &tproto.BeginRequest{ - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerID: getEffectiveCallerID(ctx), + ImmediateCallerID: getImmediateCallerID(ctx), + SessionId: conn.sessionID, } beginResponse := new(tproto.BeginResponse) action := func() error { @@ -418,8 +452,11 @@ func (conn *TabletBson) Commit2(ctx context.Context, transactionID int64) error } commitRequest := &tproto.CommitRequest{ - SessionId: conn.sessionID, - TransactionId: transactionID, + Target: conn.target, + EffectiveCallerID: getEffectiveCallerID(ctx), + ImmediateCallerID: getImmediateCallerID(ctx), + SessionId: conn.sessionID, + TransactionId: transactionID, } commitResponse := new(tproto.CommitResponse) action := func() error { @@ -464,8 +501,11 @@ func (conn *TabletBson) Rollback2(ctx context.Context, transactionID int64) erro } rollbackRequest := &tproto.RollbackRequest{ - SessionId: conn.sessionID, - TransactionId: transactionID, + Target: conn.target, + EffectiveCallerID: getEffectiveCallerID(ctx), + ImmediateCallerID: getImmediateCallerID(ctx), + SessionId: conn.sessionID, + TransactionId: transactionID, } rollbackResponse := new(tproto.RollbackResponse) action := func() error { @@ -489,10 +529,13 @@ func (conn *TabletBson) SplitQuery(ctx context.Context, query tproto.BoundQuery, return } req := &tproto.SplitQueryRequest{ - Query: query, - SplitColumn: splitColumn, - SplitCount: splitCount, - SessionID: conn.sessionID, + Target: conn.target, + EffectiveCallerID: getEffectiveCallerID(ctx), + ImmediateCallerID: getImmediateCallerID(ctx), + Query: query, + SplitColumn: splitColumn, + SplitCount: splitCount, + SessionID: conn.sessionID, } reply := new(tproto.SplitQueryResult) action := func() error { diff --git a/go/vt/tabletserver/grpcqueryservice/server.go b/go/vt/tabletserver/grpcqueryservice/server.go index eb8d5a51ca..0135230176 100644 --- a/go/vt/tabletserver/grpcqueryservice/server.go +++ b/go/vt/tabletserver/grpcqueryservice/server.go @@ -33,14 +33,15 @@ func (q *query) GetSessionId(ctx context.Context, request *pb.GetSessionIdReques defer q.server.HandlePanic(&err) sessionInfo := new(proto.SessionInfo) - gsiErr := q.server.GetSessionId(&proto.SessionParams{ + if err := q.server.GetSessionId(&proto.SessionParams{ Keyspace: request.Keyspace, Shard: request.Shard, - }, sessionInfo) + }, sessionInfo); err != nil { + return nil, err + } return &pb.GetSessionIdResponse{ SessionId: sessionInfo.SessionId, - Error: tabletserver.TabletErrorToRPCError(gsiErr), }, nil } @@ -48,20 +49,17 @@ func (q *query) GetSessionId(ctx context.Context, request *pb.GetSessionIdReques func (q *query) Execute(ctx context.Context, request *pb.ExecuteRequest) (response *pb.ExecuteResponse, err error) { defer q.server.HandlePanic(&err) ctx = callerid.NewContext(callinfo.GRPCCallInfo(ctx), - request.GetEffectiveCallerId(), - request.GetImmediateCallerId(), + request.EffectiveCallerId, + request.ImmediateCallerId, ) reply := new(mproto.QueryResult) - execErr := q.server.Execute(ctx, request.Target, &proto.Query{ + if err := q.server.Execute(ctx, request.Target, &proto.Query{ Sql: string(request.Query.Sql), BindVariables: proto.Proto3ToBindVariables(request.Query.BindVariables), SessionId: request.SessionId, TransactionId: request.TransactionId, - }, reply) - if execErr != nil { - return &pb.ExecuteResponse{ - Error: tabletserver.TabletErrorToRPCError(execErr), - }, nil + }, reply); err != nil { + return nil, err } return &pb.ExecuteResponse{ Result: mproto.QueryResultToProto3(reply), @@ -72,20 +70,17 @@ func (q *query) Execute(ctx context.Context, request *pb.ExecuteRequest) (respon func (q *query) ExecuteBatch(ctx context.Context, request *pb.ExecuteBatchRequest) (response *pb.ExecuteBatchResponse, err error) { defer q.server.HandlePanic(&err) ctx = callerid.NewContext(callinfo.GRPCCallInfo(ctx), - request.GetEffectiveCallerId(), - request.GetImmediateCallerId(), + request.EffectiveCallerId, + request.ImmediateCallerId, ) reply := new(proto.QueryResultList) - execErr := q.server.ExecuteBatch(ctx, request.Target, &proto.QueryList{ + if err := q.server.ExecuteBatch(ctx, request.Target, &proto.QueryList{ Queries: proto.Proto3ToBoundQueryList(request.Queries), SessionId: request.SessionId, AsTransaction: request.AsTransaction, TransactionId: request.TransactionId, - }, reply) - if execErr != nil { - return &pb.ExecuteBatchResponse{ - Error: tabletserver.TabletErrorToRPCError(execErr), - }, nil + }, reply); err != nil { + return nil, err } return &pb.ExecuteBatchResponse{ Results: proto.QueryResultListToProto3(reply.List), @@ -96,10 +91,10 @@ func (q *query) ExecuteBatch(ctx context.Context, request *pb.ExecuteBatchReques func (q *query) StreamExecute(request *pb.StreamExecuteRequest, stream pbs.Query_StreamExecuteServer) (err error) { defer q.server.HandlePanic(&err) ctx := callerid.NewContext(callinfo.GRPCCallInfo(stream.Context()), - request.GetEffectiveCallerId(), - request.GetImmediateCallerId(), + request.EffectiveCallerId, + request.ImmediateCallerId, ) - seErr := q.server.StreamExecute(ctx, request.Target, &proto.Query{ + return q.server.StreamExecute(ctx, request.Target, &proto.Query{ Sql: string(request.Query.Sql), BindVariables: proto.Proto3ToBindVariables(request.Query.BindVariables), SessionId: request.SessionId, @@ -108,31 +103,20 @@ func (q *query) StreamExecute(request *pb.StreamExecuteRequest, stream pbs.Query Result: mproto.QueryResultToProto3(reply), }) }) - if seErr != nil { - response := &pb.StreamExecuteResponse{ - Error: tabletserver.TabletErrorToRPCError(seErr), - } - if err := stream.Send(response); err != nil { - return err - } - } - return nil } // Begin is part of the queryservice.QueryServer interface func (q *query) Begin(ctx context.Context, request *pb.BeginRequest) (response *pb.BeginResponse, err error) { defer q.server.HandlePanic(&err) ctx = callerid.NewContext(callinfo.GRPCCallInfo(ctx), - request.GetEffectiveCallerId(), - request.GetImmediateCallerId(), + request.EffectiveCallerId, + request.ImmediateCallerId, ) txInfo := new(proto.TransactionInfo) - if beginErr := q.server.Begin(ctx, request.Target, &proto.Session{ + if err := q.server.Begin(ctx, request.Target, &proto.Session{ SessionId: request.SessionId, - }, txInfo); beginErr != nil { - return &pb.BeginResponse{ - Error: tabletserver.TabletErrorToRPCError(beginErr), - }, nil + }, txInfo); err != nil { + return nil, err } return &pb.BeginResponse{ @@ -144,52 +128,50 @@ func (q *query) Begin(ctx context.Context, request *pb.BeginRequest) (response * func (q *query) Commit(ctx context.Context, request *pb.CommitRequest) (response *pb.CommitResponse, err error) { defer q.server.HandlePanic(&err) ctx = callerid.NewContext(callinfo.GRPCCallInfo(ctx), - request.GetEffectiveCallerId(), - request.GetImmediateCallerId(), + request.EffectiveCallerId, + request.ImmediateCallerId, ) - commitErr := q.server.Commit(ctx, request.Target, &proto.Session{ + if err := q.server.Commit(ctx, request.Target, &proto.Session{ SessionId: request.SessionId, TransactionId: request.TransactionId, - }) - return &pb.CommitResponse{ - Error: tabletserver.TabletErrorToRPCError(commitErr), - }, nil + }); err != nil { + return nil, err + } + return &pb.CommitResponse{}, nil } // Rollback is part of the queryservice.QueryServer interface func (q *query) Rollback(ctx context.Context, request *pb.RollbackRequest) (response *pb.RollbackResponse, err error) { defer q.server.HandlePanic(&err) ctx = callerid.NewContext(callinfo.GRPCCallInfo(ctx), - request.GetEffectiveCallerId(), - request.GetImmediateCallerId(), + request.EffectiveCallerId, + request.ImmediateCallerId, ) - rollbackErr := q.server.Rollback(ctx, request.Target, &proto.Session{ + if err := q.server.Rollback(ctx, request.Target, &proto.Session{ SessionId: request.SessionId, TransactionId: request.TransactionId, - }) + }); err != nil { + return nil, err + } - return &pb.RollbackResponse{ - Error: tabletserver.TabletErrorToRPCError(rollbackErr), - }, nil + return &pb.RollbackResponse{}, nil } // SplitQuery is part of the queryservice.QueryServer interface func (q *query) SplitQuery(ctx context.Context, request *pb.SplitQueryRequest) (response *pb.SplitQueryResponse, err error) { defer q.server.HandlePanic(&err) ctx = callerid.NewContext(callinfo.GRPCCallInfo(ctx), - request.GetEffectiveCallerId(), - request.GetImmediateCallerId(), + request.EffectiveCallerId, + request.ImmediateCallerId, ) reply := &proto.SplitQueryResult{} - if sqErr := q.server.SplitQuery(ctx, request.Target, &proto.SplitQueryRequest{ + if err := q.server.SplitQuery(ctx, request.Target, &proto.SplitQueryRequest{ Query: *proto.Proto3ToBoundQuery(request.Query), SplitColumn: request.SplitColumn, SplitCount: int(request.SplitCount), SessionID: request.SessionId, - }, reply); sqErr != nil { - return &pb.SplitQueryResponse{ - Error: tabletserver.TabletErrorToRPCError(sqErr), - }, nil + }, reply); err != nil { + return nil, err } return &pb.SplitQueryResponse{ Queries: proto.QuerySplitsToProto3(reply.Queries), diff --git a/go/vt/tabletserver/grpctabletconn/conn.go b/go/vt/tabletserver/grpctabletconn/conn.go index b6f2fb1347..6cb1e07ef4 100644 --- a/go/vt/tabletserver/grpctabletconn/conn.go +++ b/go/vt/tabletserver/grpctabletconn/conn.go @@ -12,16 +12,15 @@ import ( mproto "github.com/youtube/vitess/go/mysql/proto" "github.com/youtube/vitess/go/netutil" + "github.com/youtube/vitess/go/vt/callerid" tproto "github.com/youtube/vitess/go/vt/tabletserver/proto" "github.com/youtube/vitess/go/vt/tabletserver/tabletconn" - "github.com/youtube/vitess/go/vt/vterrors" "golang.org/x/net/context" "google.golang.org/grpc" pb "github.com/youtube/vitess/go/vt/proto/query" pbs "github.com/youtube/vitess/go/vt/proto/queryservice" pbt "github.com/youtube/vitess/go/vt/proto/topodata" - pbv "github.com/youtube/vitess/go/vt/proto/vtrpc" ) const protocolName = "grpc" @@ -68,10 +67,6 @@ func DialTablet(ctx context.Context, endPoint *pbt.EndPoint, keyspace, shard str cc.Close() return nil, err } - if gsir.Error != nil { - cc.Close() - return nil, tabletErrorFromRPCError(gsir.Error) - } result.sessionID = gsir.SessionId } else { // we use target @@ -94,17 +89,17 @@ func (conn *gRPCQueryClient) Execute(ctx context.Context, query string, bindVars } req := &pb.ExecuteRequest{ - Query: tproto.BoundQueryToProto3(query, bindVars), - TransactionId: transactionID, - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerId: callerid.EffectiveCallerIDFromContext(ctx), + ImmediateCallerId: callerid.ImmediateCallerIDFromContext(ctx), + Query: tproto.BoundQueryToProto3(query, bindVars), + TransactionId: transactionID, + SessionId: conn.sessionID, } er, err := conn.c.Execute(ctx, req) if err != nil { return nil, tabletErrorFromGRPC(err) } - if er.Error != nil { - return nil, tabletErrorFromRPCError(er.Error) - } return mproto.Proto3ToQueryResult(er.Result), nil } @@ -122,10 +117,13 @@ func (conn *gRPCQueryClient) ExecuteBatch(ctx context.Context, queries []tproto. } req := &pb.ExecuteBatchRequest{ - Queries: make([]*pb.BoundQuery, len(queries)), - AsTransaction: asTransaction, - TransactionId: transactionID, - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerId: callerid.EffectiveCallerIDFromContext(ctx), + ImmediateCallerId: callerid.ImmediateCallerIDFromContext(ctx), + Queries: make([]*pb.BoundQuery, len(queries)), + AsTransaction: asTransaction, + TransactionId: transactionID, + SessionId: conn.sessionID, } for i, q := range queries { req.Queries[i] = tproto.BoundQueryToProto3(q.Sql, q.BindVariables) @@ -134,9 +132,6 @@ func (conn *gRPCQueryClient) ExecuteBatch(ctx context.Context, queries []tproto. if err != nil { return nil, tabletErrorFromGRPC(err) } - if ebr.Error != nil { - return nil, tabletErrorFromRPCError(ebr.Error) - } return tproto.Proto3ToQueryResultList(ebr.Results), nil } @@ -154,8 +149,11 @@ func (conn *gRPCQueryClient) StreamExecute(ctx context.Context, query string, bi } req := &pb.StreamExecuteRequest{ - Query: tproto.BoundQueryToProto3(query, bindVars), - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerId: callerid.EffectiveCallerIDFromContext(ctx), + ImmediateCallerId: callerid.ImmediateCallerIDFromContext(ctx), + Query: tproto.BoundQueryToProto3(query, bindVars), + SessionId: conn.sessionID, } stream, err := conn.c.StreamExecute(ctx, req) if err != nil { @@ -173,11 +171,6 @@ func (conn *gRPCQueryClient) StreamExecute(ctx context.Context, query string, bi close(sr) return } - if ser.Error != nil { - finalError = tabletErrorFromRPCError(ser.Error) - close(sr) - return - } sr <- mproto.Proto3ToQueryResult(ser.Result) } }() @@ -200,15 +193,15 @@ func (conn *gRPCQueryClient) Begin(ctx context.Context) (transactionID int64, er } req := &pb.BeginRequest{ - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerId: callerid.EffectiveCallerIDFromContext(ctx), + ImmediateCallerId: callerid.ImmediateCallerIDFromContext(ctx), + SessionId: conn.sessionID, } br, err := conn.c.Begin(ctx, req) if err != nil { return 0, tabletErrorFromGRPC(err) } - if br.Error != nil { - return 0, tabletErrorFromRPCError(br.Error) - } return br.TransactionId, nil } @@ -226,16 +219,16 @@ func (conn *gRPCQueryClient) Commit(ctx context.Context, transactionID int64) er } req := &pb.CommitRequest{ - TransactionId: transactionID, - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerId: callerid.EffectiveCallerIDFromContext(ctx), + ImmediateCallerId: callerid.ImmediateCallerIDFromContext(ctx), + TransactionId: transactionID, + SessionId: conn.sessionID, } - cr, err := conn.c.Commit(ctx, req) + _, err := conn.c.Commit(ctx, req) if err != nil { return tabletErrorFromGRPC(err) } - if cr.Error != nil { - return tabletErrorFromRPCError(cr.Error) - } return nil } @@ -253,16 +246,16 @@ func (conn *gRPCQueryClient) Rollback(ctx context.Context, transactionID int64) } req := &pb.RollbackRequest{ - TransactionId: transactionID, - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerId: callerid.EffectiveCallerIDFromContext(ctx), + ImmediateCallerId: callerid.ImmediateCallerIDFromContext(ctx), + TransactionId: transactionID, + SessionId: conn.sessionID, } - rr, err := conn.c.Rollback(ctx, req) + _, err := conn.c.Rollback(ctx, req) if err != nil { return tabletErrorFromGRPC(err) } - if rr.Error != nil { - return tabletErrorFromRPCError(rr.Error) - } return nil } @@ -281,18 +274,18 @@ func (conn *gRPCQueryClient) SplitQuery(ctx context.Context, query tproto.BoundQ } req := &pb.SplitQueryRequest{ - Query: tproto.BoundQueryToProto3(query.Sql, query.BindVariables), - SplitColumn: splitColumn, - SplitCount: int64(splitCount), - SessionId: conn.sessionID, + Target: conn.target, + EffectiveCallerId: callerid.EffectiveCallerIDFromContext(ctx), + ImmediateCallerId: callerid.ImmediateCallerIDFromContext(ctx), + Query: tproto.BoundQueryToProto3(query.Sql, query.BindVariables), + SplitColumn: splitColumn, + SplitCount: int64(splitCount), + SessionId: conn.sessionID, } sqr, err := conn.c.SplitQuery(ctx, req) if err != nil { return nil, tabletErrorFromGRPC(err) } - if sqr.Error != nil { - return nil, tabletErrorFromRPCError(sqr.Error) - } return tproto.Proto3ToQuerySplits(sqr.Queries), nil } @@ -371,19 +364,3 @@ func (conn *gRPCQueryClient) EndPoint() *pbt.EndPoint { func tabletErrorFromGRPC(err error) error { return tabletconn.OperationalError(fmt.Sprintf("vttablet: %v", err)) } - -// tabletErrorFromRPCError reconstructs a tablet error from the -// RPCError, using the RPCError code. -func tabletErrorFromRPCError(rpcErr *pbv.RPCError) error { - ve := vterrors.FromVtRPCError(rpcErr) - - // see if the range is in the tablet error range - if ve.Code >= int64(pbv.ErrorCode_TabletError) && ve.Code <= int64(pbv.ErrorCode_UnknownTabletError) { - return &tabletconn.ServerError{ - Code: int(ve.Code - int64(pbv.ErrorCode_TabletError)), - Err: fmt.Sprintf("vttablet: %v", ve.Error()), - } - } - - return tabletconn.OperationalError(fmt.Sprintf("vttablet: %v", ve.Message)) -} diff --git a/go/vt/tabletserver/tabletconntest/tabletconntest.go b/go/vt/tabletserver/tabletconntest/tabletconntest.go index cb9288e7f2..f6225134aa 100644 --- a/go/vt/tabletserver/tabletconntest/tabletconntest.go +++ b/go/vt/tabletserver/tabletconntest/tabletconntest.go @@ -15,21 +15,25 @@ import ( mproto "github.com/youtube/vitess/go/mysql/proto" "github.com/youtube/vitess/go/sqltypes" - "github.com/youtube/vitess/go/vt/tabletserver" + "github.com/youtube/vitess/go/vt/callerid" "github.com/youtube/vitess/go/vt/tabletserver/proto" "github.com/youtube/vitess/go/vt/tabletserver/tabletconn" "golang.org/x/net/context" pb "github.com/youtube/vitess/go/vt/proto/query" pbt "github.com/youtube/vitess/go/vt/proto/topodata" + pbv "github.com/youtube/vitess/go/vt/proto/vtrpc" ) // FakeQueryService has the server side of this fake type FakeQueryService struct { t *testing.T - hasError bool panics bool streamExecutePanicsEarly bool + panicWait chan struct{} + + // if set, we will also check Target, ImmediateCallerId and EffectiveCallerId + checkExtraFields bool } // HandlePanic is part of the queryservice.QueryService interface @@ -39,48 +43,56 @@ func (f *FakeQueryService) HandlePanic(err *error) { } } -// TestKeyspace is the Keyspace we use for this test -const TestKeyspace = "test_keyspace" +// testTarget is the target we use for this test +var testTarget = &pb.Target{ + Keyspace: "test_keyspace", + Shard: "test_shard", + TabletType: pbt.TabletType_REPLICA, +} -// TestShard is the Shard we use for this test -const TestShard = "test_shard" +var testCallerID = &pbv.CallerID{ + Principal: "test_principal", + Component: "test_component", + Subcomponent: "test_subcomponent", +} -// TestTabletType is the TabletType we use for this test -const TestTabletType = pbt.TabletType_UNKNOWN +var testVTGateCallerID = &pb.VTGateCallerID{ + Username: "test_username", +} const testAsTransaction bool = true const testSessionID int64 = 5678 -var testTabletError = tabletserver.NewTabletError(tabletserver.ErrFail, "generic error") - -const expectedErrMatch string = "error: generic error" - -// Verifies the returned error has the properties that we expect. -func verifyError(t *testing.T, err error, method string) { - if err == nil { - t.Errorf("%s was expecting an error, didn't get one", method) - return +func (f *FakeQueryService) checkTargetCallerID(ctx context.Context, name string, target *pb.Target) { + if !reflect.DeepEqual(target, testTarget) { + f.t.Errorf("invalid Target for %v: got %#v expected %#v", name, target, testTarget) } - if se, ok := err.(*tabletconn.ServerError); ok { - if se.Code != tabletconn.ERR_NORMAL { - t.Errorf("Unexpected error code from %s: got %v, wanted %v", method, se.Code, tabletconn.ERR_NORMAL) - } + ef := callerid.EffectiveCallerIDFromContext(ctx) + if ef == nil { + f.t.Errorf("no effective caller id for %v", name) } else { - t.Errorf("Unexpected error type from %s: got %v, wanted tabletconn.ServerError", method, reflect.TypeOf(err)) + if !reflect.DeepEqual(ef, testCallerID) { + f.t.Errorf("invalid effective caller id for %v: got %v expected %v", name, ef, testCallerID) + } } - if !strings.Contains(err.Error(), expectedErrMatch) { - t.Errorf("Unexpected error from %s: got %v, wanted err containing %v", method, err, expectedErrMatch) + im := callerid.ImmediateCallerIDFromContext(ctx) + if im == nil { + f.t.Errorf("no immediate caller id for %v", name) + } else { + if !reflect.DeepEqual(im, testVTGateCallerID) { + f.t.Errorf("invalid immediate caller id for %v: got %v expected %v", name, im, testVTGateCallerID) + } } } // GetSessionId is part of the queryservice.QueryService interface func (f *FakeQueryService) GetSessionId(sessionParams *proto.SessionParams, sessionInfo *proto.SessionInfo) error { - if sessionParams.Keyspace != TestKeyspace { - f.t.Errorf("invalid keyspace: got %v expected %v", sessionParams.Keyspace, TestKeyspace) + if sessionParams.Keyspace != testTarget.Keyspace { + f.t.Errorf("invalid keyspace: got %v expected %v", sessionParams.Keyspace, testTarget.Keyspace) } - if sessionParams.Shard != TestShard { - f.t.Errorf("invalid shard: got %v expected %v", sessionParams.Shard, TestShard) + if sessionParams.Shard != testTarget.Shard { + f.t.Errorf("invalid shard: got %v expected %v", sessionParams.Shard, testTarget.Shard) } sessionInfo.SessionId = testSessionID return nil @@ -88,14 +100,15 @@ func (f *FakeQueryService) GetSessionId(sessionParams *proto.SessionParams, sess // Begin is part of the queryservice.QueryService interface func (f *FakeQueryService) Begin(ctx context.Context, target *pb.Target, session *proto.Session, txInfo *proto.TransactionInfo) error { - if f.hasError { - return testTabletError - } if f.panics { panic(fmt.Errorf("test-triggered panic")) } - if session.SessionId != testSessionID { - f.t.Errorf("Begin: invalid SessionId: got %v expected %v", session.SessionId, testSessionID) + if f.checkExtraFields { + f.checkTargetCallerID(ctx, "Begin", target) + } else { + if session.SessionId != testSessionID { + f.t.Errorf("Begin: invalid SessionId: got %v expected %v", session.SessionId, testSessionID) + } } if session.TransactionId != 0 { f.t.Errorf("Begin: invalid TransactionId: got %v expected 0", session.TransactionId) @@ -118,13 +131,6 @@ func testBegin(t *testing.T, conn tabletconn.TabletConn) { } } -func testBeginError(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testBeginError") - ctx := context.Background() - _, err := conn.Begin(ctx) - verifyError(t, err, "Begin") -} - func testBeginPanics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testBeginPanics") ctx := context.Background() @@ -136,6 +142,7 @@ func testBeginPanics(t *testing.T, conn tabletconn.TabletConn) { func testBegin2(t *testing.T, conn tabletconn.TabletConn) { t.Log("testBegin2") ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) transactionID, err := conn.Begin2(ctx) if err != nil { t.Fatalf("Begin2 failed: %v", err) @@ -145,13 +152,6 @@ func testBegin2(t *testing.T, conn tabletconn.TabletConn) { } } -func testBegin2Error(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testBegin2Error") - ctx := context.Background() - _, err := conn.Begin2(ctx) - verifyError(t, err, "Begin2") -} - func testBegin2Panics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testBegin2Panics") ctx := context.Background() @@ -162,14 +162,15 @@ func testBegin2Panics(t *testing.T, conn tabletconn.TabletConn) { // Commit is part of the queryservice.QueryService interface func (f *FakeQueryService) Commit(ctx context.Context, target *pb.Target, session *proto.Session) error { - if f.hasError { - return testTabletError - } if f.panics { panic(fmt.Errorf("test-triggered panic")) } - if session.SessionId != testSessionID { - f.t.Errorf("Commit: invalid SessionId: got %v expected %v", session.SessionId, testSessionID) + if f.checkExtraFields { + f.checkTargetCallerID(ctx, "Commit", target) + } else { + if session.SessionId != testSessionID { + f.t.Errorf("Commit: invalid SessionId: got %v expected %v", session.SessionId, testSessionID) + } } if session.TransactionId != commitTransactionID { f.t.Errorf("Commit: invalid TransactionId: got %v expected %v", session.TransactionId, commitTransactionID) @@ -188,13 +189,6 @@ func testCommit(t *testing.T, conn tabletconn.TabletConn) { } } -func testCommitError(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testCommitError") - ctx := context.Background() - err := conn.Commit(ctx, commitTransactionID) - verifyError(t, err, "Commit") -} - func testCommitPanics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testCommitPanics") ctx := context.Background() @@ -206,19 +200,13 @@ func testCommitPanics(t *testing.T, conn tabletconn.TabletConn) { func testCommit2(t *testing.T, conn tabletconn.TabletConn) { t.Log("testCommit2") ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) err := conn.Commit2(ctx, commitTransactionID) if err != nil { t.Fatalf("Commit2 failed: %v", err) } } -func testCommit2Error(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testCommit2Error") - ctx := context.Background() - err := conn.Commit2(ctx, commitTransactionID) - verifyError(t, err, "Commit2") -} - func testCommit2Panics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testCommit2Panics") ctx := context.Background() @@ -229,14 +217,15 @@ func testCommit2Panics(t *testing.T, conn tabletconn.TabletConn) { // Rollback is part of the queryservice.QueryService interface func (f *FakeQueryService) Rollback(ctx context.Context, target *pb.Target, session *proto.Session) error { - if f.hasError { - return testTabletError - } if f.panics { panic(fmt.Errorf("test-triggered panic")) } - if session.SessionId != testSessionID { - f.t.Errorf("Rollback: invalid SessionId: got %v expected %v", session.SessionId, testSessionID) + if f.checkExtraFields { + f.checkTargetCallerID(ctx, "Rollback", target) + } else { + if session.SessionId != testSessionID { + f.t.Errorf("Rollback: invalid SessionId: got %v expected %v", session.SessionId, testSessionID) + } } if session.TransactionId != rollbackTransactionID { f.t.Errorf("Rollback: invalid TransactionId: got %v expected %v", session.TransactionId, rollbackTransactionID) @@ -255,13 +244,6 @@ func testRollback(t *testing.T, conn tabletconn.TabletConn) { } } -func testRollbackError(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testRollbackError") - ctx := context.Background() - err := conn.Rollback(ctx, commitTransactionID) - verifyError(t, err, "Rollback") -} - func testRollbackPanics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testRollbackPanics") ctx := context.Background() @@ -273,19 +255,13 @@ func testRollbackPanics(t *testing.T, conn tabletconn.TabletConn) { func testRollback2(t *testing.T, conn tabletconn.TabletConn) { t.Log("testRollback2") ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) err := conn.Rollback2(ctx, rollbackTransactionID) if err != nil { t.Fatalf("Rollback2 failed: %v", err) } } -func testRollback2Error(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testRollback2Error") - ctx := context.Background() - err := conn.Rollback2(ctx, commitTransactionID) - verifyError(t, err, "Rollback2") -} - func testRollback2Panics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testRollback2Panics") ctx := context.Background() @@ -296,9 +272,6 @@ func testRollback2Panics(t *testing.T, conn tabletconn.TabletConn) { // Execute is part of the queryservice.QueryService interface func (f *FakeQueryService) Execute(ctx context.Context, target *pb.Target, query *proto.Query, reply *mproto.QueryResult) error { - if f.hasError { - return testTabletError - } if f.panics { panic(fmt.Errorf("test-triggered panic")) } @@ -308,8 +281,12 @@ func (f *FakeQueryService) Execute(ctx context.Context, target *pb.Target, query if !reflect.DeepEqual(query.BindVariables, executeBindVars) { f.t.Errorf("invalid Execute.Query.BindVariables: got %v expected %v", query.BindVariables, executeBindVars) } - if query.SessionId != testSessionID { - f.t.Errorf("invalid Execute.Query.SessionId: got %v expected %v", query.SessionId, testSessionID) + if f.checkExtraFields { + f.checkTargetCallerID(ctx, "Execute", target) + } else { + if query.SessionId != testSessionID { + f.t.Errorf("invalid Execute.Query.SessionId: got %v expected %v", query.SessionId, testSessionID) + } } if query.TransactionId != executeTransactionID { f.t.Errorf("invalid Execute.Query.TransactionId: got %v expected %v", query.TransactionId, executeTransactionID) @@ -366,6 +343,7 @@ func testExecute(t *testing.T, conn tabletconn.TabletConn) { func testExecute2(t *testing.T, conn tabletconn.TabletConn) { t.Log("testExecute2") ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) qr, err := conn.Execute2(ctx, executeQuery, executeBindVars, executeTransactionID) if err != nil { t.Fatalf("Execute failed: %v", err) @@ -375,20 +353,6 @@ func testExecute2(t *testing.T, conn tabletconn.TabletConn) { } } -func testExecuteError(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testExecuteError") - ctx := context.Background() - _, err := conn.Execute(ctx, executeQuery, executeBindVars, executeTransactionID) - verifyError(t, err, "Execute") -} - -func testExecute2Error(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testExecute2Error") - ctx := context.Background() - _, err := conn.Execute2(ctx, executeQuery, executeBindVars, executeTransactionID) - verifyError(t, err, "Execute") -} - func testExecutePanics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testExecutePanics") ctx := context.Background() @@ -405,9 +369,6 @@ func testExecute2Panics(t *testing.T, conn tabletconn.TabletConn) { } } -var panicWait chan struct{} -var errorWait chan struct{} - // StreamExecute is part of the queryservice.QueryService interface func (f *FakeQueryService) StreamExecute(ctx context.Context, target *pb.Target, query *proto.Query, sendReply func(*mproto.QueryResult) error) error { if f.panics && f.streamExecutePanicsEarly { @@ -419,23 +380,22 @@ func (f *FakeQueryService) StreamExecute(ctx context.Context, target *pb.Target, if !reflect.DeepEqual(query.BindVariables, streamExecuteBindVars) { f.t.Errorf("invalid StreamExecute.Query.BindVariables: got %v expected %v", query.BindVariables, streamExecuteBindVars) } - if query.SessionId != testSessionID { - f.t.Errorf("invalid StreamExecute.Query.SessionId: got %v expected %v", query.SessionId, testSessionID) + if f.checkExtraFields { + f.checkTargetCallerID(ctx, "StreamExecute", target) + } else { + if query.SessionId != testSessionID { + f.t.Errorf("invalid StreamExecute.Query.SessionId: got %v expected %v", query.SessionId, testSessionID) + } } if err := sendReply(&streamExecuteQueryResult1); err != nil { f.t.Errorf("sendReply1 failed: %v", err) } if f.panics && !f.streamExecutePanicsEarly { // wait until the client gets the response, then panics - <-panicWait + <-f.panicWait + f.panicWait = make(chan struct{}) // for next test panic(fmt.Errorf("test-triggered panic late")) } - if f.hasError { - // wait until the client has the response, since all streaming implementation may not - // send previous messages if an error has been triggered. - <-errorWait - return testTabletError - } if err := sendReply(&streamExecuteQueryResult2); err != nil { f.t.Errorf("sendReply2 failed: %v", err) } @@ -512,36 +472,6 @@ func testStreamExecute(t *testing.T, conn tabletconn.TabletConn) { } } -func testStreamExecuteError(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testStreamExecuteError") - ctx := context.Background() - stream, errFunc, err := conn.StreamExecute(ctx, streamExecuteQuery, streamExecuteBindVars, streamExecuteTransactionID) - if err != nil { - t.Fatalf("StreamExecute failed: %v", err) - } - qr, ok := <-stream - if !ok { - t.Fatalf("StreamExecute failed: cannot read result1") - } - if len(qr.Rows) == 0 { - qr.Rows = nil - } - if !reflect.DeepEqual(*qr, streamExecuteQueryResult1) { - t.Errorf("Unexpected result1 from StreamExecute: got %v wanted %v", qr, streamExecuteQueryResult1) - } - // signal to the server that the first result has been received - close(errorWait) - // After 1 result, we expect to get an error (no more results). - qr, ok = <-stream - if ok { - t.Fatalf("StreamExecute channel wasn't closed") - } - err = errFunc() - verifyError(t, err, "StreamExecute") - // reset state for the test - errorWait = make(chan struct{}) -} - func testStreamExecutePanics(t *testing.T, conn tabletconn.TabletConn, fake *FakeQueryService) { t.Log("testStreamExecutePanics") // early panic is before sending the Fields, that is returned @@ -581,20 +511,19 @@ func testStreamExecutePanics(t *testing.T, conn tabletconn.TabletConn, fake *Fak if !reflect.DeepEqual(*qr, streamExecuteQueryResult1) { t.Errorf("Unexpected result1 from StreamExecute: got %v wanted %v", qr, streamExecuteQueryResult1) } - close(panicWait) + close(fake.panicWait) if _, ok := <-stream; ok { t.Fatalf("StreamExecute returned more results") } if err := errFunc(); err == nil || !strings.Contains(err.Error(), "caught test panic") { t.Fatalf("unexpected panic error: %v", err) } - // Make a new panicWait channel, to reset the state to the beginning of the test - panicWait = make(chan struct{}) } func testStreamExecute2(t *testing.T, conn tabletconn.TabletConn) { t.Log("testStreamExecute2") ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) stream, errFunc, err := conn.StreamExecute2(ctx, streamExecuteQuery, streamExecuteBindVars, streamExecuteTransactionID) if err != nil { t.Fatalf("StreamExecute2 failed: %v", err) @@ -628,42 +557,13 @@ func testStreamExecute2(t *testing.T, conn tabletconn.TabletConn) { } } -func testStreamExecute2Error(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testStreamExecute2Error") - ctx := context.Background() - stream, errFunc, err := conn.StreamExecute2(ctx, streamExecuteQuery, streamExecuteBindVars, streamExecuteTransactionID) - if err != nil { - t.Fatalf("StreamExecute2 failed: %v", err) - } - qr, ok := <-stream - if !ok { - t.Fatalf("StreamExecute2 failed: cannot read result1") - } - if len(qr.Rows) == 0 { - qr.Rows = nil - } - if !reflect.DeepEqual(*qr, streamExecuteQueryResult1) { - t.Errorf("Unexpected result1 from StreamExecute2: got %v wanted %v", qr, streamExecuteQueryResult1) - } - // signal to the server that the first result has been received - close(errorWait) - // After 1 result, we expect to get an error (no more results). - qr, ok = <-stream - if ok { - t.Fatalf("StreamExecute2 channel wasn't closed") - } - err = errFunc() - verifyError(t, err, "StreamExecute2") - // reset state for the test - errorWait = make(chan struct{}) -} - func testStreamExecute2Panics(t *testing.T, conn tabletconn.TabletConn, fake *FakeQueryService) { t.Log("testStreamExecute2Panics") // early panic is before sending the Fields, that is returned // by the StreamExecute2 call itself, or as the first error // by ErrFunc ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) fake.streamExecutePanicsEarly = true stream, errFunc, err := conn.StreamExecute2(ctx, streamExecuteQuery, streamExecuteBindVars, streamExecuteTransactionID) if err != nil { @@ -697,30 +597,29 @@ func testStreamExecute2Panics(t *testing.T, conn tabletconn.TabletConn, fake *Fa if !reflect.DeepEqual(*qr, streamExecuteQueryResult1) { t.Errorf("Unexpected result1 from StreamExecute2: got %v wanted %v", qr, streamExecuteQueryResult1) } - close(panicWait) + close(fake.panicWait) if _, ok := <-stream; ok { t.Fatalf("StreamExecute2 returned more results") } if err := errFunc(); err == nil || !strings.Contains(err.Error(), "caught test panic") { t.Fatalf("unexpected panic error: %v", err) } - // Make a new panicWait channel, to reset the state to the beginning of the test - panicWait = make(chan struct{}) } // ExecuteBatch is part of the queryservice.QueryService interface func (f *FakeQueryService) ExecuteBatch(ctx context.Context, target *pb.Target, queryList *proto.QueryList, reply *proto.QueryResultList) error { - if f.hasError { - return testTabletError - } if f.panics { panic(fmt.Errorf("test-triggered panic")) } if !reflect.DeepEqual(queryList.Queries, executeBatchQueries) { f.t.Errorf("invalid ExecuteBatch.QueryList.Queries: got %v expected %v", queryList.Queries, executeBatchQueries) } - if queryList.SessionId != testSessionID { - f.t.Errorf("invalid ExecuteBatch.QueryList.SessionId: got %v expected %v", queryList.SessionId, testSessionID) + if f.checkExtraFields { + f.checkTargetCallerID(ctx, "ExecuteBatch", target) + } else { + if queryList.SessionId != testSessionID { + f.t.Errorf("invalid ExecuteBatch.QueryList.SessionId: got %v expected %v", queryList.SessionId, testSessionID) + } } if queryList.AsTransaction != testAsTransaction { f.t.Errorf("invalid ExecuteBatch.QueryList.AsTransaction: got %v expected %v", queryList.AsTransaction, testAsTransaction) @@ -800,13 +699,6 @@ func testExecuteBatch(t *testing.T, conn tabletconn.TabletConn) { } } -func testExecuteBatchError(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testBatchExecuteError") - ctx := context.Background() - _, err := conn.ExecuteBatch(ctx, executeBatchQueries, true, executeBatchTransactionID) - verifyError(t, err, "ExecuteBatch") -} - func testExecuteBatchPanics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testExecuteBatchPanics") ctx := context.Background() @@ -818,6 +710,7 @@ func testExecuteBatchPanics(t *testing.T, conn tabletconn.TabletConn) { func testExecuteBatch2(t *testing.T, conn tabletconn.TabletConn) { t.Log("testExecuteBatch2") ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) qrl, err := conn.ExecuteBatch2(ctx, executeBatchQueries, true, executeBatchTransactionID) if err != nil { t.Fatalf("ExecuteBatch failed: %v", err) @@ -827,13 +720,6 @@ func testExecuteBatch2(t *testing.T, conn tabletconn.TabletConn) { } } -func testExecuteBatch2Error(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testBatchExecute2Error") - ctx := context.Background() - _, err := conn.ExecuteBatch2(ctx, executeBatchQueries, true, executeBatchTransactionID) - verifyError(t, err, "ExecuteBatch") -} - func testExecuteBatch2Panics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testExecuteBatch2Panics") ctx := context.Background() @@ -844,12 +730,12 @@ func testExecuteBatch2Panics(t *testing.T, conn tabletconn.TabletConn) { // SplitQuery is part of the queryservice.QueryService interface func (f *FakeQueryService) SplitQuery(ctx context.Context, target *pb.Target, req *proto.SplitQueryRequest, reply *proto.SplitQueryResult) error { - if f.hasError { - return testTabletError - } if f.panics { panic(fmt.Errorf("test-triggered panic")) } + if f.checkExtraFields { + f.checkTargetCallerID(ctx, "SplitQuery", target) + } if !reflect.DeepEqual(req.Query, splitQueryBoundQuery) { f.t.Errorf("invalid SplitQuery.SplitQueryRequest.Query: got %v expected %v", req.Query, splitQueryBoundQuery) } @@ -889,6 +775,7 @@ var splitQueryQuerySplitList = []proto.QuerySplit{ func testSplitQuery(t *testing.T, conn tabletconn.TabletConn) { t.Log("testSplitQuery") ctx := context.Background() + ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) qsl, err := conn.SplitQuery(ctx, splitQueryBoundQuery, splitQuerySplitColumn, splitQuerySplitCount) if err != nil { t.Fatalf("SplitQuery failed: %v", err) @@ -898,13 +785,6 @@ func testSplitQuery(t *testing.T, conn tabletconn.TabletConn) { } } -func testSplitQueryError(t *testing.T, conn tabletconn.TabletConn) { - t.Log("testSplitQueryError") - ctx := context.Background() - _, err := conn.SplitQuery(ctx, splitQueryBoundQuery, splitQuerySplitColumn, splitQuerySplitCount) - verifyError(t, err, "SplitQuery") -} - func testSplitQueryPanics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testSplitQueryPanics") ctx := context.Background() @@ -1005,14 +885,11 @@ func testStreamHealthPanics(t *testing.T, conn tabletconn.TabletConn) { // CreateFakeServer returns the fake server for the tests func CreateFakeServer(t *testing.T) *FakeQueryService { - // Make the synchronization channels on init, so there's no state shared between servers - panicWait = make(chan struct{}) - errorWait = make(chan struct{}) - return &FakeQueryService{ t: t, panics: false, streamExecutePanicsEarly: false, + panicWait: make(chan struct{}), } } @@ -1021,62 +898,64 @@ func TestSuite(t *testing.T, protocol string, endPoint *pbt.EndPoint, fake *Fake // make sure we use the right client *tabletconn.TabletProtocol = protocol - // create a connection + // create a connection, using sessionId ctx := context.Background() - conn, err := tabletconn.GetDialer()(ctx, endPoint, TestKeyspace, TestShard, TestTabletType, 30*time.Second) + conn, err := tabletconn.GetDialer()(ctx, endPoint, testTarget.Keyspace, testTarget.Shard, pbt.TabletType_UNKNOWN, 30*time.Second) if err != nil { t.Fatalf("dial failed: %v", err) } - defer conn.Close() // run the normal tests testBegin(t, conn) - testBegin2(t, conn) testCommit(t, conn) - testCommit2(t, conn) testRollback(t, conn) - testRollback2(t, conn) testExecute(t, conn) - testExecute2(t, conn) testStreamExecute(t, conn) - testStreamExecute2(t, conn) testExecuteBatch(t, conn) - testExecuteBatch2(t, conn) testSplitQuery(t, conn) testStreamHealth(t, conn) - // fake should return an error, make sure errors are handled properly - fake.hasError = true - testBeginError(t, conn) - testBegin2Error(t, conn) - testCommitError(t, conn) - testCommit2Error(t, conn) - testRollbackError(t, conn) - testRollback2Error(t, conn) - testExecuteError(t, conn) - testExecute2Error(t, conn) - testStreamExecuteError(t, conn) - testStreamExecute2Error(t, conn) - testExecuteBatchError(t, conn) - testExecuteBatch2Error(t, conn) - testSplitQueryError(t, conn) - fake.hasError = false + // create a new connection that expects the extra fields + conn.Close() + conn, err = tabletconn.GetDialer()(ctx, endPoint, testTarget.Keyspace, testTarget.Shard, pbt.TabletType_REPLICA, 30*time.Second) + if err != nil { + t.Fatalf("dial failed: %v", err) + } - // force panics, make sure they're caught + // run the tests that expect extra fields + fake.checkExtraFields = true + testBegin2(t, conn) + testCommit2(t, conn) + testRollback2(t, conn) + testExecute2(t, conn) + testStreamExecute2(t, conn) + testExecuteBatch2(t, conn) + testSplitQuery(t, conn) + + // force panics, make sure they're caught (with extra fields) fake.panics = true - testBeginPanics(t, conn) testBegin2Panics(t, conn) - testCommitPanics(t, conn) testCommit2Panics(t, conn) - testRollbackPanics(t, conn) testRollback2Panics(t, conn) - testExecutePanics(t, conn) testExecute2Panics(t, conn) - testStreamExecutePanics(t, conn, fake) testStreamExecute2Panics(t, conn, fake) - testExecuteBatchPanics(t, conn) testExecuteBatch2Panics(t, conn) testSplitQueryPanics(t, conn) testStreamHealthPanics(t, conn) + + // force panic without extra fields + conn.Close() + conn, err = tabletconn.GetDialer()(ctx, endPoint, testTarget.Keyspace, testTarget.Shard, pbt.TabletType_UNKNOWN, 30*time.Second) + if err != nil { + t.Fatalf("dial failed: %v", err) + } + fake.checkExtraFields = false + testBeginPanics(t, conn) + testCommitPanics(t, conn) + testRollbackPanics(t, conn) + testExecutePanics(t, conn) + testExecuteBatchPanics(t, conn) + testStreamExecutePanics(t, conn, fake) fake.panics = false + conn.Close() } diff --git a/proto/query.proto b/proto/query.proto index 93d04c3c42..3a6a89f614 100644 --- a/proto/query.proto +++ b/proto/query.proto @@ -159,8 +159,7 @@ message GetSessionIdRequest { // GetSessionIdResponse is the returned value from GetSessionId message GetSessionIdResponse { - vtrpc.RPCError error = 1; - int64 session_id = 2; + int64 session_id = 1; } // ExecuteRequest is the payload to Execute @@ -175,8 +174,7 @@ message ExecuteRequest { // ExecuteResponse is the returned value from Execute message ExecuteResponse { - vtrpc.RPCError error = 1; - QueryResult result = 2; + QueryResult result = 1; } // ExecuteBatchRequest is the payload to ExecuteBatch @@ -192,8 +190,7 @@ message ExecuteBatchRequest { // ExecuteBatchResponse is the returned value from ExecuteBatch message ExecuteBatchResponse { - vtrpc.RPCError error = 1; - repeated QueryResult results = 2; + repeated QueryResult results = 1; } // StreamExecuteRequest is the payload to StreamExecute @@ -207,8 +204,7 @@ message StreamExecuteRequest { // StreamExecuteResponse is the returned value from StreamExecute message StreamExecuteResponse { - vtrpc.RPCError error = 1; - QueryResult result = 2; + QueryResult result = 1; } // BeginRequest is the payload to Begin @@ -221,8 +217,7 @@ message BeginRequest { // BeginResponse is the returned value from Begin message BeginResponse { - vtrpc.RPCError error = 1; - int64 transaction_id = 2; + int64 transaction_id = 1; } // CommitRequest is the payload to Commit @@ -235,9 +230,7 @@ message CommitRequest { } // CommitResponse is the returned value from Commit -message CommitResponse { - vtrpc.RPCError error = 1; -} +message CommitResponse {} // RollbackRequest is the payload to Rollback message RollbackRequest { @@ -249,9 +242,7 @@ message RollbackRequest { } // RollbackResponse is the returned value from Rollback -message RollbackResponse { - vtrpc.RPCError error = 1; -} +message RollbackResponse {} // SplitQueryRequest is the payload for SplitQuery message SplitQueryRequest { @@ -276,8 +267,7 @@ message QuerySplit { // SplitQueryResponse is returned by SplitQuery and represents all the queries // to execute in order to get the entire data set. message SplitQueryResponse { - vtrpc.RPCError error = 1; - repeated QuerySplit queries = 2; + repeated QuerySplit queries = 1; } // StreamHealthRequest is the payload for StreamHealth diff --git a/py/vtproto/query_pb2.py b/py/vtproto/query_pb2.py index ffd6b706df..9af1f5be52 100644 --- a/py/vtproto/query_pb2.py +++ b/py/vtproto/query_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( name='query.proto', package='query', syntax='proto3', - serialized_pb=_b('\n\x0bquery.proto\x12\x05query\x1a\x0etopodata.proto\x1a\x0bvtrpc.proto\"T\n\x06Target\x12\x10\n\x08keyspace\x18\x01 \x01(\t\x12\r\n\x05shard\x18\x02 \x01(\t\x12)\n\x0btablet_type\x18\x03 \x01(\x0e\x32\x14.topodata.TabletType\"\"\n\x0eVTGateCallerID\x12\x10\n\x08username\x18\x01 \x01(\t\"\x92\x03\n\x0c\x42indVariable\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.query.BindVariable.Type\x12\x13\n\x0bvalue_bytes\x18\x02 \x01(\x0c\x12\x11\n\tvalue_int\x18\x03 \x01(\x03\x12\x12\n\nvalue_uint\x18\x04 \x01(\x04\x12\x13\n\x0bvalue_float\x18\x05 \x01(\x01\x12\x18\n\x10value_bytes_list\x18\x06 \x03(\x0c\x12\x16\n\x0evalue_int_list\x18\x07 \x03(\x03\x12\x17\n\x0fvalue_uint_list\x18\x08 \x03(\x04\x12\x18\n\x10value_float_list\x18\t \x03(\x01\"\xa3\x01\n\x04Type\x12\r\n\tTYPE_NULL\x10\x00\x12\x0e\n\nTYPE_BYTES\x10\x01\x12\x0c\n\x08TYPE_INT\x10\x02\x12\r\n\tTYPE_UINT\x10\x03\x12\x0e\n\nTYPE_FLOAT\x10\x04\x12\x13\n\x0fTYPE_BYTES_LIST\x10\x05\x12\x11\n\rTYPE_INT_LIST\x10\x06\x12\x12\n\x0eTYPE_UINT_LIST\x10\x07\x12\x13\n\x0fTYPE_FLOAT_LIST\x10\x08\"\xa2\x01\n\nBoundQuery\x12\x0b\n\x03sql\x18\x01 \x01(\x0c\x12<\n\x0e\x62ind_variables\x18\x02 \x03(\x0b\x32$.query.BoundQuery.BindVariablesEntry\x1aI\n\x12\x42indVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\"\n\x05value\x18\x02 \x01(\x0b\x32\x13.query.BindVariable:\x02\x38\x01\"\xa1\x07\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1f\n\x04type\x18\x02 \x01(\x0e\x32\x11.query.Field.Type\x12\r\n\x05\x66lags\x18\x03 \x01(\x03\"\xe1\x03\n\x04Type\x12\x10\n\x0cTYPE_DECIMAL\x10\x00\x12\r\n\tTYPE_TINY\x10\x01\x12\x0e\n\nTYPE_SHORT\x10\x02\x12\r\n\tTYPE_LONG\x10\x03\x12\x0e\n\nTYPE_FLOAT\x10\x04\x12\x0f\n\x0bTYPE_DOUBLE\x10\x05\x12\r\n\tTYPE_NULL\x10\x06\x12\x12\n\x0eTYPE_TIMESTAMP\x10\x07\x12\x11\n\rTYPE_LONGLONG\x10\x08\x12\x0e\n\nTYPE_INT24\x10\t\x12\r\n\tTYPE_DATE\x10\n\x12\r\n\tTYPE_TIME\x10\x0b\x12\x11\n\rTYPE_DATETIME\x10\x0c\x12\r\n\tTYPE_YEAR\x10\r\x12\x10\n\x0cTYPE_NEWDATE\x10\x0e\x12\x10\n\x0cTYPE_VARCHAR\x10\x0f\x12\x0c\n\x08TYPE_BIT\x10\x10\x12\x14\n\x0fTYPE_NEWDECIMAL\x10\xf6\x01\x12\x0e\n\tTYPE_ENUM\x10\xf7\x01\x12\r\n\x08TYPE_SET\x10\xf8\x01\x12\x13\n\x0eTYPE_TINY_BLOB\x10\xf9\x01\x12\x15\n\x10TYPE_MEDIUM_BLOB\x10\xfa\x01\x12\x13\n\x0eTYPE_LONG_BLOB\x10\xfb\x01\x12\x0e\n\tTYPE_BLOB\x10\xfc\x01\x12\x14\n\x0fTYPE_VAR_STRING\x10\xfd\x01\x12\x10\n\x0bTYPE_STRING\x10\xfe\x01\x12\x12\n\rTYPE_GEOMETRY\x10\xff\x01\"\xf5\x02\n\x04\x46lag\x12\x15\n\x11VT_ZEROVALUE_FLAG\x10\x00\x12\x14\n\x10VT_NOT_NULL_FLAG\x10\x01\x12\x13\n\x0fVT_PRI_KEY_FLAG\x10\x02\x12\x16\n\x12VT_UNIQUE_KEY_FLAG\x10\x04\x12\x18\n\x14VT_MULTIPLE_KEY_FLAG\x10\x08\x12\x10\n\x0cVT_BLOB_FLAG\x10\x10\x12\x14\n\x10VT_UNSIGNED_FLAG\x10 \x12\x14\n\x10VT_ZEROFILL_FLAG\x10@\x12\x13\n\x0eVT_BINARY_FLAG\x10\x80\x01\x12\x11\n\x0cVT_ENUM_FLAG\x10\x80\x02\x12\x1b\n\x16VT_AUTO_INCREMENT_FLAG\x10\x80\x04\x12\x16\n\x11VT_TIMESTAMP_FLAG\x10\x80\x08\x12\x10\n\x0bVT_SET_FLAG\x10\x80\x10\x12\x1d\n\x18VT_NO_DEFAULT_VALUE_FLAG\x10\x80 \x12\x1a\n\x15VT_ON_UPDATE_NOW_FLAG\x10\x80@\x12\x11\n\x0bVT_NUM_FLAG\x10\x80\x80\x02\"\x15\n\x03Row\x12\x0e\n\x06values\x18\x01 \x03(\x0c\"o\n\x0bQueryResult\x12\x1c\n\x06\x66ields\x18\x01 \x03(\x0b\x32\x0c.query.Field\x12\x15\n\rrows_affected\x18\x02 \x01(\x04\x12\x11\n\tinsert_id\x18\x03 \x01(\x04\x12\x18\n\x04rows\x18\x04 \x03(\x0b\x32\n.query.Row\"\x98\x01\n\x13GetSessionIdRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x10\n\x08keyspace\x18\x03 \x01(\t\x12\r\n\x05shard\x18\x04 \x01(\t\"J\n\x14GetSessionIdResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\x12\x12\n\nsession_id\x18\x02 \x01(\x03\"\xdf\x01\n\x0e\x45xecuteRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12 \n\x05query\x18\x04 \x01(\x0b\x32\x11.query.BoundQuery\x12\x16\n\x0etransaction_id\x18\x05 \x01(\x03\x12\x12\n\nsession_id\x18\x06 \x01(\x03\"U\n\x0f\x45xecuteResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\x12\"\n\x06result\x18\x02 \x01(\x0b\x32\x12.query.QueryResult\"\xfe\x01\n\x13\x45xecuteBatchRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\"\n\x07queries\x18\x04 \x03(\x0b\x32\x11.query.BoundQuery\x12\x16\n\x0e\x61s_transaction\x18\x05 \x01(\x08\x12\x16\n\x0etransaction_id\x18\x06 \x01(\x03\x12\x12\n\nsession_id\x18\x07 \x01(\x03\"[\n\x14\x45xecuteBatchResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\x12#\n\x07results\x18\x02 \x03(\x0b\x32\x12.query.QueryResult\"\xcd\x01\n\x14StreamExecuteRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12 \n\x05query\x18\x04 \x01(\x0b\x32\x11.query.BoundQuery\x12\x12\n\nsession_id\x18\x05 \x01(\x03\"[\n\x15StreamExecuteResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\x12\"\n\x06result\x18\x02 \x01(\x0b\x32\x12.query.QueryResult\"\xa3\x01\n\x0c\x42\x65ginRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\x12\n\nsession_id\x18\x04 \x01(\x03\"G\n\rBeginResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\x12\x16\n\x0etransaction_id\x18\x02 \x01(\x03\"\xbc\x01\n\rCommitRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\x16\n\x0etransaction_id\x18\x04 \x01(\x03\x12\x12\n\nsession_id\x18\x05 \x01(\x03\"0\n\x0e\x43ommitResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\"\xbe\x01\n\x0fRollbackRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\x16\n\x0etransaction_id\x18\x04 \x01(\x03\x12\x12\n\nsession_id\x18\x05 \x01(\x03\"2\n\x10RollbackResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\"\xf5\x01\n\x11SplitQueryRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12 \n\x05query\x18\x04 \x01(\x0b\x32\x11.query.BoundQuery\x12\x14\n\x0csplit_column\x18\x05 \x01(\t\x12\x13\n\x0bsplit_count\x18\x06 \x01(\x03\x12\x12\n\nsession_id\x18\x07 \x01(\x03\"A\n\nQuerySplit\x12 \n\x05query\x18\x01 \x01(\x0b\x32\x11.query.BoundQuery\x12\x11\n\trow_count\x18\x02 \x01(\x03\"X\n\x12SplitQueryResponse\x12\x1e\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x0f.vtrpc.RPCError\x12\"\n\x07queries\x18\x02 \x03(\x0b\x32\x11.query.QuerySplit\"\x15\n\x13StreamHealthRequest\"W\n\rRealtimeStats\x12\x14\n\x0chealth_error\x18\x01 \x01(\t\x12\x1d\n\x15seconds_behind_master\x18\x02 \x01(\r\x12\x11\n\tcpu_usage\x18\x03 \x01(\x01\"\x93\x01\n\x14StreamHealthResponse\x12\x1d\n\x06target\x18\x01 \x01(\x0b\x32\r.query.Target\x12.\n&tablet_externally_reparented_timestamp\x18\x02 \x01(\x03\x12,\n\x0erealtime_stats\x18\x03 \x01(\x0b\x32\x14.query.RealtimeStatsB\x1a\n\x18\x63om.youtube.vitess.protob\x06proto3') + serialized_pb=_b('\n\x0bquery.proto\x12\x05query\x1a\x0etopodata.proto\x1a\x0bvtrpc.proto\"T\n\x06Target\x12\x10\n\x08keyspace\x18\x01 \x01(\t\x12\r\n\x05shard\x18\x02 \x01(\t\x12)\n\x0btablet_type\x18\x03 \x01(\x0e\x32\x14.topodata.TabletType\"\"\n\x0eVTGateCallerID\x12\x10\n\x08username\x18\x01 \x01(\t\"\x92\x03\n\x0c\x42indVariable\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.query.BindVariable.Type\x12\x13\n\x0bvalue_bytes\x18\x02 \x01(\x0c\x12\x11\n\tvalue_int\x18\x03 \x01(\x03\x12\x12\n\nvalue_uint\x18\x04 \x01(\x04\x12\x13\n\x0bvalue_float\x18\x05 \x01(\x01\x12\x18\n\x10value_bytes_list\x18\x06 \x03(\x0c\x12\x16\n\x0evalue_int_list\x18\x07 \x03(\x03\x12\x17\n\x0fvalue_uint_list\x18\x08 \x03(\x04\x12\x18\n\x10value_float_list\x18\t \x03(\x01\"\xa3\x01\n\x04Type\x12\r\n\tTYPE_NULL\x10\x00\x12\x0e\n\nTYPE_BYTES\x10\x01\x12\x0c\n\x08TYPE_INT\x10\x02\x12\r\n\tTYPE_UINT\x10\x03\x12\x0e\n\nTYPE_FLOAT\x10\x04\x12\x13\n\x0fTYPE_BYTES_LIST\x10\x05\x12\x11\n\rTYPE_INT_LIST\x10\x06\x12\x12\n\x0eTYPE_UINT_LIST\x10\x07\x12\x13\n\x0fTYPE_FLOAT_LIST\x10\x08\"\xa2\x01\n\nBoundQuery\x12\x0b\n\x03sql\x18\x01 \x01(\x0c\x12<\n\x0e\x62ind_variables\x18\x02 \x03(\x0b\x32$.query.BoundQuery.BindVariablesEntry\x1aI\n\x12\x42indVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\"\n\x05value\x18\x02 \x01(\x0b\x32\x13.query.BindVariable:\x02\x38\x01\"\xa1\x07\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1f\n\x04type\x18\x02 \x01(\x0e\x32\x11.query.Field.Type\x12\r\n\x05\x66lags\x18\x03 \x01(\x03\"\xe1\x03\n\x04Type\x12\x10\n\x0cTYPE_DECIMAL\x10\x00\x12\r\n\tTYPE_TINY\x10\x01\x12\x0e\n\nTYPE_SHORT\x10\x02\x12\r\n\tTYPE_LONG\x10\x03\x12\x0e\n\nTYPE_FLOAT\x10\x04\x12\x0f\n\x0bTYPE_DOUBLE\x10\x05\x12\r\n\tTYPE_NULL\x10\x06\x12\x12\n\x0eTYPE_TIMESTAMP\x10\x07\x12\x11\n\rTYPE_LONGLONG\x10\x08\x12\x0e\n\nTYPE_INT24\x10\t\x12\r\n\tTYPE_DATE\x10\n\x12\r\n\tTYPE_TIME\x10\x0b\x12\x11\n\rTYPE_DATETIME\x10\x0c\x12\r\n\tTYPE_YEAR\x10\r\x12\x10\n\x0cTYPE_NEWDATE\x10\x0e\x12\x10\n\x0cTYPE_VARCHAR\x10\x0f\x12\x0c\n\x08TYPE_BIT\x10\x10\x12\x14\n\x0fTYPE_NEWDECIMAL\x10\xf6\x01\x12\x0e\n\tTYPE_ENUM\x10\xf7\x01\x12\r\n\x08TYPE_SET\x10\xf8\x01\x12\x13\n\x0eTYPE_TINY_BLOB\x10\xf9\x01\x12\x15\n\x10TYPE_MEDIUM_BLOB\x10\xfa\x01\x12\x13\n\x0eTYPE_LONG_BLOB\x10\xfb\x01\x12\x0e\n\tTYPE_BLOB\x10\xfc\x01\x12\x14\n\x0fTYPE_VAR_STRING\x10\xfd\x01\x12\x10\n\x0bTYPE_STRING\x10\xfe\x01\x12\x12\n\rTYPE_GEOMETRY\x10\xff\x01\"\xf5\x02\n\x04\x46lag\x12\x15\n\x11VT_ZEROVALUE_FLAG\x10\x00\x12\x14\n\x10VT_NOT_NULL_FLAG\x10\x01\x12\x13\n\x0fVT_PRI_KEY_FLAG\x10\x02\x12\x16\n\x12VT_UNIQUE_KEY_FLAG\x10\x04\x12\x18\n\x14VT_MULTIPLE_KEY_FLAG\x10\x08\x12\x10\n\x0cVT_BLOB_FLAG\x10\x10\x12\x14\n\x10VT_UNSIGNED_FLAG\x10 \x12\x14\n\x10VT_ZEROFILL_FLAG\x10@\x12\x13\n\x0eVT_BINARY_FLAG\x10\x80\x01\x12\x11\n\x0cVT_ENUM_FLAG\x10\x80\x02\x12\x1b\n\x16VT_AUTO_INCREMENT_FLAG\x10\x80\x04\x12\x16\n\x11VT_TIMESTAMP_FLAG\x10\x80\x08\x12\x10\n\x0bVT_SET_FLAG\x10\x80\x10\x12\x1d\n\x18VT_NO_DEFAULT_VALUE_FLAG\x10\x80 \x12\x1a\n\x15VT_ON_UPDATE_NOW_FLAG\x10\x80@\x12\x11\n\x0bVT_NUM_FLAG\x10\x80\x80\x02\"\x15\n\x03Row\x12\x0e\n\x06values\x18\x01 \x03(\x0c\"o\n\x0bQueryResult\x12\x1c\n\x06\x66ields\x18\x01 \x03(\x0b\x32\x0c.query.Field\x12\x15\n\rrows_affected\x18\x02 \x01(\x04\x12\x11\n\tinsert_id\x18\x03 \x01(\x04\x12\x18\n\x04rows\x18\x04 \x03(\x0b\x32\n.query.Row\"\x98\x01\n\x13GetSessionIdRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x10\n\x08keyspace\x18\x03 \x01(\t\x12\r\n\x05shard\x18\x04 \x01(\t\"*\n\x14GetSessionIdResponse\x12\x12\n\nsession_id\x18\x01 \x01(\x03\"\xdf\x01\n\x0e\x45xecuteRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12 \n\x05query\x18\x04 \x01(\x0b\x32\x11.query.BoundQuery\x12\x16\n\x0etransaction_id\x18\x05 \x01(\x03\x12\x12\n\nsession_id\x18\x06 \x01(\x03\"5\n\x0f\x45xecuteResponse\x12\"\n\x06result\x18\x01 \x01(\x0b\x32\x12.query.QueryResult\"\xfe\x01\n\x13\x45xecuteBatchRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\"\n\x07queries\x18\x04 \x03(\x0b\x32\x11.query.BoundQuery\x12\x16\n\x0e\x61s_transaction\x18\x05 \x01(\x08\x12\x16\n\x0etransaction_id\x18\x06 \x01(\x03\x12\x12\n\nsession_id\x18\x07 \x01(\x03\";\n\x14\x45xecuteBatchResponse\x12#\n\x07results\x18\x01 \x03(\x0b\x32\x12.query.QueryResult\"\xcd\x01\n\x14StreamExecuteRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12 \n\x05query\x18\x04 \x01(\x0b\x32\x11.query.BoundQuery\x12\x12\n\nsession_id\x18\x05 \x01(\x03\";\n\x15StreamExecuteResponse\x12\"\n\x06result\x18\x01 \x01(\x0b\x32\x12.query.QueryResult\"\xa3\x01\n\x0c\x42\x65ginRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\x12\n\nsession_id\x18\x04 \x01(\x03\"\'\n\rBeginResponse\x12\x16\n\x0etransaction_id\x18\x01 \x01(\x03\"\xbc\x01\n\rCommitRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\x16\n\x0etransaction_id\x18\x04 \x01(\x03\x12\x12\n\nsession_id\x18\x05 \x01(\x03\"\x10\n\x0e\x43ommitResponse\"\xbe\x01\n\x0fRollbackRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12\x16\n\x0etransaction_id\x18\x04 \x01(\x03\x12\x12\n\nsession_id\x18\x05 \x01(\x03\"\x12\n\x10RollbackResponse\"\xf5\x01\n\x11SplitQueryRequest\x12,\n\x13\x65\x66\x66\x65\x63tive_caller_id\x18\x01 \x01(\x0b\x32\x0f.vtrpc.CallerID\x12\x32\n\x13immediate_caller_id\x18\x02 \x01(\x0b\x32\x15.query.VTGateCallerID\x12\x1d\n\x06target\x18\x03 \x01(\x0b\x32\r.query.Target\x12 \n\x05query\x18\x04 \x01(\x0b\x32\x11.query.BoundQuery\x12\x14\n\x0csplit_column\x18\x05 \x01(\t\x12\x13\n\x0bsplit_count\x18\x06 \x01(\x03\x12\x12\n\nsession_id\x18\x07 \x01(\x03\"A\n\nQuerySplit\x12 \n\x05query\x18\x01 \x01(\x0b\x32\x11.query.BoundQuery\x12\x11\n\trow_count\x18\x02 \x01(\x03\"8\n\x12SplitQueryResponse\x12\"\n\x07queries\x18\x01 \x03(\x0b\x32\x11.query.QuerySplit\"\x15\n\x13StreamHealthRequest\"W\n\rRealtimeStats\x12\x14\n\x0chealth_error\x18\x01 \x01(\t\x12\x1d\n\x15seconds_behind_master\x18\x02 \x01(\r\x12\x11\n\tcpu_usage\x18\x03 \x01(\x01\"\x93\x01\n\x14StreamHealthResponse\x12\x1d\n\x06target\x18\x01 \x01(\x0b\x32\r.query.Target\x12.\n&tablet_externally_reparented_timestamp\x18\x02 \x01(\x03\x12,\n\x0erealtime_stats\x18\x03 \x01(\x0b\x32\x14.query.RealtimeStatsB\x1a\n\x18\x63om.youtube.vitess.protob\x06proto3') , dependencies=[topodata__pb2.DESCRIPTOR,vtrpc__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -708,15 +708,8 @@ _GETSESSIONIDRESPONSE = _descriptor.Descriptor( containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='error', full_name='query.GetSessionIdResponse.error', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='session_id', full_name='query.GetSessionIdResponse.session_id', index=1, - number=2, type=3, cpp_type=2, label=1, + name='session_id', full_name='query.GetSessionIdResponse.session_id', index=0, + number=1, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -734,7 +727,7 @@ _GETSESSIONIDRESPONSE = _descriptor.Descriptor( oneofs=[ ], serialized_start=1966, - serialized_end=2040, + serialized_end=2008, ) @@ -799,8 +792,8 @@ _EXECUTEREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2043, - serialized_end=2266, + serialized_start=2011, + serialized_end=2234, ) @@ -812,19 +805,12 @@ _EXECUTERESPONSE = _descriptor.Descriptor( containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='error', full_name='query.ExecuteResponse.error', index=0, + name='result', full_name='query.ExecuteResponse.result', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), - _descriptor.FieldDescriptor( - name='result', full_name='query.ExecuteResponse.result', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), ], extensions=[ ], @@ -837,8 +823,8 @@ _EXECUTERESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2268, - serialized_end=2353, + serialized_start=2236, + serialized_end=2289, ) @@ -910,8 +896,8 @@ _EXECUTEBATCHREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2356, - serialized_end=2610, + serialized_start=2292, + serialized_end=2546, ) @@ -923,15 +909,8 @@ _EXECUTEBATCHRESPONSE = _descriptor.Descriptor( containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='error', full_name='query.ExecuteBatchResponse.error', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='results', full_name='query.ExecuteBatchResponse.results', index=1, - number=2, type=11, cpp_type=10, label=3, + name='results', full_name='query.ExecuteBatchResponse.results', index=0, + number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -948,8 +927,8 @@ _EXECUTEBATCHRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2612, - serialized_end=2703, + serialized_start=2548, + serialized_end=2607, ) @@ -1007,8 +986,8 @@ _STREAMEXECUTEREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2706, - serialized_end=2911, + serialized_start=2610, + serialized_end=2815, ) @@ -1020,19 +999,12 @@ _STREAMEXECUTERESPONSE = _descriptor.Descriptor( containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='error', full_name='query.StreamExecuteResponse.error', index=0, + name='result', full_name='query.StreamExecuteResponse.result', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), - _descriptor.FieldDescriptor( - name='result', full_name='query.StreamExecuteResponse.result', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), ], extensions=[ ], @@ -1045,8 +1017,8 @@ _STREAMEXECUTERESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2913, - serialized_end=3004, + serialized_start=2817, + serialized_end=2876, ) @@ -1097,8 +1069,8 @@ _BEGINREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3007, - serialized_end=3170, + serialized_start=2879, + serialized_end=3042, ) @@ -1110,15 +1082,8 @@ _BEGINRESPONSE = _descriptor.Descriptor( containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='error', full_name='query.BeginResponse.error', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='transaction_id', full_name='query.BeginResponse.transaction_id', index=1, - number=2, type=3, cpp_type=2, label=1, + name='transaction_id', full_name='query.BeginResponse.transaction_id', index=0, + number=1, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -1135,8 +1100,8 @@ _BEGINRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3172, - serialized_end=3243, + serialized_start=3044, + serialized_end=3083, ) @@ -1194,8 +1159,8 @@ _COMMITREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3246, - serialized_end=3434, + serialized_start=3086, + serialized_end=3274, ) @@ -1206,13 +1171,6 @@ _COMMITRESPONSE = _descriptor.Descriptor( file=DESCRIPTOR, containing_type=None, fields=[ - _descriptor.FieldDescriptor( - name='error', full_name='query.CommitResponse.error', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), ], extensions=[ ], @@ -1225,8 +1183,8 @@ _COMMITRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3436, - serialized_end=3484, + serialized_start=3276, + serialized_end=3292, ) @@ -1284,8 +1242,8 @@ _ROLLBACKREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3487, - serialized_end=3677, + serialized_start=3295, + serialized_end=3485, ) @@ -1296,13 +1254,6 @@ _ROLLBACKRESPONSE = _descriptor.Descriptor( file=DESCRIPTOR, containing_type=None, fields=[ - _descriptor.FieldDescriptor( - name='error', full_name='query.RollbackResponse.error', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), ], extensions=[ ], @@ -1315,8 +1266,8 @@ _ROLLBACKRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3679, - serialized_end=3729, + serialized_start=3487, + serialized_end=3505, ) @@ -1388,8 +1339,8 @@ _SPLITQUERYREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3732, - serialized_end=3977, + serialized_start=3508, + serialized_end=3753, ) @@ -1426,8 +1377,8 @@ _QUERYSPLIT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3979, - serialized_end=4044, + serialized_start=3755, + serialized_end=3820, ) @@ -1439,15 +1390,8 @@ _SPLITQUERYRESPONSE = _descriptor.Descriptor( containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='error', full_name='query.SplitQueryResponse.error', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='queries', full_name='query.SplitQueryResponse.queries', index=1, - number=2, type=11, cpp_type=10, label=3, + name='queries', full_name='query.SplitQueryResponse.queries', index=0, + number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -1464,8 +1408,8 @@ _SPLITQUERYRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=4046, - serialized_end=4134, + serialized_start=3822, + serialized_end=3878, ) @@ -1488,8 +1432,8 @@ _STREAMHEALTHREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=4136, - serialized_end=4157, + serialized_start=3880, + serialized_end=3901, ) @@ -1533,8 +1477,8 @@ _REALTIMESTATS = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=4159, - serialized_end=4246, + serialized_start=3903, + serialized_end=3990, ) @@ -1578,8 +1522,8 @@ _STREAMHEALTHRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=4249, - serialized_end=4396, + serialized_start=3993, + serialized_end=4140, ) _TARGET.fields_by_name['tablet_type'].enum_type = topodata__pb2._TABLETTYPE @@ -1595,43 +1539,35 @@ _QUERYRESULT.fields_by_name['fields'].message_type = _FIELD _QUERYRESULT.fields_by_name['rows'].message_type = _ROW _GETSESSIONIDREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _GETSESSIONIDREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID -_GETSESSIONIDRESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _EXECUTEREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _EXECUTEREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID _EXECUTEREQUEST.fields_by_name['target'].message_type = _TARGET _EXECUTEREQUEST.fields_by_name['query'].message_type = _BOUNDQUERY -_EXECUTERESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _EXECUTERESPONSE.fields_by_name['result'].message_type = _QUERYRESULT _EXECUTEBATCHREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _EXECUTEBATCHREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID _EXECUTEBATCHREQUEST.fields_by_name['target'].message_type = _TARGET _EXECUTEBATCHREQUEST.fields_by_name['queries'].message_type = _BOUNDQUERY -_EXECUTEBATCHRESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _EXECUTEBATCHRESPONSE.fields_by_name['results'].message_type = _QUERYRESULT _STREAMEXECUTEREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _STREAMEXECUTEREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID _STREAMEXECUTEREQUEST.fields_by_name['target'].message_type = _TARGET _STREAMEXECUTEREQUEST.fields_by_name['query'].message_type = _BOUNDQUERY -_STREAMEXECUTERESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _STREAMEXECUTERESPONSE.fields_by_name['result'].message_type = _QUERYRESULT _BEGINREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _BEGINREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID _BEGINREQUEST.fields_by_name['target'].message_type = _TARGET -_BEGINRESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _COMMITREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _COMMITREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID _COMMITREQUEST.fields_by_name['target'].message_type = _TARGET -_COMMITRESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _ROLLBACKREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _ROLLBACKREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID _ROLLBACKREQUEST.fields_by_name['target'].message_type = _TARGET -_ROLLBACKRESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _SPLITQUERYREQUEST.fields_by_name['effective_caller_id'].message_type = vtrpc__pb2._CALLERID _SPLITQUERYREQUEST.fields_by_name['immediate_caller_id'].message_type = _VTGATECALLERID _SPLITQUERYREQUEST.fields_by_name['target'].message_type = _TARGET _SPLITQUERYREQUEST.fields_by_name['query'].message_type = _BOUNDQUERY _QUERYSPLIT.fields_by_name['query'].message_type = _BOUNDQUERY -_SPLITQUERYRESPONSE.fields_by_name['error'].message_type = vtrpc__pb2._RPCERROR _SPLITQUERYRESPONSE.fields_by_name['queries'].message_type = _QUERYSPLIT _STREAMHEALTHRESPONSE.fields_by_name['target'].message_type = _TARGET _STREAMHEALTHRESPONSE.fields_by_name['realtime_stats'].message_type = _REALTIMESTATS