Skip to content

Commit

Permalink
Merge pull request #783 from youtube/topo
Browse files Browse the repository at this point in the history
Adding immediate caller id to query service.
  • Loading branch information
alainjobart committed Jun 11, 2015
2 parents 2f5a326 + fe8de91 commit e9346a4
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 60 deletions.
147 changes: 110 additions & 37 deletions go/vt/proto/query/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 42 additions & 23 deletions proto/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ message Target {
topo.TabletType TabletType = 3;
}

// VTGateCallerID is sent by VTGate to VTTablet to describe the
// caller. If possible, this enformation is secure. For instance,
// if using unique certificates that guarantee that VTGate->VTTablet
// traffic cannot be spoofed, then VTTablet can trust this information,
// and VTTablet will use it for tablet ACLs, for instance.
// Because of this security guarantee, this is different than the CallerID
// structure, which is not secure at all, because it is provided
// by the Vitess client.
message VTGateCallerID {
string username = 1;
}

// BindVariable represents a single bind variable in a Query
message BindVariable {
enum Type {
Expand Down Expand Up @@ -137,10 +149,11 @@ message QueryResult {

// ExecuteRequest is the payload to Execute
message ExecuteRequest {
vtrpc.CallerID caller_id = 1;
Target target = 2;
BoundQuery query = 3;
int64 transaction_id = 4;
vtrpc.CallerID effective_caller_id = 1;
VTGateCallerID immediate_caller_id = 2;
Target target = 3;
BoundQuery query = 4;
int64 transaction_id = 5;
}

// ExecuteResponse is the returned value from Execute
Expand All @@ -151,10 +164,11 @@ message ExecuteResponse {

// ExecuteBatchRequest is the payload to ExecuteBatch
message ExecuteBatchRequest {
vtrpc.CallerID caller_id = 1;
Target target = 2;
repeated BoundQuery queries = 3;
int64 transaction_id = 4;
vtrpc.CallerID effective_caller_id = 1;
VTGateCallerID immediate_caller_id = 2;
Target target = 3;
repeated BoundQuery queries = 4;
int64 transaction_id = 5;
}

// ExecuteBatchResponse is the returned value from ExecuteBatch
Expand All @@ -165,9 +179,10 @@ message ExecuteBatchResponse {

// StreamExecuteRequest is the payload to StreamExecute
message StreamExecuteRequest {
vtrpc.CallerID caller_id = 1;
Target target = 2;
BoundQuery query = 3;
vtrpc.CallerID effective_caller_id = 1;
VTGateCallerID immediate_caller_id = 2;
Target target = 3;
BoundQuery query = 4;
}

// StreamExecuteResponse is the returned value from StreamExecute
Expand All @@ -178,8 +193,9 @@ message StreamExecuteResponse {

// BeginRequest is the payload to Begin
message BeginRequest {
vtrpc.CallerID caller_id = 1;
Target target = 2;
vtrpc.CallerID effective_caller_id = 1;
VTGateCallerID immediate_caller_id = 2;
Target target = 3;
}

// BeginResponse is the returned value from Begin
Expand All @@ -190,9 +206,10 @@ message BeginResponse {

// CommitRequest is the payload to Commit
message CommitRequest {
vtrpc.CallerID caller_id = 1;
Target target = 2;
int64 transaction_id = 3;
vtrpc.CallerID effective_caller_id = 1;
VTGateCallerID immediate_caller_id = 2;
Target target = 3;
int64 transaction_id = 4;
}

// CommitResponse is the returned value from Commit
Expand All @@ -202,9 +219,10 @@ message CommitResponse {

// RollbackRequest is the payload to Rollback
message RollbackRequest {
vtrpc.CallerID caller_id = 1;
Target target = 2;
int64 transaction_id = 3;
vtrpc.CallerID effective_caller_id = 1;
VTGateCallerID immediate_caller_id = 2;
Target target = 3;
int64 transaction_id = 4;
}

// RollbackResponse is the returned value from Rollback
Expand All @@ -214,10 +232,11 @@ message RollbackResponse {

// SplitQueryRequest is the payload for SplitQuery
message SplitQueryRequest {
vtrpc.CallerID caller_id = 1;
Target target = 2;
BoundQuery query = 3;
int64 split_count = 4;
vtrpc.CallerID effective_caller_id = 1;
VTGateCallerID immediate_caller_id = 2;
Target target = 3;
BoundQuery query = 4;
int64 split_count = 5;
}

// QuerySplit represents one query to execute on the tablet
Expand Down

0 comments on commit e9346a4

Please sign in to comment.