Merge remote-tracking branch 'upstream/master' into deep-clone

Signed-off-by: Andres Taylor <andres@planetscale.com>
This commit is contained in:
Andres Taylor 2021-02-27 17:16:08 +01:00
Родитель 09f3f0bc51 5778b46796
Коммит fce3959b83
81 изменённых файлов: 83582 добавлений и 3224 удалений

Просмотреть файл

@ -172,7 +172,7 @@ java_test:
VTROOT=${PWD} mvn -f java/pom.xml -B clean verify
install_protoc-gen-go:
go install github.com/golang/protobuf/protoc-gen-go
go install github.com/gogo/protobuf/protoc-gen-gofast
PROTO_SRCS = $(wildcard proto/*.proto)
PROTO_SRC_NAMES = $(basename $(notdir $(PROTO_SRCS)))
@ -187,7 +187,7 @@ endif
$(PROTO_GO_OUTS): minimaltools install_protoc-gen-go proto/*.proto
for name in $(PROTO_SRC_NAMES); do \
$(VTROOT)/bin/protoc --go_out=plugins=grpc:. -I${PWD}/dist/vt-protoc-3.6.1/include:proto proto/$${name}.proto && \
$(VTROOT)/bin/protoc --gofast_out=plugins=grpc:. -I${PWD}/dist/vt-protoc-3.6.1/include:proto proto/$${name}.proto && \
goimports -w vitess.io/vitess/go/vt/proto/$${name}/$${name}.pb.go; \
done
cp -Rf vitess.io/vitess/go/vt/proto/* go/vt/proto

Просмотреть файл

@ -25,7 +25,7 @@ Vitess has a growing community. You can view the list of adopters
[here](https://github.com/vitessio/vitess/blob/master/ADOPTERS.md).
## Reporting a Problem, Issue ,or Bug
To report a problem the best way to get attention is to create a GitHub [issue](.https://github.com/vitessio/vitess/issues ).
To report a problem the best way to get attention is to create a GitHub [issue](.https://github.com/vitessio/vitess/issues ) using proper severity level based on this [guide](https://github.com/vitessio/vitess/blob/master/SEVERITY.md).
For topics that are better discussed live, please join the [Vitess Slack](https://vitess.io/slack) workspace.
You may post any questions on the #general channel or join some of the special-interest channels.

61
SEVERITY.md Normal file
Просмотреть файл

@ -0,0 +1,61 @@
Please search the existing issues for relevant feature requests, and use the [reaction feature](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.
#### Feature Description
In order to improve the quality of the issue queue handling and automation purposes, wed like to open this RFC. Tags are provided to rate both the severity and priority of issues for the Vitess maintainers team:
**Severity** is used to indicate how "critical" a problem is. It's a more objective rating that in theory should typically stay constant throughout the life of the issue.
**Priority** is used as a project management tool to indicate how important an issue is for the current release, milestone, and/or sprint. Because it's used for planning, the priority value is more likely than severity to be dynamic over the life of the issue.
Severity
The available tags for severity are as follows:
### Severity 1
Critical feature impact. This indicates you are unable to use the overall product resulting in a critical impact on operations. This condition requires an immediate solution. Your cluster is down or unable to serve traffic. The Vitess is unable to operate or the product caused other critical software to fail and there is no acceptable way to work around the problem. You have a significant security breach or data leak. You have data corruption, both on disk, and in the results from the cluster.
### Severity 2
Significant feature impact. This indicates the Vitess is usable but is severely limited or degraded. Severely limited can mean that a task is unable to operate, the task caused other critical software to fail, or the task is usable but not without severe difficulty.
A serious performance degradation might fall into this category unless it was so bad as to render the system completely inoperative. This can mean that function which you were attempting to use failed to function, but a temporary workaround is available hence needs immediate attention.
### Severity 3
Some feature impact. This indicates the feature is usable but a Vitess cluster runs with minor issues/limitations. The task that you were attempting to use behaved in a manner that is incorrect and/or unexpected, or presented misleading or confusing information.
This can include documentation that was incomplete or incorrect, making it difficult to know how to use a task. This can include poor or unexplained log messages where no clear error was evident. This can include situations where some side effect is observed which does not significantly harm operations.
Documentation that causes the customer to perform some operation that damaged data (unintentional deletion, corruption, etc.) would more likely be listed as a severity 2 problem.
This can not include cases where customer data is inaccurately stored, or retrieved. Data integrity problems require a severity of 2 or higher.
### Severity 4
Minimal feature impact. This indicates the problem causes little impact on operations or that a reasonable circumvention to the problem has been implemented.
The function you were attempting to use suffers from usability quirks, requires minor documentation updates, or could be enhanced with some minor changes to the function.
This is also the place for general Help/DOC suggestions where data is NOT missing or incorrect.
**Priority**
The available tags for priority are as follows:
**P-1 Priority Critical**
Cannot ship the release/milestone until completed.
Should be addressed immediately before any lower priority items.
**_P-2 Priority High_**
Part of the "must-include" plan for the given milestone
**P-3 Priority Medium**
Highly desirable but not essential for the given milestone.
**Priority Low**
Desirable for given milestone but not essential, should be pursued if an opportunity arises to address in a safe and timely manner
#### Use Case(s)
Any relevant use-cases that you see.

8
go/cache/cache.go поставляемый
Просмотреть файл

@ -47,15 +47,21 @@ type cachedObject interface {
// implementation.
func NewDefaultCacheImpl(cfg *Config) Cache {
switch {
case cfg == nil || (cfg.MaxEntries == 0 && cfg.MaxMemoryUsage == 0):
case cfg == nil:
return &nullCache{}
case cfg.LFU:
if cfg.MaxEntries == 0 || cfg.MaxMemoryUsage == 0 {
return &nullCache{}
}
return NewRistrettoCache(cfg.MaxEntries, cfg.MaxMemoryUsage, func(val interface{}) int64 {
return val.(cachedObject).CachedSize(true)
})
default:
if cfg.MaxEntries == 0 {
return &nullCache{}
}
return NewLRUCache(cfg.MaxEntries, func(_ interface{}) int64 {
return 1
})

47
go/cache/cache_test.go поставляемый Normal file
Просмотреть файл

@ -0,0 +1,47 @@
package cache
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
"vitess.io/vitess/go/cache/ristretto"
)
func TestNewDefaultCacheImpl(t *testing.T) {
assertNullCache := func(t *testing.T, cache Cache) {
_, ok := cache.(*nullCache)
require.True(t, ok)
}
assertLFUCache := func(t *testing.T, cache Cache) {
_, ok := cache.(*ristretto.Cache)
require.True(t, ok)
}
assertLRUCache := func(t *testing.T, cache Cache) {
_, ok := cache.(*LRUCache)
require.True(t, ok)
}
tests := []struct {
cfg *Config
verify func(t *testing.T, cache Cache)
}{
{&Config{MaxEntries: 0, MaxMemoryUsage: 0, LFU: false}, assertNullCache},
{&Config{MaxEntries: 0, MaxMemoryUsage: 0, LFU: true}, assertNullCache},
{&Config{MaxEntries: 100, MaxMemoryUsage: 0, LFU: false}, assertLRUCache},
{&Config{MaxEntries: 0, MaxMemoryUsage: 1000, LFU: false}, assertNullCache},
{&Config{MaxEntries: 100, MaxMemoryUsage: 1000, LFU: false}, assertLRUCache},
{&Config{MaxEntries: 100, MaxMemoryUsage: 0, LFU: true}, assertNullCache},
{&Config{MaxEntries: 100, MaxMemoryUsage: 1000, LFU: true}, assertLFUCache},
{&Config{MaxEntries: 0, MaxMemoryUsage: 1000, LFU: true}, assertNullCache},
}
for _, tt := range tests {
t.Run(fmt.Sprintf("%d.%d.%v", tt.cfg.MaxEntries, tt.cfg.MaxMemoryUsage, tt.cfg.LFU), func(t *testing.T) {
cache := NewDefaultCacheImpl(tt.cfg)
tt.verify(t, cache)
})
}
}

Просмотреть файл

@ -17,27 +17,114 @@ limitations under the License.
package command
import (
"fmt"
"time"
"github.com/golang/protobuf/ptypes"
"github.com/spf13/cobra"
"vitess.io/vitess/go/cmd/vtctldclient/cli"
"vitess.io/vitess/go/protoutil"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/topo/topoproto"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata"
)
var (
// EmergencyReparentShard makes an EmergencyReparent gRPC call to a vtctld.
EmergencyReparentShard = &cobra.Command{
Use: "EmergencyReparentShard <keyspace/shard>",
Args: cobra.ExactArgs(1),
Long: "Reparents the shard to the new primary. Assumes the old primary is dead and not responding",
RunE: commandEmergencyReparentShard,
}
// InitShardPrimary makes an InitShardPrimary gRPC call to a vtctld.
InitShardPrimary = &cobra.Command{
Use: "InitShardPrimary",
Use: "InitShardPrimary <keyspace/shard> <primary alias>",
Args: cobra.ExactArgs(2),
RunE: commandInitShardPrimary,
}
// PlannedReparentShard makes a PlannedReparentShard gRPC call to a vtctld.
PlannedReparentShard = &cobra.Command{
Use: "PlannedReparentShard <keyspace/shard>",
Args: cobra.ExactArgs(1),
Long: "string",
RunE: commandPlannedReparentShard,
}
// ReparentTablet makes a ReparentTablet gRPC call to a vtctld.
ReparentTablet = &cobra.Command{
Use: "ReparentTablet <alias>",
Long: "Reparent a tablet to the current primary in the shard. This only works if the current replica position " +
"matches the last known reparent action.",
Args: cobra.ExactArgs(1),
RunE: commandReparentTablet,
}
// TabletExternallyReparented makes a TabletExternallyReparented gRPC call
// to a vtctld.
TabletExternallyReparented = &cobra.Command{
Use: "TabletExternallyReparented <alias>",
Args: cobra.ExactArgs(1),
RunE: commandTabletExternallyReparented,
}
)
var emergencyReparentShardOptions = struct {
Force bool
WaitReplicasTimeout time.Duration
NewPrimaryAliasStr string
IgnoreReplicaAliasStrList []string
}{}
func commandEmergencyReparentShard(cmd *cobra.Command, args []string) error {
keyspace, shard, err := topoproto.ParseKeyspaceShard(cmd.Flags().Arg(0))
if err != nil {
return err
}
var (
newPrimaryAlias *topodatapb.TabletAlias
ignoreReplicaAliases = make([]*topodatapb.TabletAlias, len(emergencyReparentShardOptions.IgnoreReplicaAliasStrList))
)
if emergencyReparentShardOptions.NewPrimaryAliasStr != "" {
newPrimaryAlias, err = topoproto.ParseTabletAlias(emergencyReparentShardOptions.NewPrimaryAliasStr)
if err != nil {
return err
}
}
for i, aliasStr := range emergencyReparentShardOptions.IgnoreReplicaAliasStrList {
alias, err := topoproto.ParseTabletAlias(aliasStr)
if err != nil {
return err
}
ignoreReplicaAliases[i] = alias
}
cli.FinishedParsing(cmd)
resp, err := client.EmergencyReparentShard(commandCtx, &vtctldatapb.EmergencyReparentShardRequest{
Keyspace: keyspace,
Shard: shard,
NewPrimary: newPrimaryAlias,
IgnoreReplicas: ignoreReplicaAliases,
WaitReplicasTimeout: protoutil.DurationToProto(emergencyReparentShardOptions.WaitReplicasTimeout),
})
if err != nil {
return err
}
for _, event := range resp.Events {
fmt.Println(logutil.EventString(event))
}
return nil
}
var initShardPrimaryOptions = struct {
WaitReplicasTimeout time.Duration
Force bool
@ -60,7 +147,7 @@ func commandInitShardPrimary(cmd *cobra.Command, args []string) error {
Keyspace: keyspace,
Shard: shard,
PrimaryElectTabletAlias: tabletAlias,
WaitReplicasTimeout: ptypes.DurationProto(initShardPrimaryOptions.WaitReplicasTimeout),
WaitReplicasTimeout: protoutil.DurationToProto(initShardPrimaryOptions.WaitReplicasTimeout),
Force: initShardPrimaryOptions.Force,
})
@ -71,8 +158,118 @@ func commandInitShardPrimary(cmd *cobra.Command, args []string) error {
return err
}
var plannedReparentShardOptions = struct {
NewPrimaryAliasStr string
AvoidPrimaryAliasStr string
WaitReplicasTimeout time.Duration
}{}
func commandPlannedReparentShard(cmd *cobra.Command, args []string) error {
keyspace, shard, err := topoproto.ParseKeyspaceShard(cmd.Flags().Arg(0))
if err != nil {
return err
}
var (
newPrimaryAlias *topodatapb.TabletAlias
avoidPrimaryAlias *topodatapb.TabletAlias
)
if plannedReparentShardOptions.NewPrimaryAliasStr != "" {
newPrimaryAlias, err = topoproto.ParseTabletAlias(plannedReparentShardOptions.NewPrimaryAliasStr)
if err != nil {
return err
}
}
if plannedReparentShardOptions.AvoidPrimaryAliasStr != "" {
avoidPrimaryAlias, err = topoproto.ParseTabletAlias(plannedReparentShardOptions.AvoidPrimaryAliasStr)
if err != nil {
return err
}
}
cli.FinishedParsing(cmd)
resp, err := client.PlannedReparentShard(commandCtx, &vtctldatapb.PlannedReparentShardRequest{
Keyspace: keyspace,
Shard: shard,
NewPrimary: newPrimaryAlias,
AvoidPrimary: avoidPrimaryAlias,
WaitReplicasTimeout: protoutil.DurationToProto(plannedReparentShardOptions.WaitReplicasTimeout),
})
if err != nil {
return err
}
for _, event := range resp.Events {
fmt.Println(logutil.EventString(event))
}
return nil
}
func commandReparentTablet(cmd *cobra.Command, args []string) error {
alias, err := topoproto.ParseTabletAlias(cmd.Flags().Arg(0))
if err != nil {
return err
}
resp, err := client.ReparentTablet(commandCtx, &vtctldatapb.ReparentTabletRequest{
Tablet: alias,
})
if err != nil {
return err
}
data, err := cli.MarshalJSON(resp)
if err != nil {
return err
}
fmt.Printf("%s\n", data)
return nil
}
func commandTabletExternallyReparented(cmd *cobra.Command, args []string) error {
alias, err := topoproto.ParseTabletAlias(cmd.Flags().Arg(0))
if err != nil {
return err
}
resp, err := client.TabletExternallyReparented(commandCtx, &vtctldatapb.TabletExternallyReparentedRequest{
Tablet: alias,
})
if err != nil {
return err
}
data, err := cli.MarshalJSON(resp)
if err != nil {
return err
}
fmt.Printf("%s\n", data)
return nil
}
func init() {
EmergencyReparentShard.Flags().DurationVar(&emergencyReparentShardOptions.WaitReplicasTimeout, "wait-replicas-timeout", *topo.RemoteOperationTimeout, "Time to wait for replicas to catch up in reparenting.")
EmergencyReparentShard.Flags().StringVar(&emergencyReparentShardOptions.NewPrimaryAliasStr, "new-primary", "", "Alias of a tablet that should be the new primary. If not specified, the vtctld will select the best candidate to promote.")
EmergencyReparentShard.Flags().StringSliceVarP(&emergencyReparentShardOptions.IgnoreReplicaAliasStrList, "ignore-replicas", "i", nil, "Comma-separated, repeated list of replica tablet aliases to ignore during the emergency reparent.")
Root.AddCommand(EmergencyReparentShard)
InitShardPrimary.Flags().DurationVar(&initShardPrimaryOptions.WaitReplicasTimeout, "wait-replicas-timeout", 30*time.Second, "time to wait for replicas to catch up in reparenting")
InitShardPrimary.Flags().BoolVar(&initShardPrimaryOptions.Force, "force", false, "will force the reparent even if the provided tablet is not a master or the shard master")
Root.AddCommand(InitShardPrimary)
PlannedReparentShard.Flags().DurationVar(&plannedReparentShardOptions.WaitReplicasTimeout, "wait-replicas-timeout", *topo.RemoteOperationTimeout, "Time to wait for replicas to catch up on replication both before and after reparenting.")
PlannedReparentShard.Flags().StringVar(&plannedReparentShardOptions.NewPrimaryAliasStr, "new-primary", "", "Alias of a tablet that should be the new primary.")
PlannedReparentShard.Flags().StringVar(&plannedReparentShardOptions.AvoidPrimaryAliasStr, "avoid-primary", "", "Alias of a tablet that should not be the primary; i.e. \"reparent to any other tablet if this one is the primary\".")
Root.AddCommand(PlannedReparentShard)
Root.AddCommand(ReparentTablet)
Root.AddCommand(TabletExternallyReparented)
}

Просмотреть файл

@ -17,26 +17,41 @@ limitations under the License.
package protoutil
import (
"fmt"
"time"
"github.com/golang/protobuf/ptypes"
durationpb "github.com/golang/protobuf/ptypes/duration"
"vitess.io/vitess/go/vt/proto/vttime"
)
// DurationFromProto converts a durationpb type to a time.Duration. It returns a
// three-tuple of (dgo, ok, err) where dgo is the go time.Duration, ok indicates
// whether the proto value was set, and err is set on failure to convert the
// proto value.
func DurationFromProto(dpb *durationpb.Duration) (time.Duration, bool, error) {
func DurationFromProto(dpb *vttime.Duration) (time.Duration, bool, error) {
if dpb == nil {
return 0, false, nil
}
dgo, err := ptypes.Duration(dpb)
if err != nil {
return 0, true, err
d := time.Duration(dpb.Seconds) * time.Second
if int64(d/time.Second) != dpb.Seconds {
return 0, true, fmt.Errorf("duration: %v is out of range for time.Duration", dpb)
}
if dpb.Nanos != 0 {
d += time.Duration(dpb.Nanos) * time.Nanosecond
if (d < 0) != (dpb.Nanos < 0) {
return 0, true, fmt.Errorf("duration: %v is out of range for time.Duration", dpb)
}
}
return d, true, nil
}
// DurationToProto converts a time.Duration to a durpb.Duration.
func DurationToProto(d time.Duration) *vttime.Duration {
nanos := d.Nanoseconds()
secs := nanos / 1e9
nanos -= secs * 1e9
return &vttime.Duration{
Seconds: secs,
Nanos: int32(nanos),
}
return dgo, true, nil
}

Просмотреть файл

@ -22,7 +22,7 @@ import (
"github.com/stretchr/testify/assert"
durationpb "github.com/golang/protobuf/ptypes/duration"
"vitess.io/vitess/go/vt/proto/vttime"
)
func TestDurationFromProto(t *testing.T) {
@ -30,14 +30,14 @@ func TestDurationFromProto(t *testing.T) {
tests := []struct {
name string
in *durationpb.Duration
in *vttime.Duration
expected time.Duration
isOk bool
shouldErr bool
}{
{
name: "success",
in: &durationpb.Duration{Seconds: 1000},
in: &vttime.Duration{Seconds: 1000},
expected: time.Second * 1000,
isOk: true,
shouldErr: false,
@ -51,7 +51,7 @@ func TestDurationFromProto(t *testing.T) {
},
{
name: "error",
in: &durationpb.Duration{
in: &vttime.Duration{
// This is the max allowed seconds for a durationpb, plus 1.
Seconds: int64(10000*365.25*24*60*60) + 1,
},
@ -71,7 +71,6 @@ func TestDurationFromProto(t *testing.T) {
if tt.shouldErr {
assert.Error(t, err)
assert.Equal(t, tt.isOk, ok, "expected (_, ok, _) = DurationFromProto; to be ok = %v", tt.isOk)
return
}

Просмотреть файл

@ -77,6 +77,18 @@ func TestShowColumns(t *testing.T) {
assertMatches(t, conn, "SHOW columns FROM `t5_null_vindex` in `ks`", expected)
}
func TestShowTables(t *testing.T) {
conn, err := mysql.Connect(context.Background(), &vtParams)
require.NoError(t, err)
defer conn.Close()
query := "show tables;"
qr := exec(t, conn, query)
assert.Equal(t, "information_schema", qr.Fields[0].Database)
assert.Equal(t, "Tables_in_ks", qr.Fields[0].Name)
}
func TestCastConvert(t *testing.T) {
conn, err := mysql.Connect(context.Background(), &vtParams)
require.NoError(t, err)
@ -529,6 +541,23 @@ func TestFlush(t *testing.T) {
exec(t, conn, "flush local tables t1, t2")
}
func TestShowVariables(t *testing.T) {
defer cluster.PanicHandler(t)
ctx := context.Background()
conn, err := mysql.Connect(ctx, &vtParams)
require.NoError(t, err)
defer conn.Close()
res := exec(t, conn, "show variables like \"%version%\";")
found := false
for _, row := range res.Rows {
if row[0].ToString() == "version" {
assert.Contains(t, row[1].ToString(), "vitess")
found = true
}
}
require.True(t, found, "Expected a row for version in show query")
}
func assertMatches(t *testing.T, conn *mysql.Conn, query, expected string) {
t.Helper()
qr := exec(t, conn, query)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: automationservice.proto
package automationservice
@ -29,7 +29,7 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("automationservice.proto", fileDescriptor_c03abdd2a71b5164) }
var fileDescriptor_c03abdd2a71b5164 = []byte{
// 178 bytes of a gzipped FileDescriptorProto
// 195 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0x2c, 0x2d, 0xc9,
0xcf, 0x4d, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28,
0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc4, 0x90, 0x90, 0x12, 0x40, 0x08, 0x41, 0x14, 0x19, 0x35, 0x32,
@ -38,10 +38,11 @@ var fileDescriptor_c03abdd2a71b5164 = []byte{
0x9a, 0x71, 0x28, 0x0a, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x91, 0xd2, 0x26, 0x4a, 0x6d, 0x71,
0x01, 0xc8, 0x65, 0x4a, 0x0c, 0x42, 0xb5, 0x5c, 0x52, 0xee, 0xa9, 0x25, 0xe8, 0x0a, 0x5c, 0x52,
0x4b, 0x12, 0x33, 0x73, 0x8a, 0x85, 0x74, 0x91, 0x0d, 0xc3, 0xad, 0x0e, 0x66, 0xb7, 0x1e, 0xb1,
0xca, 0x61, 0xd6, 0x3b, 0x19, 0x44, 0xe9, 0x95, 0x65, 0x96, 0xa4, 0x16, 0x17, 0xeb, 0x65, 0xe6,
0xeb, 0x43, 0x58, 0xfa, 0xe9, 0xf9, 0xfa, 0x65, 0x25, 0xfa, 0xe0, 0x30, 0xd2, 0xc7, 0x08, 0xc7,
0x24, 0x36, 0xb0, 0x84, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x4a, 0x9d, 0xc0, 0x7c, 0x01,
0x00, 0x00,
0xca, 0x61, 0xd6, 0x3b, 0x39, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47,
0x72, 0x8c, 0x33, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0x95, 0x65, 0x96, 0xa4, 0x16, 0x17, 0xeb, 0x65,
0xe6, 0xeb, 0x43, 0x58, 0xfa, 0xe9, 0xf9, 0xfa, 0x65, 0x25, 0xfa, 0xe0, 0x30, 0xd3, 0xc7, 0x08,
0xd7, 0x24, 0x36, 0xb0, 0x84, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x22, 0x2e, 0x47, 0x89, 0x8c,
0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: binlogservice.proto
package binlogservice
@ -29,7 +29,7 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("binlogservice.proto", fileDescriptor_4ccdea02fd9c8d58) }
var fileDescriptor_4ccdea02fd9c8d58 = []byte{
// 177 bytes of a gzipped FileDescriptorProto
// 194 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0xca, 0xcc, 0xcb,
0xc9, 0x4f, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
0xe2, 0x45, 0x11, 0x94, 0x12, 0x80, 0x70, 0x53, 0x12, 0x4b, 0x12, 0x21, 0x0a, 0x8c, 0x0e, 0x31,
@ -38,10 +38,11 @@ var fileDescriptor_4ccdea02fd9c8d58 = []byte{
0xba, 0x50, 0xe5, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0xa4, 0x94, 0xf0, 0x29, 0x29, 0x2e,
0xc8, 0xcf, 0x2b, 0x4e, 0x55, 0x62, 0x30, 0x60, 0x14, 0x0a, 0xe5, 0xe2, 0x81, 0xc8, 0x86, 0x24,
0x26, 0xe5, 0xa4, 0x16, 0x0b, 0xc9, 0x63, 0xea, 0x83, 0xc8, 0xc0, 0x0c, 0x56, 0xc0, 0xad, 0x00,
0x61, 0xac, 0x93, 0x4e, 0x94, 0x56, 0x59, 0x66, 0x49, 0x6a, 0x71, 0xb1, 0x5e, 0x66, 0xbe, 0x3e,
0x84, 0xa5, 0x9f, 0x9e, 0xaf, 0x5f, 0x56, 0xa2, 0x0f, 0xf6, 0xa4, 0x3e, 0x4a, 0x20, 0x24, 0xb1,
0x81, 0x05, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xf4, 0x0a, 0x9c, 0x31, 0x01, 0x00,
0x00,
0x61, 0xac, 0x93, 0xcd, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7,
0x38, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x56, 0x59, 0x66, 0x49, 0x6a, 0x71, 0xb1, 0x5e, 0x66, 0xbe,
0x3e, 0x84, 0xa5, 0x9f, 0x9e, 0xaf, 0x5f, 0x56, 0xa2, 0x0f, 0xf6, 0xb4, 0x3e, 0x4a, 0xa0, 0x24,
0xb1, 0x81, 0x05, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xda, 0xef, 0x13, 0x20, 0x41, 0x01,
0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

Просмотреть файл

@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: logutil.proto
package logutil
import (
fmt "fmt"
io "io"
math "math"
math_bits "math/bits"
proto "github.com/golang/protobuf/proto"
vttime "vitess.io/vitess/go/vt/proto/vttime"
@ -76,18 +78,26 @@ func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) {
return fileDescriptor_31f5dd3702a8edf9, []int{0}
}
func (m *Event) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Event.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Event.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_Event.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Event) XXX_Merge(src proto.Message) {
xxx_messageInfo_Event.Merge(m, src)
}
func (m *Event) XXX_Size() int {
return xxx_messageInfo_Event.Size(m)
return m.Size()
}
func (m *Event) XXX_DiscardUnknown() {
xxx_messageInfo_Event.DiscardUnknown(m)
@ -138,20 +148,409 @@ func init() {
func init() { proto.RegisterFile("logutil.proto", fileDescriptor_31f5dd3702a8edf9) }
var fileDescriptor_31f5dd3702a8edf9 = []byte{
// 236 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x8f, 0x5f, 0x4b, 0xc3, 0x30,
0x14, 0xc5, 0xcd, 0xda, 0x38, 0x77, 0x37, 0x47, 0xb9, 0xf8, 0x10, 0x7c, 0x0a, 0x32, 0xa4, 0xf8,
0xd0, 0xc0, 0x04, 0xdf, 0x55, 0xaa, 0x0c, 0x46, 0x0b, 0x57, 0x41, 0xf0, 0x4d, 0xe1, 0x3a, 0x02,
0xd9, 0x22, 0x2e, 0xcd, 0xb7, 0xf0, 0x3b, 0x4b, 0xd3, 0xfa, 0x76, 0xce, 0xef, 0x1c, 0xee, 0x1f,
0x38, 0x77, 0x7e, 0xd7, 0x05, 0xeb, 0xaa, 0xef, 0x1f, 0x1f, 0x3c, 0x4e, 0x47, 0x7b, 0xb9, 0x88,
0x21, 0xd8, 0x3d, 0x0f, 0xf8, 0xea, 0x57, 0x80, 0xac, 0x23, 0x1f, 0x02, 0x6a, 0xc8, 0x7b, 0xae,
0x84, 0x16, 0xe5, 0x7c, 0xbd, 0xa8, 0xc6, 0xda, 0xab, 0xdd, 0x33, 0xa5, 0x04, 0x57, 0x20, 0x1d,
0x47, 0x76, 0x6a, 0xa2, 0x45, 0xb9, 0x5c, 0x2f, 0xab, 0xff, 0x0d, 0xdb, 0x9e, 0xd2, 0x10, 0x22,
0x42, 0xfe, 0x65, 0x1d, 0xab, 0x4c, 0x8b, 0x72, 0x46, 0x49, 0xf7, 0xcc, 0xd9, 0x03, 0xab, 0x5c,
0x8b, 0x32, 0xa3, 0xa4, 0xf1, 0x02, 0x64, 0xfc, 0x70, 0x1d, 0x2b, 0x99, 0x8a, 0x83, 0xb9, 0xb9,
0x03, 0x99, 0xa6, 0xe1, 0x19, 0xe4, 0x9b, 0xe6, 0xa9, 0x2d, 0x4e, 0x70, 0x0e, 0xd3, 0xb7, 0x7b,
0x6a, 0x36, 0xcd, 0x73, 0x21, 0x70, 0x06, 0xb2, 0x26, 0x6a, 0xa9, 0x98, 0xf4, 0xfc, 0xb1, 0x6d,
0x5e, 0xda, 0x6d, 0x5d, 0x64, 0x0f, 0xd7, 0xef, 0xab, 0x68, 0x03, 0x1f, 0x8f, 0x95, 0xf5, 0x66,
0x50, 0x66, 0xe7, 0x4d, 0x0c, 0x26, 0xfd, 0x69, 0xc6, 0x53, 0x3f, 0x4f, 0x93, 0xbd, 0xfd, 0x0b,
0x00, 0x00, 0xff, 0xff, 0xa4, 0x27, 0x83, 0x63, 0x1e, 0x01, 0x00, 0x00,
// 258 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x8f, 0xcd, 0x4a, 0xc3, 0x40,
0x14, 0x85, 0x7b, 0x9b, 0x8c, 0xb5, 0xb7, 0xb5, 0x84, 0xc1, 0x45, 0x70, 0x11, 0x06, 0xe9, 0x22,
0xb8, 0xc8, 0x40, 0x85, 0xee, 0x55, 0xa2, 0x14, 0x4a, 0x02, 0xa3, 0x20, 0xb8, 0x53, 0xb8, 0x96,
0x81, 0x69, 0x47, 0xec, 0x74, 0xde, 0xc2, 0xbd, 0x8f, 0xe4, 0xd2, 0x47, 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fe, 0x05, 0x00, 0x00, 0xff, 0xff, 0x7b, 0xc4, 0x19, 0xa7, 0x2e, 0x01,
0x00, 0x00,
}
func (m *Event) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Event) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Value) > 0 {
i -= len(m.Value)
copy(dAtA[i:], m.Value)
i = encodeVarintLogutil(dAtA, i, uint64(len(m.Value)))
i--
dAtA[i] = 0x2a
}
if m.Line != 0 {
i = encodeVarintLogutil(dAtA, i, uint64(m.Line))
i--
dAtA[i] = 0x20
}
if len(m.File) > 0 {
i -= len(m.File)
copy(dAtA[i:], m.File)
i = encodeVarintLogutil(dAtA, i, uint64(len(m.File)))
i--
dAtA[i] = 0x1a
}
if m.Level != 0 {
i = encodeVarintLogutil(dAtA, i, uint64(m.Level))
i--
dAtA[i] = 0x10
}
if m.Time != nil {
{
size, err := m.Time.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintLogutil(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintLogutil(dAtA []byte, offset int, v uint64) int {
offset -= sovLogutil(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Event) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Time != nil {
l = m.Time.Size()
n += 1 + l + sovLogutil(uint64(l))
}
if m.Level != 0 {
n += 1 + sovLogutil(uint64(m.Level))
}
l = len(m.File)
if l > 0 {
n += 1 + l + sovLogutil(uint64(l))
}
if m.Line != 0 {
n += 1 + sovLogutil(uint64(m.Line))
}
l = len(m.Value)
if l > 0 {
n += 1 + l + sovLogutil(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovLogutil(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozLogutil(x uint64) (n int) {
return sovLogutil(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Event) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowLogutil
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Event: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowLogutil
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthLogutil
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthLogutil
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Time == nil {
m.Time = &vttime.Time{}
}
if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType)
}
m.Level = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowLogutil
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Level |= Level(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field File", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowLogutil
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthLogutil
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthLogutil
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.File = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType)
}
m.Line = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowLogutil
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Line |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowLogutil
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthLogutil
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthLogutil
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Value = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipLogutil(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthLogutil
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLogutil
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipLogutil(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowLogutil
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowLogutil
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowLogutil
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthLogutil
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupLogutil
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthLogutil
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthLogutil = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowLogutil = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupLogutil = fmt.Errorf("proto: unexpected end of group")
)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: queryservice.proto
package queryservice
@ -30,45 +30,46 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("queryservice.proto", fileDescriptor_4bd2dde8711f22e3) }
var fileDescriptor_4bd2dde8711f22e3 = []byte{
// 598 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0x4d, 0x6f, 0xd3, 0x40,
0x10, 0x85, 0x43, 0x1b, 0xb4, 0x09, 0xa1, 0x6c, 0x29, 0x50, 0x27, 0xa4, 0x4d, 0x6e, 0x08, 0x29,
0x41, 0x80, 0x84, 0x54, 0x89, 0x43, 0x13, 0x51, 0x81, 0x10, 0x5f, 0x2e, 0x54, 0x08, 0x24, 0xa4,
0x8d, 0x33, 0x0a, 0x56, 0x1d, 0x6f, 0xea, 0x5d, 0xa7, 0xf0, 0xdb, 0xb9, 0x54, 0xb1, 0x3d, 0xe3,
0xdd, 0x8d, 0x9d, 0x5b, 0xe7, 0xbd, 0x99, 0xd7, 0xc9, 0x8c, 0xe7, 0x2d, 0xe3, 0x57, 0x29, 0x24,
0xff, 0x14, 0x24, 0xab, 0x30, 0x80, 0xe1, 0x32, 0x91, 0x5a, 0xf2, 0x96, 0x89, 0x79, 0xcd, 0x2c,
0xca, 0x29, 0x6f, 0x6f, 0x1a, 0xc6, 0x91, 0x9c, 0xcf, 0x84, 0x16, 0x39, 0xf2, 0xe2, 0x7f, 0x9b,
0xed, 0x7c, 0x5d, 0x67, 0xf0, 0x13, 0xd6, 0x78, 0xfb, 0x17,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0x4d, 0xd0, 0xfd,
0x4c, 0x6c, 0xce, 0x18, 0xff, 0x19, 0x6b, 0x5c, 0x14, 0x8b, 0xf4, 0x86, 0xc6, 0x13, 0x75, 0x61,
0xef, 0xb1, 0x53, 0xc9, 0x19, 0x3a, 0x3e, 0x6b, 0x22, 0x2c, 0xaf, 0x15, 0xef, 0x55, 0xe5, 0xcb,
0x6b, 0x55, 0x7a, 0x55, 0x1d, 0x6f, 0x68, 0xfe, 0x62, 0xed, 0xf2, 0x5f, 0xa5, 0x91, 0x56, 0xbc,
0x5f, 0xdd, 0xc6, 0x9a, 0x2b, 0xe7, 0xbf, 0x25, 0xa5, 0x14, 0x1f, 0x3f, 0xfb, 0xf9, 0x74, 0x15,
0x6a, 0x50, 0x6a, 0x18, 0xca, 0x51, 0xfe, 0xd7, 0x68, 0x2e, 0x47, 0x2b, 0x3d, 0xca, 0x5e, 0xe7,
0x91, 0xf9, 0x92, 0x4f, 0x77, 0x33, 0xec, 0xe5, 0x4d, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x30,
0x29, 0x02, 0xf4, 0x07, 0x00, 0x00,
// 622 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0x6e, 0x0e, 0x6d, 0xd0, 0x26, 0x84, 0xb2, 0xa5, 0x40, 0x9d, 0xe0, 0x36, 0xb9, 0x71, 0x49,
0x10, 0x20, 0x21, 0x15, 0x71, 0x68, 0x22, 0x2a, 0x10, 0xe2, 0xcf, 0x85, 0x0a, 0x81, 0x84, 0xb4,
0x71, 0x46, 0xc1, 0xaa, 0xe3, 0x4d, 0xbd, 0xeb, 0x14, 0xde, 0x84, 0x47, 0xe2, 0xc8, 0x23, 0xa0,
0xf0, 0x18, 0x5c, 0x50, 0x6c, 0xcf, 0x7a, 0x77, 0x63, 0xe7, 0xd6, 0xf9, 0xbe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f7,
0xe7, 0xc1, 0xca, 0x76, 0x01, 0x67, 0xd7, 0x51, 0xd3, 0xd6, 0x61, 0xfb, 0xfe, 0x6c, 0x56, 0xff,
0x7c, 0x72, 0xce, 0xd8, 0x48, 0xd7, 0xac, 0x2b, 0x5b, 0x4c, 0x6f, 0x53, 0x8a, 0x6e, 0x36, 0x1e,
0x84, 0xc0, 0x44, 0x61, 0x36, 0x79, 0x6c, 0x9b, 0x8d, 0x82, 0x55, 0xed, 0x2b, 0xd2, 0xcc, 0xe6,
0xf8, 0x02, 0x58, 0x28, 0x0b, 0xc7, 0xd7, 0x41, 0xfb, 0x33, 0x31, 0x39, 0x6d, 0xfc, 0xa7, 0xa4,
0x7e, 0x9e, 0x2f, 0xd2, 0xe9, 0x6b, 0x4f, 0xd4, 0xb9, 0xb9, 0xc7, 0x76, 0x29, 0xa7, 0xe9, 0x78,
0xa4, 0x81, 0x30, 0xbf, 0x12, 0xd4, 0x2d, 0xcb, 0xe7, 0x57, 0xa2, 0xf0, 0xaa, 0x2a, 0x5e, 0xd3,
0xfc, 0x42, 0x5a, 0xc5, 0xbf, 0x4a, 0x42, 0x29, 0x68, 0xb7, 0xbc, 0x8d, 0x15, 0x57, 0xcc, 0x7f,
0x43, 0x4a, 0x21, 0x3e, 0x7c, 0xfa, 0x6b, 0xe9, 0xd6, 0x7e, 0x2f, 0xdd, 0xda, 0x9f, 0xa5, 0x5b,
0xfb, 0xf9, 0xd7, 0xdd, 0xfa, 0x7c, 0x7f, 0x11, 0x48, 0x10, 0xa2, 0x1f, 0xf0, 0x41, 0xf6, 0xd7,
0x60, 0xca, 0x07, 0x0b, 0x39, 0x48, 0x5f, 0xeb, 0x81, 0xfe, 0xb2, 0x8f, 0x77, 0x52, 0xec, 0xd1,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x33, 0x99, 0xf7, 0xaa, 0x04, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: tableacl.proto
package tableacl
import (
fmt "fmt"
io "io"
math "math"
math_bits "math/bits"
proto "github.com/golang/protobuf/proto"
)
@ -40,18 +42,26 @@ func (*TableGroupSpec) ProtoMessage() {}
func (*TableGroupSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_7d0bedb248a1632e, []int{0}
}
func (m *TableGroupSpec) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TableGroupSpec.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *TableGroupSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TableGroupSpec.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_TableGroupSpec.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *TableGroupSpec) XXX_Merge(src proto.Message) {
xxx_messageInfo_TableGroupSpec.Merge(m, src)
}
func (m *TableGroupSpec) XXX_Size() int {
return xxx_messageInfo_TableGroupSpec.Size(m)
return m.Size()
}
func (m *TableGroupSpec) XXX_DiscardUnknown() {
xxx_messageInfo_TableGroupSpec.DiscardUnknown(m)
@ -107,18 +117,26 @@ func (*Config) ProtoMessage() {}
func (*Config) Descriptor() ([]byte, []int) {
return fileDescriptor_7d0bedb248a1632e, []int{1}
}
func (m *Config) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Config.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Config.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_Config.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Config) XXX_Merge(src proto.Message) {
xxx_messageInfo_Config.Merge(m, src)
}
func (m *Config) XXX_Size() int {
return xxx_messageInfo_Config.Size(m)
return m.Size()
}
func (m *Config) XXX_DiscardUnknown() {
xxx_messageInfo_Config.DiscardUnknown(m)
@ -141,20 +159,594 @@ func init() {
func init() { proto.RegisterFile("tableacl.proto", fileDescriptor_7d0bedb248a1632e) }
var fileDescriptor_7d0bedb248a1632e = []byte{
// 232 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4b, 0xc3, 0x30,
0x14, 0xc6, 0x89, 0x9d, 0xd5, 0xbd, 0xc9, 0x0e, 0x41, 0x34, 0xc7, 0x32, 0x10, 0x7b, 0x6a, 0x40,
0xf1, 0xe4, 0x4d, 0x11, 0x6f, 0x2a, 0xd5, 0x93, 0x97, 0x92, 0x6d, 0x6f, 0x25, 0xb0, 0x35, 0xe1,
0xbd, 0x38, 0xfd, 0x8f, 0xfc, 0x37, 0x25, 0x69, 0x3b, 0xf0, 0xf6, 0xfd, 0xf8, 0x25, 0xe1, 0xfb,
0x02, 0xf3, 0x60, 0x96, 0x5b, 0x34, 0xab, 0x6d, 0xe5, 0xc9, 0x05, 0x27, 0x4f, 0x47, 0x5e, 0xfc,
0x0a, 0x98, 0x7f, 0x44, 0x78, 0x26, 0xf7, 0xe5, 0xdf, 0x3d, 0xae, 0xa4, 0x84, 0x49, 0x67, 0x76,
0xa8, 0x44, 0x21, 0xca, 0x69, 0x9d, 0xb2, 0xbc, 0x83, 0xcb, 0x74, 0xa5, 0x89, 0xc4, 0x8d, 0xa3,
0xc6, 0x13, 0x6e, 0xec, 0x0f, 0xb2, 0x3a, 0x2a, 0xb2, 0x72, 0x5a, 0x9f, 0x27, 0xfd, 0x12, 0xed,
0x2b, 0xbd, 0x0d, 0x4e, 0x2a, 0x38, 0x21, 0x34, 0x6b, 0x24, 0x56, 0x59, 0x3a, 0x36, 0x62, 0x34,
0xdf, 0x64, 0x43, 0x34, 0x93, 0xde, 0x0c, 0x28, 0x2f, 0x20, 0x37, 0xeb, 0x9d, 0xed, 0x58, 0x1d,
0x27, 0x31, 0xd0, 0xe2, 0x09, 0xf2, 0x47, 0xd7, 0x6d, 0x6c, 0x2b, 0xef, 0xe1, 0xac, 0x2f, 0xd3,
0xc6, 0xce, 0xac, 0x44, 0x91, 0x95, 0xb3, 0x1b, 0x55, 0x1d, 0x46, 0xfe, 0x1f, 0x54, 0xcf, 0xc2,
0x81, 0xf9, 0xe1, 0xfa, 0xf3, 0x6a, 0x6f, 0x03, 0x32, 0x57, 0xd6, 0xe9, 0x3e, 0xe9, 0xd6, 0xe9,
0x7d, 0xd0, 0xe9, 0x6b, 0xf4, 0xf8, 0xc8, 0x32, 0x4f, 0x7c, 0xfb, 0x17, 0x00, 0x00, 0xff, 0xff,
0x09, 0x82, 0xf5, 0x82, 0x3c, 0x01, 0x00, 0x00,
// 251 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0x49, 0x4c, 0xca,
0x49, 0x4d, 0x4c, 0xce, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0x95, 0x96,
0x33, 0x72, 0xf1, 0x85, 0x80, 0x38, 0xee, 0x45, 0xf9, 0xa5, 0x05, 0xc1, 0x05, 0xa9, 0xc9, 0x42,
0x42, 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x60, 0xb6,
0x90, 0x29, 0x97, 0x38, 0x58, 0x4b, 0x3c, 0x88, 0x57, 0x1c, 0x9f, 0x5f, 0x14, 0x5f, 0x50, 0x94,
0x9a, 0x96, 0x59, 0x91, 0x5a, 0x2c, 0xc1, 0xa4, 0xc0, 0xac, 0xc1, 0x19, 0x24, 0x02, 0x96, 0xf6,
0x03, 0xc9, 0xfa, 0x17, 0x05, 0x40, 0xe5, 0x84, 0x24, 0xb8, 0xd8, 0x8b, 0x52, 0x13, 0x53, 0x52,
0x8b, 0x8a, 0x25, 0x98, 0xc1, 0xca, 0x60, 0x5c, 0x90, 0x4c, 0x79, 0x51, 0x66, 0x09, 0x48, 0x86,
0x05, 0x22, 0x03, 0xe5, 0x0a, 0x89, 0x71, 0xb1, 0x25, 0xa6, 0xe4, 0x66, 0xe6, 0x15, 0x4b, 0xb0,
0x82, 0x25, 0xa0, 0x3c, 0x25, 0x57, 0x2e, 0x36, 0xe7, 0xfc, 0xbc, 0xb4, 0xcc, 0x74, 0x21, 0x6b,
0x2e, 0x1e, 0x88, 0x63, 0xd2, 0x41, 0x6e, 0x2e, 0x96, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x92,
0xd0, 0x83, 0x7b, 0x12, 0xd5, 0x43, 0x41, 0xdc, 0x25, 0x70, 0x7e, 0xb1, 0x93, 0xf9, 0x89, 0x47,
0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x43, 0x94,
0x6a, 0x59, 0x66, 0x49, 0x6a, 0x71, 0xb1, 0x5e, 0x66, 0xbe, 0x3e, 0x84, 0xa5, 0x9f, 0x9e, 0xaf,
0x5f, 0x56, 0xa2, 0x0f, 0x0e, 0x2a, 0x7d, 0x98, 0xa1, 0x49, 0x6c, 0x60, 0xbe, 0x31, 0x20, 0x00,
0x00, 0xff, 0xff, 0xe5, 0x2a, 0xb5, 0x83, 0x4c, 0x01, 0x00, 0x00,
}
func (m *TableGroupSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *TableGroupSpec) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TableGroupSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Admins) > 0 {
for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Admins[iNdEx])
copy(dAtA[i:], m.Admins[iNdEx])
i = encodeVarintTableacl(dAtA, i, uint64(len(m.Admins[iNdEx])))
i--
dAtA[i] = 0x2a
}
}
if len(m.Writers) > 0 {
for iNdEx := len(m.Writers) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Writers[iNdEx])
copy(dAtA[i:], m.Writers[iNdEx])
i = encodeVarintTableacl(dAtA, i, uint64(len(m.Writers[iNdEx])))
i--
dAtA[i] = 0x22
}
}
if len(m.Readers) > 0 {
for iNdEx := len(m.Readers) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Readers[iNdEx])
copy(dAtA[i:], m.Readers[iNdEx])
i = encodeVarintTableacl(dAtA, i, uint64(len(m.Readers[iNdEx])))
i--
dAtA[i] = 0x1a
}
}
if len(m.TableNamesOrPrefixes) > 0 {
for iNdEx := len(m.TableNamesOrPrefixes) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.TableNamesOrPrefixes[iNdEx])
copy(dAtA[i:], m.TableNamesOrPrefixes[iNdEx])
i = encodeVarintTableacl(dAtA, i, uint64(len(m.TableNamesOrPrefixes[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintTableacl(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *Config) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Config) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.TableGroups) > 0 {
for iNdEx := len(m.TableGroups) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.TableGroups[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintTableacl(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func encodeVarintTableacl(dAtA []byte, offset int, v uint64) int {
offset -= sovTableacl(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *TableGroupSpec) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Name)
if l > 0 {
n += 1 + l + sovTableacl(uint64(l))
}
if len(m.TableNamesOrPrefixes) > 0 {
for _, s := range m.TableNamesOrPrefixes {
l = len(s)
n += 1 + l + sovTableacl(uint64(l))
}
}
if len(m.Readers) > 0 {
for _, s := range m.Readers {
l = len(s)
n += 1 + l + sovTableacl(uint64(l))
}
}
if len(m.Writers) > 0 {
for _, s := range m.Writers {
l = len(s)
n += 1 + l + sovTableacl(uint64(l))
}
}
if len(m.Admins) > 0 {
for _, s := range m.Admins {
l = len(s)
n += 1 + l + sovTableacl(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Config) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.TableGroups) > 0 {
for _, e := range m.TableGroups {
l = e.Size()
n += 1 + l + sovTableacl(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovTableacl(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozTableacl(x uint64) (n int) {
return sovTableacl(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *TableGroupSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: TableGroupSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TableGroupSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTableacl
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTableacl
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TableNamesOrPrefixes", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTableacl
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTableacl
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TableNamesOrPrefixes = append(m.TableNamesOrPrefixes, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Readers", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTableacl
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTableacl
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Readers = append(m.Readers, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Writers", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTableacl
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTableacl
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Writers = append(m.Writers, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTableacl
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTableacl
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Admins = append(m.Admins, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTableacl(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTableacl
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTableacl
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Config) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Config: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Config: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TableGroups", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTableacl
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthTableacl
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthTableacl
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TableGroups = append(m.TableGroups, &TableGroupSpec{})
if err := m.TableGroups[len(m.TableGroups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTableacl(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTableacl
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTableacl
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipTableacl(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTableacl
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTableacl
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTableacl
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthTableacl
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupTableacl
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthTableacl
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthTableacl = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowTableacl = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupTableacl = fmt.Errorf("proto: unexpected end of group")
)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: tabletmanagerservice.proto
package tabletmanagerservice
@ -29,70 +29,72 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("tabletmanagerservice.proto", fileDescriptor_9ee75fe63cfd9360) }
var fileDescriptor_9ee75fe63cfd9360 = []byte{
// 998 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x6d, 0x6f, 0x23, 0x35,
0x10, 0xc7, 0xa9, 0xc4, 0x9d, 0x84, 0x79, 0x36, 0x88, 0x93, 0x8a, 0x04, 0x07, 0xd7, 0x83, 0xe3,
0x0e, 0x9a, 0x7b, 0xe0, 0x78, 0x9f, 0x7b, 0x68, 0xaf, 0xa8, 0x15, 0x21, 0xe9, 0x03, 0x02, 0x09,
0xc9, 0x4d, 0xa6, 0x89, 0xe9, 0xc6, 0x5e, 0x6c, 0x27, 0xa2, 0xaf, 0x90, 0x78, 0x8b, 0xc4, 0x07,
0xe2, 0xd3, 0x9d, 0xb2, 0x59, 0x7b, 0xc7, 0xbb, 0xb3, 0xce, 0xf6, 0x5d, 0x94, 0xf9, 0xcd, 0xfc,
0xed, 0xd9, 0xf1, 0x8c, 0x77, 0xd9, 0xb6, 0x13, 0xe7, 0x19, 0xb8,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c8, 0x4b, 0xf6, 0x51, 0xa5,
0x3c, 0x04, 0xbb, 0xea, 0x6a, 0x30, 0xe1, 0xe9, 0x15, 0x06, 0xce, 0xab, 0xed, 0x76, 0xc5, 0x83,
0xee, 0x7f, 0x5b, 0xec, 0xd3, 0xda, 0xec, 0xe8, 0xab, 0xc9, 0xea, 0x95, 0x77, 0x7d, 0x97, 0x78,
0xba, 0x79, 0xd6, 0x60, 0xde, 0x2f, 0xe4, 0x87, 0xeb, 0xba, 0xe1, 0x9b, 0x46, 0x99, 0x78, 0x7f,
0x18, 0xee, 0x91, 0xef, 0x00, 0x18, 0x49, 0xdd, 0x34, 0xea, 0x64, 0x10, 0xfa, 0x99, 0xdd, 0x7c,
0x26, 0xc6, 0x97, 0x8b, 0x9c, 0x53, 0x9f, 0x2a, 0xd6, 0x26, 0x1f, 0xf8, 0x8b, 0x04, 0xe1, 0x03,
0x3e, 0xdc, 0xe2, 0x66, 0x75, 0xf5, 0xb3, 0x4e, 0x1b, 0xd8, 0x33, 0x7a, 0x5e, 0x46, 0x6f, 0xe9,
0x75, 0x31, 0x95, 0xbe, 0xfa, 0x35, 0x60, 0xa4, 0x79, 0xc8, 0x6e, 0x9c, 0x16, 0xf3, 0x86, 0xfa,
0x22, 0x73, 0x8a, 0x87, 0xcc, 0xed, 0x76, 0xc0, 0xc7, 0x7b, 0xf6, 0xe4, 0xd7, 0x47, 0x4b, 0xe9,
0xc0, 0xda, 0x5d, 0xa9, 0x7b, 0xeb, 0x5f, 0xbd, 0xa9, 0xee, 0x2d, 0x5d, 0xaf, 0xf8, 0xb8, 0xd4,
0xa3, 0x3e, 0x45, 0x9d, 0xdf, 0x2c, 0x6c, 0x4f, 0x5e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xba, 0xb0,
0x28, 0x40, 0xc5, 0x12, 0x00, 0x00,
// 1025 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94,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1, 0x1b, 0x7a, 0x9d, 0x4f, 0x85, 0xaf, 0x7e, 0x35,
0x18, 0x69, 0x1e, 0xb2, 0xeb, 0x27, 0xf9, 0xbc, 0xa1, 0xbe, 0xc8, 0x9c, 0xe0, 0x21, 0x73, 0xab,
0x19, 0xb0, 0xf1, 0x9e, 0xec, 0xfe, 0x73, 0xd5, 0xed, 0xfc, 0x7b, 0xd5, 0xed, 0xfc, 0x77, 0xd5,
0xed, 0xfc, 0xf5, 0x7f, 0xf7, 0xda, 0x0f, 0x0f, 0x97, 0x91, 0x01, 0xad, 0x77, 0x22, 0xd9, 0x5b,
0xfd, 0xea, 0x4d, 0x65, 0x6f, 0x69, 0x7a, 0xf9, 0xc7, 0xa6, 0x1e, 0xf5, 0x69, 0xea, 0xec, 0x46,
0x6e, 0xfb, 0xf2, 0x65, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x51, 0x5d, 0x35, 0xd5, 0x12, 0x00,
0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: throttlerservice.proto
package throttlerservice
@ -29,23 +29,24 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("throttlerservice.proto", fileDescriptor_33af55db6d07f810) }
var fileDescriptor_33af55db6d07f810 = []byte{
// 241 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3d, 0x4b, 0xc4, 0x40,
0x10, 0x86, 0x05, 0x41, 0x74, 0xaa, 0x63, 0x0f, 0x2c, 0xae, 0xf0, 0xab, 0x50, 0x4f, 0x30, 0x0b,
0xfa, 0x0f, 0xb4, 0xb0, 0xba, 0x26, 0xa7, 0x8d, 0xdd, 0xea, 0x8d, 0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0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0x64, 0xc0, 0xd9, 0x6e, 0x02, 0x00,
0x00,
// 260 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0xc9, 0x28, 0xca,
0x2f, 0x29, 0xc9, 0x49, 0x2d, 0x2a, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca,
0x2f, 0xc9, 0x17, 0x12, 0x40, 0x17, 0x97, 0x12, 0x86, 0x8b, 0xa4, 0x24, 0x96, 0x24, 0x42, 0x94,
0x19, 0x7d, 0x66, 0xe6, 0xe2, 0x0c, 0x81, 0x89, 0x0b, 0xf9, 0x72, 0x71, 0xf8, 0x26, 0x56, 0x04,
0x25, 0x96, 0xa4, 0x16, 0x0b, 0xc9, 0xe9, 0xa1, 0xaa, 0x87, 0x49, 0x04, 0xa5, 0x16, 0x96, 0xa6,
0x16, 0x97, 0x48, 0xc9, 0xe3, 0x94, 0x2f, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x55, 0x62, 0x10, 0x0a,
0xe6, 0xe2, 0x0a, 0x4e, 0x2d, 0x81, 0x4a, 0x08, 0x29, 0xa0, 0x69, 0x40, 0x48, 0xc1, 0x8c, 0x54,
0xc4, 0xa3, 0x02, 0x6e, 0x68, 0x2a, 0x97, 0x80, 0x7b, 0x6a, 0x89, 0x73, 0x7e, 0x5e, 0x5a, 0x66,
0x7a, 0x69, 0x51, 0x62, 0x49, 0x66, 0x7e, 0x9e, 0x90, 0x1a, 0x9a, 0x46, 0x74, 0x05, 0x30, 0x0b,
0xd4, 0x09, 0xaa, 0x83, 0x5b, 0x93, 0xc7, 0x25, 0x1c, 0x5a, 0x90, 0x92, 0x58, 0x92, 0x8a, 0x6a,
0x93, 0x26, 0x9a, 0x09, 0x58, 0xd4, 0xc0, 0x2c, 0xd3, 0x22, 0x46, 0x29, 0xdc, 0xbe, 0x6c, 0x2e,
0xa1, 0xa0, 0xd4, 0x62, 0x74, 0x8f, 0x69, 0xa0, 0x99, 0x81, 0xa9, 0x04, 0x66, 0x9b, 0x26, 0x11,
0x2a, 0x61, 0x96, 0x39, 0xd9, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47,
0x72, 0x8c, 0x33, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0x96, 0x65, 0x96, 0xa4, 0x16, 0x17, 0xeb, 0x65,
0xe6, 0xeb, 0x43, 0x58, 0xfa, 0xe9, 0xf9, 0xfa, 0x65, 0x25, 0xfa, 0xe0, 0x54, 0xa2, 0x8f, 0x9e,
0x96, 0x92, 0xd8, 0xc0, 0xe2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x62, 0x05, 0x96,
0x7e, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: vtctlservice.proto
package vtctlservice
@ -29,43 +29,51 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("vtctlservice.proto", fileDescriptor_27055cdbb1148d2b) }
var fileDescriptor_27055cdbb1148d2b = []byte{
// 574 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x96, 0x6d, 0x4f, 0x13, 0x41,
0x10, 0xc7, 0xf5, 0x85, 0x44, 0x57, 0x04, 0xb2, 0xbe, 0x30, 0x29, 0xb4, 0xd2, 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 0x10, 0x46, 0xa9,
0xba, 0x39, 0xa6, 0xf9, 0xc2, 0xcf, 0x34, 0x83, 0x22, 0x96, 0x63, 0xf6, 0x97, 0xa8, 0xf4, 0xe0,
0x0b, 0x9e, 0x4d, 0xcf, 0x26, 0xec, 0x15, 0x7a, 0x15, 0xb3, 0x05, 0xbf, 0x20, 0xd1, 0xef, 0x4d,
0xb9, 0xb7, 0xd9, 0x99, 0xdb, 0xcd, 0xf5, 0xe9, 0xc8, 0x76, 0x6f, 0x9a, 0x0a, 0x65, 0xfc, 0x1d,
0x55, 0x45, 0xad, 0x7d, 0xcb, 0x21, 0xa1, 0x24, 0x08, 0xd4, 0x45, 0x02, 0x1e, 0x7e, 0xad, 0x59,
0x94, 0xcb, 0xe4, 0xc0, 0x37, 0x2b, 0xaa, 0xe5, 0xf0, 0xe3, 0xf7, 0xbf, 0x26, 0x4e, 0xe5, 0xf7,
0xc4, 0xa9, 0xfc, 0x99, 0x38, 0x95, 0x1f, 0x7f, 0x9d, 0xb5, 0xcb, 0x83, 0xd4, 0xe7, 0xc0, 0x58,
0xc3, 0x8f, 0x9a, 0xe2, 0x53, 0x73, 0x10, 0x35, 0x53, 0xde, 0xcc, 0xfe, 0xc3, 0x35, 0xf5, 0x7f,
0x78, 0xd7, 0xeb, 0x59, 0xed, 0xdd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x90, 0xec, 0xfc, 0x38,
0x0c, 0x0a, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -203,6 +211,9 @@ type VtctldClient interface {
DeleteShards(ctx context.Context, in *vtctldata.DeleteShardsRequest, opts ...grpc.CallOption) (*vtctldata.DeleteShardsResponse, error)
// DeleteTablets deletes one or more tablets from the topology.
DeleteTablets(ctx context.Context, in *vtctldata.DeleteTabletsRequest, opts ...grpc.CallOption) (*vtctldata.DeleteTabletsResponse, error)
// EmergencyReparentShard reparents the shard to the new primary. It assumes
// the old primary is dead or otherwise not responding.
EmergencyReparentShard(ctx context.Context, in *vtctldata.EmergencyReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.EmergencyReparentShardResponse, error)
// FindAllShardsInKeyspace returns a map of shard names to shard references
// for a given keyspace.
FindAllShardsInKeyspace(ctx context.Context, in *vtctldata.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldata.FindAllShardsInKeyspaceResponse, error)
@ -240,6 +251,14 @@ type VtctldClient interface {
// PlannedReparentShard or EmergencyReparentShard should be used in those
// cases instead.
InitShardPrimary(ctx context.Context, in *vtctldata.InitShardPrimaryRequest, opts ...grpc.CallOption) (*vtctldata.InitShardPrimaryResponse, error)
// PlannedReparentShard reparents the shard to the new primary, or away from
// an old primary. Both the old and new primaries need to be reachable and
// running.
//
// **NOTE**: The vtctld will not consider any replicas outside the cell the
// current shard primary is in for promotion unless NewPrimary is explicitly
// provided in the request.
PlannedReparentShard(ctx context.Context, in *vtctldata.PlannedReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.PlannedReparentShardResponse, error)
// RemoveKeyspaceCell removes the specified cell from the Cells list for all
// shards in the specified keyspace, as well as from the SrvKeyspace for that
// keyspace in that cell.
@ -247,6 +266,17 @@ type VtctldClient interface {
// RemoveShardCell removes the specified cell from the specified shard's Cells
// list.
RemoveShardCell(ctx context.Context, in *vtctldata.RemoveShardCellRequest, opts ...grpc.CallOption) (*vtctldata.RemoveShardCellResponse, error)
// ReparentTablet reparents a tablet to the current primary in the shard. This
// only works if the current replica position matches the last known reparent
// action.
ReparentTablet(ctx context.Context, in *vtctldata.ReparentTabletRequest, opts ...grpc.CallOption) (*vtctldata.ReparentTabletResponse, error)
// TabletExternallyReparented changes metadata in the topology server to
// acknowledge a shard primary change performed by an external tool (e.g.
// orchestrator).
//
// See the Reparenting guide for more information:
// https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting.
TabletExternallyReparented(ctx context.Context, in *vtctldata.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*vtctldata.TabletExternallyReparentedResponse, error)
}
type vtctldClient struct {
@ -311,6 +341,15 @@ func (c *vtctldClient) DeleteTablets(ctx context.Context, in *vtctldata.DeleteTa
return out, nil
}
func (c *vtctldClient) EmergencyReparentShard(ctx context.Context, in *vtctldata.EmergencyReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.EmergencyReparentShardResponse, error) {
out := new(vtctldata.EmergencyReparentShardResponse)
err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/EmergencyReparentShard", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *vtctldClient) FindAllShardsInKeyspace(ctx context.Context, in *vtctldata.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldata.FindAllShardsInKeyspaceResponse, error) {
out := new(vtctldata.FindAllShardsInKeyspaceResponse)
err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/FindAllShardsInKeyspace", in, out, opts...)
@ -437,6 +476,15 @@ func (c *vtctldClient) InitShardPrimary(ctx context.Context, in *vtctldata.InitS
return out, nil
}
func (c *vtctldClient) PlannedReparentShard(ctx context.Context, in *vtctldata.PlannedReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.PlannedReparentShardResponse, error) {
out := new(vtctldata.PlannedReparentShardResponse)
err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/PlannedReparentShard", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *vtctldClient) RemoveKeyspaceCell(ctx context.Context, in *vtctldata.RemoveKeyspaceCellRequest, opts ...grpc.CallOption) (*vtctldata.RemoveKeyspaceCellResponse, error) {
out := new(vtctldata.RemoveKeyspaceCellResponse)
err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/RemoveKeyspaceCell", in, out, opts...)
@ -455,6 +503,24 @@ func (c *vtctldClient) RemoveShardCell(ctx context.Context, in *vtctldata.Remove
return out, nil
}
func (c *vtctldClient) ReparentTablet(ctx context.Context, in *vtctldata.ReparentTabletRequest, opts ...grpc.CallOption) (*vtctldata.ReparentTabletResponse, error) {
out := new(vtctldata.ReparentTabletResponse)
err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/ReparentTablet", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *vtctldClient) TabletExternallyReparented(ctx context.Context, in *vtctldata.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*vtctldata.TabletExternallyReparentedResponse, error) {
out := new(vtctldata.TabletExternallyReparentedResponse)
err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/TabletExternallyReparented", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// VtctldServer is the server API for Vtctld service.
type VtctldServer interface {
// ChangeTabletType changes the db type for the specified tablet, if possible.
@ -481,6 +547,9 @@ type VtctldServer interface {
DeleteShards(context.Context, *vtctldata.DeleteShardsRequest) (*vtctldata.DeleteShardsResponse, error)
// DeleteTablets deletes one or more tablets from the topology.
DeleteTablets(context.Context, *vtctldata.DeleteTabletsRequest) (*vtctldata.DeleteTabletsResponse, error)
// EmergencyReparentShard reparents the shard to the new primary. It assumes
// the old primary is dead or otherwise not responding.
EmergencyReparentShard(context.Context, *vtctldata.EmergencyReparentShardRequest) (*vtctldata.EmergencyReparentShardResponse, error)
// FindAllShardsInKeyspace returns a map of shard names to shard references
// for a given keyspace.
FindAllShardsInKeyspace(context.Context, *vtctldata.FindAllShardsInKeyspaceRequest) (*vtctldata.FindAllShardsInKeyspaceResponse, error)
@ -518,6 +587,14 @@ type VtctldServer interface {
// PlannedReparentShard or EmergencyReparentShard should be used in those
// cases instead.
InitShardPrimary(context.Context, *vtctldata.InitShardPrimaryRequest) (*vtctldata.InitShardPrimaryResponse, error)
// PlannedReparentShard reparents the shard to the new primary, or away from
// an old primary. Both the old and new primaries need to be reachable and
// running.
//
// **NOTE**: The vtctld will not consider any replicas outside the cell the
// current shard primary is in for promotion unless NewPrimary is explicitly
// provided in the request.
PlannedReparentShard(context.Context, *vtctldata.PlannedReparentShardRequest) (*vtctldata.PlannedReparentShardResponse, error)
// RemoveKeyspaceCell removes the specified cell from the Cells list for all
// shards in the specified keyspace, as well as from the SrvKeyspace for that
// keyspace in that cell.
@ -525,6 +602,17 @@ type VtctldServer interface {
// RemoveShardCell removes the specified cell from the specified shard's Cells
// list.
RemoveShardCell(context.Context, *vtctldata.RemoveShardCellRequest) (*vtctldata.RemoveShardCellResponse, error)
// ReparentTablet reparents a tablet to the current primary in the shard. This
// only works if the current replica position matches the last known reparent
// action.
ReparentTablet(context.Context, *vtctldata.ReparentTabletRequest) (*vtctldata.ReparentTabletResponse, error)
// TabletExternallyReparented changes metadata in the topology server to
// acknowledge a shard primary change performed by an external tool (e.g.
// orchestrator).
//
// See the Reparenting guide for more information:
// https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting.
TabletExternallyReparented(context.Context, *vtctldata.TabletExternallyReparentedRequest) (*vtctldata.TabletExternallyReparentedResponse, error)
}
// UnimplementedVtctldServer can be embedded to have forward compatible implementations.
@ -549,6 +637,9 @@ func (*UnimplementedVtctldServer) DeleteShards(ctx context.Context, req *vtctlda
func (*UnimplementedVtctldServer) DeleteTablets(ctx context.Context, req *vtctldata.DeleteTabletsRequest) (*vtctldata.DeleteTabletsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteTablets not implemented")
}
func (*UnimplementedVtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldata.EmergencyReparentShardRequest) (*vtctldata.EmergencyReparentShardResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EmergencyReparentShard not implemented")
}
func (*UnimplementedVtctldServer) FindAllShardsInKeyspace(ctx context.Context, req *vtctldata.FindAllShardsInKeyspaceRequest) (*vtctldata.FindAllShardsInKeyspaceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindAllShardsInKeyspace not implemented")
}
@ -591,12 +682,21 @@ func (*UnimplementedVtctldServer) GetVSchema(ctx context.Context, req *vtctldata
func (*UnimplementedVtctldServer) InitShardPrimary(ctx context.Context, req *vtctldata.InitShardPrimaryRequest) (*vtctldata.InitShardPrimaryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method InitShardPrimary not implemented")
}
func (*UnimplementedVtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldata.PlannedReparentShardRequest) (*vtctldata.PlannedReparentShardResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PlannedReparentShard not implemented")
}
func (*UnimplementedVtctldServer) RemoveKeyspaceCell(ctx context.Context, req *vtctldata.RemoveKeyspaceCellRequest) (*vtctldata.RemoveKeyspaceCellResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveKeyspaceCell not implemented")
}
func (*UnimplementedVtctldServer) RemoveShardCell(ctx context.Context, req *vtctldata.RemoveShardCellRequest) (*vtctldata.RemoveShardCellResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveShardCell not implemented")
}
func (*UnimplementedVtctldServer) ReparentTablet(ctx context.Context, req *vtctldata.ReparentTabletRequest) (*vtctldata.ReparentTabletResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReparentTablet not implemented")
}
func (*UnimplementedVtctldServer) TabletExternallyReparented(ctx context.Context, req *vtctldata.TabletExternallyReparentedRequest) (*vtctldata.TabletExternallyReparentedResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method TabletExternallyReparented not implemented")
}
func RegisterVtctldServer(s *grpc.Server, srv VtctldServer) {
s.RegisterService(&_Vtctld_serviceDesc, srv)
@ -710,6 +810,24 @@ func _Vtctld_DeleteTablets_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler)
}
func _Vtctld_EmergencyReparentShard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vtctldata.EmergencyReparentShardRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VtctldServer).EmergencyReparentShard(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vtctlservice.Vtctld/EmergencyReparentShard",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VtctldServer).EmergencyReparentShard(ctx, req.(*vtctldata.EmergencyReparentShardRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Vtctld_FindAllShardsInKeyspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vtctldata.FindAllShardsInKeyspaceRequest)
if err := dec(in); err != nil {
@ -962,6 +1080,24 @@ func _Vtctld_InitShardPrimary_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _Vtctld_PlannedReparentShard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vtctldata.PlannedReparentShardRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VtctldServer).PlannedReparentShard(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vtctlservice.Vtctld/PlannedReparentShard",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VtctldServer).PlannedReparentShard(ctx, req.(*vtctldata.PlannedReparentShardRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Vtctld_RemoveKeyspaceCell_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vtctldata.RemoveKeyspaceCellRequest)
if err := dec(in); err != nil {
@ -998,6 +1134,42 @@ func _Vtctld_RemoveShardCell_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _Vtctld_ReparentTablet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vtctldata.ReparentTabletRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VtctldServer).ReparentTablet(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vtctlservice.Vtctld/ReparentTablet",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VtctldServer).ReparentTablet(ctx, req.(*vtctldata.ReparentTabletRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Vtctld_TabletExternallyReparented_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vtctldata.TabletExternallyReparentedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VtctldServer).TabletExternallyReparented(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vtctlservice.Vtctld/TabletExternallyReparented",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VtctldServer).TabletExternallyReparented(ctx, req.(*vtctldata.TabletExternallyReparentedRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Vtctld_serviceDesc = grpc.ServiceDesc{
ServiceName: "vtctlservice.Vtctld",
HandlerType: (*VtctldServer)(nil),
@ -1026,6 +1198,10 @@ var _Vtctld_serviceDesc = grpc.ServiceDesc{
MethodName: "DeleteTablets",
Handler: _Vtctld_DeleteTablets_Handler,
},
{
MethodName: "EmergencyReparentShard",
Handler: _Vtctld_EmergencyReparentShard_Handler,
},
{
MethodName: "FindAllShardsInKeyspace",
Handler: _Vtctld_FindAllShardsInKeyspace_Handler,
@ -1082,6 +1258,10 @@ var _Vtctld_serviceDesc = grpc.ServiceDesc{
MethodName: "InitShardPrimary",
Handler: _Vtctld_InitShardPrimary_Handler,
},
{
MethodName: "PlannedReparentShard",
Handler: _Vtctld_PlannedReparentShard_Handler,
},
{
MethodName: "RemoveKeyspaceCell",
Handler: _Vtctld_RemoveKeyspaceCell_Handler,
@ -1090,6 +1270,14 @@ var _Vtctld_serviceDesc = grpc.ServiceDesc{
MethodName: "RemoveShardCell",
Handler: _Vtctld_RemoveShardCell_Handler,
},
{
MethodName: "ReparentTablet",
Handler: _Vtctld_ReparentTablet_Handler,
},
{
MethodName: "TabletExternallyReparented",
Handler: _Vtctld_TabletExternallyReparented_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "vtctlservice.proto",

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: vtgateservice.proto
package vtgateservice
@ -29,23 +29,24 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("vtgateservice.proto", fileDescriptor_601ae27c95081e0f) }
var fileDescriptor_601ae27c95081e0f = []byte{
// 247 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x3f, 0x4b, 0x03, 0x41,
0x10, 0xc5, 0x15, 0x21, 0x81, 0x25, 0x69, 0x46, 0x51, 0x88, 0x5a, 0x98, 0xd2, 0xe2, 0x56, 0xb4,
0x15, 0x8b, 0x03, 0x2b, 0x1b, 0x89, 0x92, 0x42, 0xb0, 0x58, 0x97, 0xe1, 0x5c, 0xd0, 0x9b, 0x73,
0x67, 0xb2, 0xf8, 0x01, 0xfc, 0xe0, 0xc2, 0xed, 0x9f, 0x70, 0x9e, 0xda, 0xdd, 0xfd, 0xde, 0x9b,
0xb7, 0xc3, 0x3c, 0xb5, 0x1f, 0xa4, 0x31, 0x82, 0x8c, 0x3e, 0x38, 0x8b, 0x55, 0xe7, 0x49, 0x08,
0xe6, 0x03, 0xb8, 0x98, 0xc5, 0xdf, 0x28, 0x5e, 0x7e, 0xed, 0xa9, 0xc9, 0xda, 0x09, 0x32, 0xc3,
0xb5, 0x9a, 0xde, 0x7e, 0xa2, 0xdd, 0x08, 0xc2, 0x61, 0x95, 0x4c, 0x09, 0xac, 0xf0, 0x63, 0x83,
0x2c, 0x8b, 0xa3, 0x11, 0xe7, 0x8e, 0x5a, 0xc6, 0xe5, 0x0e, 0xdc, 0xa9, 0x59, 0x82, 0xb5, 0x11,
0xfb, 0x0a, 0xc7, 0x3f, 0xac, 0x3d, 0xcd, 0x39, 0x27, 0xbf, 0x8b, 0x25, 0xec, 0x5e, 0xcd, 0x1f,
0xc4, 0xa3, 0x79, 0xcf, 0x0b, 0x95, 0x81, 0x01, 0xce, 0x71, 0xa7, 0x7f, 0xa8, 0x39, 0xef, 0x62,
0x17, 0x9e, 0x15, 0xac, 0x90, 0xe9, 0x2d, 0xe0, 0xa3, 0x37, 0x2d, 0x1b, 0x2b, 0x8e, 0x5a, 0x38,
0xcb, 0x83, 0x63, 0x2d, 0x67, 0x2f, 0xff, 0xb3, 0x94, 0x85, 0x6f, 0xd4, 0x74, 0x1d, 0x1f, 0xdf,
0xde, 0x2e, 0x81, 0xd1, 0xed, 0x0a, 0xdf, 0xae, 0x57, 0xd7, 0xea, 0xc0, 0x51, 0x15, 0xfa, 0x22,
0x62, 0x33, 0x55, 0xe3, 0x3b, 0xfb, 0x74, 0x9e, 0x90, 0x23, 0x1d, 0xbf, 0x74, 0x43, 0x3a, 0x88,
0xee, 0x2d, 0x7a, 0x50, 0xec, 0xcb, 0xa4, 0x87, 0x57, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd5,
0x14, 0x87, 0x30, 0x05, 0x02, 0x00, 0x00,
// 265 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0x2b, 0x49, 0x4f,
0x2c, 0x49, 0x2d, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
0xe2, 0x45, 0x11, 0x94, 0xe2, 0x81, 0x70, 0x21, 0x92, 0x46, 0x2d, 0xcc, 0x5c, 0x6c, 0x61, 0x99,
0x25, 0xa9, 0xc5, 0xc5, 0x42, 0x36, 0x5c, 0x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 0x89, 0x3e, 0x4a, 0x44, 0x27, 0xb1, 0x81, 0x05, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff,
0xff, 0xb1, 0x89, 0xe2, 0xfd, 0x15, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

Просмотреть файл

@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: vtrpc.proto
package vtrpc
import (
fmt "fmt"
io "io"
math "math"
math_bits "math/bits"
proto "github.com/golang/protobuf/proto"
)
@ -320,18 +322,26 @@ func (*CallerID) ProtoMessage() {}
func (*CallerID) Descriptor() ([]byte, []int) {
return fileDescriptor_750b4cf641561858, []int{0}
}
func (m *CallerID) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CallerID.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *CallerID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CallerID.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_CallerID.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *CallerID) XXX_Merge(src proto.Message) {
xxx_messageInfo_CallerID.Merge(m, src)
}
func (m *CallerID) XXX_Size() int {
return xxx_messageInfo_CallerID.Size(m)
return m.Size()
}
func (m *CallerID) XXX_DiscardUnknown() {
xxx_messageInfo_CallerID.DiscardUnknown(m)
@ -379,18 +389,26 @@ func (*RPCError) ProtoMessage() {}
func (*RPCError) Descriptor() ([]byte, []int) {
return fileDescriptor_750b4cf641561858, []int{1}
}
func (m *RPCError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RPCError.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *RPCError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RPCError.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_RPCError.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *RPCError) XXX_Merge(src proto.Message) {
xxx_messageInfo_RPCError.Merge(m, src)
}
func (m *RPCError) XXX_Size() int {
return xxx_messageInfo_RPCError.Size(m)
return m.Size()
}
func (m *RPCError) XXX_DiscardUnknown() {
xxx_messageInfo_RPCError.DiscardUnknown(m)
@ -429,43 +447,559 @@ func init() {
func init() { proto.RegisterFile("vtrpc.proto", fileDescriptor_750b4cf641561858) }
var fileDescriptor_750b4cf641561858 = []byte{
// 605 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x93, 0x4d, 0x4f, 0x1b, 0x3b,
0x14, 0x86, 0xc9, 0x07, 0xf9, 0x38, 0x13, 0x88, 0x31, 0x5f, 0xe1, 0x5e, 0xae, 0xee, 0x55, 0x56,
0x57, 0x2c, 0x88, 0xd4, 0xaa, 0xea, 0xda, 0x19, 0x1f, 0x82, 0xc5, 0xe0, 0x49, 0x3d, 0x36, 0x25,
0xdd, 0x58, 0x21, 0x8c, 0x50, 0xaa, 0xc0, 0x44, 0x93, 0x14, 0xa9, 0x9b, 0xfe, 0xac, 0xfe, 0xa6,
0xfe, 0x8c, 0xca, 0x4e, 0xa6, 0x28, 0xb0, 0x9b, 0xf3, 0x3e, 0xc7, 0xc7, 0xef, 0x79, 0x9d, 0x40,
0xf0, 0xbc, 0xcc, 0xe7, 0x93, 0xf3, 0x79, 0x9e, 0x2d, 0x33, 0xba, 0xed, 0x8b, 0xee, 0x57, 0x68,
0x84, 0xe3, 0xd9, 0x2c, 0xcd, 0x05, 0xa7, 0xa7, 0xd0, 0x9c, 0xe7, 0xd3, 0xa7, 0xc9, 0x74, 0x3e,
0x9e, 0x75, 0x4a, 0xff, 0x95, 0xfe, 0x6f, 0xaa, 0x17, 0xc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x09, 0xb9,
0xa0, 0x35, 0xfa, 0x0f, 0x9c, 0xbc, 0x8d, 0xb5, 0xc0, 0x75, 0xfa, 0x37, 0x1c, 0x7f, 0x32, 0xa8,
0x46, 0xd6, 0x3d, 0x65, 0x82, 0xea, 0xe6, 0x05, 0x36, 0x9c, 0x53, 0x27, 0x0b, 0x69, 0xf5, 0x6d,
0xa1, 0x36, 0xe9, 0x09, 0x1c, 0x16, 0x29, 0x6e, 0x5a, 0x01, 0x67, 0x53, 0x2b, 0x26, 0x13, 0x81,
0x52, 0x6f, 0xb2, 0xc0, 0xb1, 0x57, 0x8f, 0x5e, 0xb0, 0x56, 0xff, 0x03, 0xb4, 0xa7, 0xd9, 0xf9,
0xf3, 0x74, 0x99, 0x2e, 0x16, 0xab, 0x7f, 0xea, 0x97, 0xee, 0xba, 0x9a, 0x66, 0xbd, 0xd5, 0x57,
0xef, 0x21, 0xeb, 0x3d, 0x2f, 0x7b, 0x9e, 0xf6, 0xfc, 0xaf, 0xfc, 0xae, 0xe6, 0x8b, 0xf7, 0xbf,
0x03, 0x00, 0x00, 0xff, 0xff, 0x27, 0xae, 0x20, 0x34, 0xe3, 0x03, 0x00, 0x00,
// 628 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x93, 0xcb, 0x4e, 0x1b, 0x3f,
0x14, 0xc6, 0xc9, 0x85, 0x5c, 0x4e, 0x02, 0x31, 0xe6, 0x16, 0xfe, 0x7f, 0x9a, 0x56, 0x59, 0x55,
0x2c, 0x88, 0xd4, 0x2e, 0xba, 0x76, 0xc6, 0x87, 0x60, 0x31, 0x78, 0x52, 0x8f, 0x87, 0x92, 0x6e,
0xac, 0x10, 0x46, 0x28, 0x55, 0x60, 0xa2, 0x49, 0x8a, 0xd4, 0x4d, 0x9f, 0xa3, 0x4f, 0xd2, 0x67,
0xe8, 0xb2, 0x8f, 0x50, 0xd1, 0x4d, 0x1f, 0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f3, 0x03, 0x00, 0x00,
}
func (m *CallerID) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CallerID) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *CallerID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Subcomponent) > 0 {
i -= len(m.Subcomponent)
copy(dAtA[i:], m.Subcomponent)
i = encodeVarintVtrpc(dAtA, i, uint64(len(m.Subcomponent)))
i--
dAtA[i] = 0x1a
}
if len(m.Component) > 0 {
i -= len(m.Component)
copy(dAtA[i:], m.Component)
i = encodeVarintVtrpc(dAtA, i, uint64(len(m.Component)))
i--
dAtA[i] = 0x12
}
if len(m.Principal) > 0 {
i -= len(m.Principal)
copy(dAtA[i:], m.Principal)
i = encodeVarintVtrpc(dAtA, i, uint64(len(m.Principal)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *RPCError) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *RPCError) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *RPCError) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.Code != 0 {
i = encodeVarintVtrpc(dAtA, i, uint64(m.Code))
i--
dAtA[i] = 0x18
}
if len(m.Message) > 0 {
i -= len(m.Message)
copy(dAtA[i:], m.Message)
i = encodeVarintVtrpc(dAtA, i, uint64(len(m.Message)))
i--
dAtA[i] = 0x12
}
if m.LegacyCode != 0 {
i = encodeVarintVtrpc(dAtA, i, uint64(m.LegacyCode))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintVtrpc(dAtA []byte, offset int, v uint64) int {
offset -= sovVtrpc(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *CallerID) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Principal)
if l > 0 {
n += 1 + l + sovVtrpc(uint64(l))
}
l = len(m.Component)
if l > 0 {
n += 1 + l + sovVtrpc(uint64(l))
}
l = len(m.Subcomponent)
if l > 0 {
n += 1 + l + sovVtrpc(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *RPCError) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.LegacyCode != 0 {
n += 1 + sovVtrpc(uint64(m.LegacyCode))
}
l = len(m.Message)
if l > 0 {
n += 1 + l + sovVtrpc(uint64(l))
}
if m.Code != 0 {
n += 1 + sovVtrpc(uint64(m.Code))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovVtrpc(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozVtrpc(x uint64) (n int) {
return sovVtrpc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *CallerID) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: CallerID: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: CallerID: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthVtrpc
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthVtrpc
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Principal = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Component", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthVtrpc
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthVtrpc
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Component = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Subcomponent", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthVtrpc
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthVtrpc
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Subcomponent = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipVtrpc(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVtrpc
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVtrpc
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *RPCError) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: RPCError: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: RPCError: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field LegacyCode", wireType)
}
m.LegacyCode = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.LegacyCode |= LegacyErrorCode(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthVtrpc
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthVtrpc
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Message = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
}
m.Code = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtrpc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Code |= Code(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipVtrpc(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVtrpc
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVtrpc
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipVtrpc(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVtrpc
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVtrpc
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVtrpc
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthVtrpc
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupVtrpc
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthVtrpc
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthVtrpc = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowVtrpc = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupVtrpc = fmt.Errorf("proto: unexpected end of group")
)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: vttime.proto
package vttime
import (
fmt "fmt"
io "io"
math "math"
math_bits "math/bits"
proto "github.com/golang/protobuf/proto"
)
@ -37,18 +39,26 @@ func (*Time) ProtoMessage() {}
func (*Time) Descriptor() ([]byte, []int) {
return fileDescriptor_bbeb0d3434911dee, []int{0}
}
func (m *Time) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Time.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *Time) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Time.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_Time.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Time) XXX_Merge(src proto.Message) {
xxx_messageInfo_Time.Merge(m, src)
}
func (m *Time) XXX_Size() int {
return xxx_messageInfo_Time.Size(m)
return m.Size()
}
func (m *Time) XXX_DiscardUnknown() {
xxx_messageInfo_Time.DiscardUnknown(m)
@ -70,20 +80,475 @@ func (m *Time) GetNanoseconds() int32 {
return 0
}
type Duration struct {
Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Duration) Reset() { *m = Duration{} }
func (m *Duration) String() string { return proto.CompactTextString(m) }
func (*Duration) ProtoMessage() {}
func (*Duration) Descriptor() ([]byte, []int) {
return fileDescriptor_bbeb0d3434911dee, []int{1}
}
func (m *Duration) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Duration) XXX_Merge(src proto.Message) {
xxx_messageInfo_Duration.Merge(m, src)
}
func (m *Duration) XXX_Size() int {
return m.Size()
}
func (m *Duration) XXX_DiscardUnknown() {
xxx_messageInfo_Duration.DiscardUnknown(m)
}
var xxx_messageInfo_Duration proto.InternalMessageInfo
func (m *Duration) GetSeconds() int64 {
if m != nil {
return m.Seconds
}
return 0
}
func (m *Duration) GetNanos() int32 {
if m != nil {
return m.Nanos
}
return 0
}
func init() {
proto.RegisterType((*Time)(nil), "vttime.Time")
proto.RegisterType((*Duration)(nil), "vttime.Duration")
}
func init() { proto.RegisterFile("vttime.proto", fileDescriptor_bbeb0d3434911dee) }
var fileDescriptor_bbeb0d3434911dee = []byte{
// 120 bytes of a gzipped FileDescriptorProto
// 161 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x2b, 0x29, 0xc9,
0xcc, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0x9c, 0xb8, 0x58,
0x42, 0x32, 0x73, 0x53, 0x85, 0x24, 0xb8, 0xd8, 0x8b, 0x53, 0x93, 0xf3, 0xf3, 0x52, 0x8a, 0x25,
0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0x60, 0x5c, 0x21, 0x05, 0x2e, 0xee, 0xbc, 0xc4, 0xbc, 0x7c,
0x98, 0x2c, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0xb2, 0x90, 0x93, 0x6a, 0x94, 0x72, 0x59, 0x66,
0x49, 0x6a, 0x71, 0xb1, 0x5e, 0x66, 0xbe, 0x3e, 0x84, 0xa5, 0x9f, 0x9e, 0xaf, 0x5f, 0x56, 0xa2,
0x0f, 0xb6, 0x4b, 0x1f, 0x62, 0x55, 0x12, 0x1b, 0x98, 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff,
0x35, 0x46, 0xf4, 0x16, 0x89, 0x00, 0x00, 0x00,
0x98, 0x2c, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0xb2, 0x90, 0x92, 0x15, 0x17, 0x87, 0x4b, 0x69,
0x51, 0x62, 0x49, 0x66, 0x7e, 0x1e, 0x1e, 0x73, 0x44, 0xb8, 0x58, 0xc1, 0x9a, 0xa0, 0x26, 0x40,
0x38, 0x4e, 0xa6, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3,
0x8c, 0xc7, 0x72, 0x0c, 0x51, 0xca, 0x65, 0x99, 0x25, 0xa9, 0xc5, 0xc5, 0x7a, 0x99, 0xf9, 0xfa,
0x10, 0x96, 0x7e, 0x7a, 0xbe, 0x7e, 0x59, 0x89, 0x3e, 0xd8, 0xdd, 0xfa, 0x10, 0x67, 0x27, 0xb1,
0x81, 0x79, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0xe1, 0xff, 0xf9, 0xd5, 0x00, 0x00,
0x00,
}
func (m *Time) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Time) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Time) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.Nanoseconds != 0 {
i = encodeVarintVttime(dAtA, i, uint64(m.Nanoseconds))
i--
dAtA[i] = 0x10
}
if m.Seconds != 0 {
i = encodeVarintVttime(dAtA, i, uint64(m.Seconds))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *Duration) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Duration) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.Nanos != 0 {
i = encodeVarintVttime(dAtA, i, uint64(m.Nanos))
i--
dAtA[i] = 0x10
}
if m.Seconds != 0 {
i = encodeVarintVttime(dAtA, i, uint64(m.Seconds))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintVttime(dAtA []byte, offset int, v uint64) int {
offset -= sovVttime(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Time) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Seconds != 0 {
n += 1 + sovVttime(uint64(m.Seconds))
}
if m.Nanoseconds != 0 {
n += 1 + sovVttime(uint64(m.Nanoseconds))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Duration) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Seconds != 0 {
n += 1 + sovVttime(uint64(m.Seconds))
}
if m.Nanos != 0 {
n += 1 + sovVttime(uint64(m.Nanos))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovVttime(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozVttime(x uint64) (n int) {
return sovVttime(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Time) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVttime
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Time: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Time: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType)
}
m.Seconds = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVttime
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Seconds |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Nanoseconds", wireType)
}
m.Nanoseconds = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVttime
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Nanoseconds |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipVttime(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVttime
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVttime
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Duration) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVttime
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Duration: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType)
}
m.Seconds = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVttime
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Seconds |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType)
}
m.Nanos = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVttime
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Nanos |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipVttime(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVttime
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVttime
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipVttime(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVttime
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVttime
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVttime
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthVttime
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupVttime
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthVttime
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthVttime = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowVttime = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupVttime = fmt.Errorf("proto: unexpected end of group")
)

Просмотреть файл

@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: vtworkerdata.proto
package vtworkerdata
import (
fmt "fmt"
io "io"
math "math"
math_bits "math/bits"
proto "github.com/golang/protobuf/proto"
logutil "vitess.io/vitess/go/vt/proto/logutil"
@ -36,18 +38,26 @@ func (*ExecuteVtworkerCommandRequest) ProtoMessage() {}
func (*ExecuteVtworkerCommandRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_32a791ab99179e8e, []int{0}
}
func (m *ExecuteVtworkerCommandRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ExecuteVtworkerCommandRequest.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *ExecuteVtworkerCommandRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ExecuteVtworkerCommandRequest.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_ExecuteVtworkerCommandRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ExecuteVtworkerCommandRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExecuteVtworkerCommandRequest.Merge(m, src)
}
func (m *ExecuteVtworkerCommandRequest) XXX_Size() int {
return xxx_messageInfo_ExecuteVtworkerCommandRequest.Size(m)
return m.Size()
}
func (m *ExecuteVtworkerCommandRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ExecuteVtworkerCommandRequest.DiscardUnknown(m)
@ -76,18 +86,26 @@ func (*ExecuteVtworkerCommandResponse) ProtoMessage() {}
func (*ExecuteVtworkerCommandResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_32a791ab99179e8e, []int{1}
}
func (m *ExecuteVtworkerCommandResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ExecuteVtworkerCommandResponse.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *ExecuteVtworkerCommandResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ExecuteVtworkerCommandResponse.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_ExecuteVtworkerCommandResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ExecuteVtworkerCommandResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExecuteVtworkerCommandResponse.Merge(m, src)
}
func (m *ExecuteVtworkerCommandResponse) XXX_Size() int {
return xxx_messageInfo_ExecuteVtworkerCommandResponse.Size(m)
return m.Size()
}
func (m *ExecuteVtworkerCommandResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ExecuteVtworkerCommandResponse.DiscardUnknown(m)
@ -110,7 +128,7 @@ func init() {
func init() { proto.RegisterFile("vtworkerdata.proto", fileDescriptor_32a791ab99179e8e) }
var fileDescriptor_32a791ab99179e8e = []byte{
// 175 bytes of a gzipped FileDescriptorProto
// 192 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x2b, 0x29, 0xcf,
0x2f, 0xca, 0x4e, 0x2d, 0x4a, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2,
0x41, 0x16, 0x93, 0xe2, 0xcd, 0xc9, 0x4f, 0x2f, 0x2d, 0xc9, 0xcc, 0x81, 0x48, 0x2a, 0x19, 0x73,
@ -119,7 +137,395 @@ var fileDescriptor_32a791ab99179e8e = []byte{
0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x81, 0xd9, 0x4a, 0x6e, 0x5c, 0x72, 0xb8, 0x34,
0x15, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0xa9, 0x70, 0xb1, 0xa6, 0x96, 0xa5, 0xe6, 0x95, 0x48,
0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0xf1, 0xe9, 0xc1, 0x6c, 0x75, 0x05, 0x89, 0x06, 0x41, 0x24,
0x9d, 0xb4, 0xa3, 0x34, 0xcb, 0x32, 0x4b, 0x52, 0x8b, 0x8b, 0xf5, 0x32, 0xf3, 0xf5, 0x21, 0x2c,
0xfd, 0xf4, 0x7c, 0xfd, 0xb2, 0x12, 0x7d, 0xb0, 0xe3, 0xf4, 0x91, 0x1d, 0x9e, 0xc4, 0x06, 0x16,
0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x82, 0xc8, 0x11, 0xe3, 0x00, 0x00, 0x00,
0x9d, 0xac, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x19,
0x8f, 0xe5, 0x18, 0xa2, 0x34, 0xcb, 0x32, 0x4b, 0x52, 0x8b, 0x8b, 0xf5, 0x32, 0xf3, 0xf5, 0x21,
0x2c, 0xfd, 0xf4, 0x7c, 0xfd, 0xb2, 0x12, 0x7d, 0xb0, 0x63, 0xf5, 0x91, 0x3d, 0x92, 0xc4, 0x06,
0x16, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x38, 0xbf, 0x62, 0x49, 0xf3, 0x00, 0x00, 0x00,
}
func (m *ExecuteVtworkerCommandRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ExecuteVtworkerCommandRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ExecuteVtworkerCommandRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Args) > 0 {
for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Args[iNdEx])
copy(dAtA[i:], m.Args[iNdEx])
i = encodeVarintVtworkerdata(dAtA, i, uint64(len(m.Args[iNdEx])))
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *ExecuteVtworkerCommandResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ExecuteVtworkerCommandResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ExecuteVtworkerCommandResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.Event != nil {
{
size, err := m.Event.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintVtworkerdata(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintVtworkerdata(dAtA []byte, offset int, v uint64) int {
offset -= sovVtworkerdata(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *ExecuteVtworkerCommandRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Args) > 0 {
for _, s := range m.Args {
l = len(s)
n += 1 + l + sovVtworkerdata(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *ExecuteVtworkerCommandResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Event != nil {
l = m.Event.Size()
n += 1 + l + sovVtworkerdata(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovVtworkerdata(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozVtworkerdata(x uint64) (n int) {
return sovVtworkerdata(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ExecuteVtworkerCommandRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtworkerdata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExecuteVtworkerCommandRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExecuteVtworkerCommandRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtworkerdata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthVtworkerdata
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthVtworkerdata
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Args = append(m.Args, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipVtworkerdata(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVtworkerdata
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVtworkerdata
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ExecuteVtworkerCommandResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtworkerdata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExecuteVtworkerCommandResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExecuteVtworkerCommandResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVtworkerdata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthVtworkerdata
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthVtworkerdata
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Event == nil {
m.Event = &logutil.Event{}
}
if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipVtworkerdata(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVtworkerdata
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVtworkerdata
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipVtworkerdata(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVtworkerdata
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVtworkerdata
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVtworkerdata
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthVtworkerdata
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupVtworkerdata
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthVtworkerdata
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthVtworkerdata = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowVtworkerdata = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupVtworkerdata = fmt.Errorf("proto: unexpected end of group")
)

Просмотреть файл

@ -1,4 +1,4 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: vtworkerservice.proto
package vtworkerservice
@ -29,17 +29,18 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("vtworkerservice.proto", fileDescriptor_884fe2c3e67151b3) }
var fileDescriptor_884fe2c3e67151b3 = []byte{
// 151 bytes of a gzipped FileDescriptorProto
// 168 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x2b, 0x29, 0xcf,
0x2f, 0xca, 0x4e, 0x2d, 0x2a, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0xe2, 0x47, 0x13, 0x96, 0x12, 0x82, 0x09, 0xa4, 0x24, 0x96, 0x24, 0x42, 0x14, 0x19,
0x35, 0x33, 0x72, 0x71, 0x84, 0x41, 0x85, 0x85, 0xca, 0xb9, 0xc4, 0x5c, 0x2b, 0x52, 0x93, 0x4b,
0x4b, 0x52, 0x61, 0x42, 0xce, 0xf9, 0xb9, 0xb9, 0x89, 0x79, 0x29, 0x42, 0xda, 0x7a, 0x28, 0x7a,
0xb1, 0xab, 0x0a, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x91, 0xd2, 0x21, 0x4e, 0x71, 0x71, 0x41,
0x7e, 0x5e, 0x71, 0xaa, 0x12, 0x83, 0x01, 0xa3, 0x93, 0x5e, 0x94, 0x4e, 0x59, 0x66, 0x49, 0x6a,
0x71, 0xb1, 0x5e, 0x66, 0xbe, 0x3e, 0x84, 0xa5, 0x9f, 0x9e, 0xaf, 0x5f, 0x56, 0xa2, 0x0f, 0x76,
0xa5, 0x3e, 0x9a, 0x4f, 0x92, 0xd8, 0xc0, 0xc2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c,
0x01, 0x4d, 0x17, 0xfa, 0x00, 0x00, 0x00,
0x7e, 0x5e, 0x71, 0xaa, 0x12, 0x83, 0x01, 0xa3, 0x93, 0xdd, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e,
0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x4e, 0x59, 0x66, 0x49,
0x6a, 0x71, 0xb1, 0x5e, 0x66, 0xbe, 0x3e, 0x84, 0xa5, 0x9f, 0x9e, 0xaf, 0x5f, 0x56, 0xa2, 0x0f,
0x76, 0xb5, 0x3e, 0x9a, 0xcf, 0x92, 0xd8, 0xc0, 0xc2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff,
0x6a, 0x5d, 0x63, 0x01, 0x0a, 0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -130,11 +130,17 @@ func CachePlan(stmt Statement) bool {
return false
}
//IsSetStatement takes Statement and returns if the statement is set statement.
func IsSetStatement(stmt Statement) bool {
switch stmt.(type) {
//MustRewriteAST takes Statement and returns true if RewriteAST must run on it for correct execution irrespective of user flags.
func MustRewriteAST(stmt Statement) bool {
switch node := stmt.(type) {
case *Set:
return true
case *Show:
switch node.Internal.(type) {
case *ShowBasic:
return true
}
return false
}
return false
}

Просмотреть файл

@ -178,6 +178,13 @@ func (er *expressionRewriter) rewrite(cursor *Cursor) bool {
node.Expr = aliasTableName
cursor.Replace(node)
}
case *ShowBasic:
if node.Command == VariableGlobal || node.Command == VariableSession {
varsToAdd := sysvars.GetInterestingVariables()
for _, sysVar := range varsToAdd {
er.bindVars.AddSysVar(sysVar)
}
}
}
return true
}

Просмотреть файл

@ -181,6 +181,40 @@ func TestRewrites(in *testing.T) {
in: "CALL proc(@foo)",
expected: "CALL proc(:__vtudvfoo)",
udv: 1,
}, {
in: "SHOW VARIABLES",
expected: "SHOW VARIABLES",
autocommit: true,
clientFoundRows: true,
skipQueryPlanCache: true,
sqlSelectLimit: true,
transactionMode: true,
workload: true,
version: true,
versionComment: true,
ddlStrategy: true,
sessionUUID: true,
sessionEnableSystemSettings: true,
rawGTID: true,
rawTimeout: true,
sessTrackGTID: true,
}, {
in: "SHOW GLOBAL VARIABLES",
expected: "SHOW GLOBAL VARIABLES",
autocommit: true,
clientFoundRows: true,
skipQueryPlanCache: true,
sqlSelectLimit: true,
transactionMode: true,
workload: true,
version: true,
versionComment: true,
ddlStrategy: true,
sessionUUID: true,
sessionEnableSystemSettings: true,
rawGTID: true,
rawTimeout: true,
sessTrackGTID: true,
}}
for _, tc := range tests {

Просмотреть файл

@ -238,3 +238,16 @@ var (
{Name: "version_tokens_session"},
}
)
// GetInterestingVariables is used to return all the variables that may be listed in a SHOW VARIABLES command.
func GetInterestingVariables() []string {
var res []string
// Add all the vitess aware variables
for _, variable := range VitessAware {
res = append(res, variable.Name)
}
// Also add version and version comment
res = append(res, Version.Name)
res = append(res, VersionComment.Name)
return res
}

Просмотреть файл

@ -134,6 +134,18 @@ func (tal TabletAliasList) Swap(i, j int) {
tal[i], tal[j] = tal[j], tal[i]
}
// ToStringSlice returns a slice which is the result of mapping
// TabletAliasString over a slice of TabletAliases.
func (tal TabletAliasList) ToStringSlice() []string {
result := make([]string, len(tal))
for i, alias := range tal {
result[i] = TabletAliasString(alias)
}
return result
}
// AllTabletTypes lists all the possible tablet types
var AllTabletTypes = []topodatapb.TabletType{
topodatapb.TabletType_MASTER,

Просмотреть файл

@ -31,6 +31,7 @@ import (
"vitess.io/vitess/go/vt/concurrency"
"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/vtadmin/cluster"
"vitess.io/vitess/go/vt/vtadmin/errors"
"vitess.io/vitess/go/vt/vtadmin/grpcserver"
vtadminhttp "vitess.io/vitess/go/vt/vtadmin/http"
vthandlers "vitess.io/vitess/go/vt/vtadmin/http/handlers"
@ -302,7 +303,7 @@ func (api *API) GetSchemas(ctx context.Context, req *vtadminpb.GetSchemasRequest
// Since tablets are per-cluster, we can fetch them once
// and use them throughout the other waitgroups.
tablets, err := api.getTablets(ctx, c)
tablets, err := c.GetTablets(ctx)
if err != nil {
er.RecordError(err)
return
@ -449,7 +450,7 @@ func (api *API) GetTablet(ctx context.Context, req *vtadminpb.GetTabletRequest)
go func(c *cluster.Cluster) {
defer wg.Done()
ts, err := api.getTablets(ctx, c)
ts, err := c.GetTablets(ctx)
if err != nil {
er.RecordError(err)
return
@ -477,12 +478,12 @@ func (api *API) GetTablet(ctx context.Context, req *vtadminpb.GetTabletRequest)
switch len(tablets) {
case 0:
return nil, vterrors.Errorf(vtrpcpb.Code_NOT_FOUND, "%s: %s, searched clusters = %v", ErrNoTablet, req.Hostname, ids)
return nil, vterrors.Errorf(vtrpcpb.Code_NOT_FOUND, "%s: %s, searched clusters = %v", errors.ErrNoTablet, req.Hostname, ids)
case 1:
return tablets[0], nil
}
return nil, vterrors.Errorf(vtrpcpb.Code_NOT_FOUND, "%s: %s, searched clusters = %v", ErrAmbiguousTablet, req.Hostname, ids)
return nil, vterrors.Errorf(vtrpcpb.Code_NOT_FOUND, "%s: %s, searched clusters = %v", errors.ErrAmbiguousTablet, req.Hostname, ids)
}
// GetTablets is part of the vtadminpb.VTAdminServer interface.
@ -505,7 +506,7 @@ func (api *API) GetTablets(ctx context.Context, req *vtadminpb.GetTabletsRequest
go func(c *cluster.Cluster) {
defer wg.Done()
ts, err := api.getTablets(ctx, c)
ts, err := c.GetTablets(ctx)
if err != nil {
er.RecordError(err)
return
@ -528,60 +529,6 @@ func (api *API) GetTablets(ctx context.Context, req *vtadminpb.GetTabletsRequest
}, nil
}
func (api *API) getTablets(ctx context.Context, c *cluster.Cluster) ([]*vtadminpb.Tablet, error) {
if err := c.DB.Dial(ctx, ""); err != nil {
return nil, err
}
rows, err := c.DB.ShowTablets(ctx)
if err != nil {
return nil, err
}
return ParseTablets(rows, c)
}
// findTablet returns the first tablet in a given cluster that satisfies the filter function.
func (api *API) findTablet(ctx context.Context, cluster *cluster.Cluster, filter func(*vtadminpb.Tablet) bool) (*vtadminpb.Tablet, error) {
tablets, err := api.findTablets(ctx, cluster, filter, 1)
if err != nil {
return nil, err
}
if len(tablets) != 1 {
return nil, ErrNoTablet
}
return tablets[0], nil
}
// findTablets returns the first N tablets in the given cluster that satisfy
// the filter function. If N = -1, then all matching tablets are returned.
// Ordering is not guaranteed, and callers should write their filter functions accordingly.
func (api *API) findTablets(ctx context.Context, cluster *cluster.Cluster, filter func(*vtadminpb.Tablet) bool, n int) ([]*vtadminpb.Tablet, error) {
tablets, err := api.getTablets(ctx, cluster)
if err != nil {
return nil, err
}
if n == -1 {
n = len(tablets)
}
results := make([]*vtadminpb.Tablet, 0, n)
for _, t := range tablets {
if len(results) >= n {
break
}
if filter(t) {
results = append(results, t)
}
}
return results, nil
}
func (api *API) getClustersForRequest(ids []string) ([]*cluster.Cluster, []string) {
if len(ids) == 0 {
clusterIDs := make([]string, 0, len(api.clusters))
@ -610,23 +557,23 @@ func (api *API) VTExplain(ctx context.Context, req *vtadminpb.VTExplainRequest)
defer span.Finish()
if req.Cluster == "" {
return nil, fmt.Errorf("%w: cluster ID is required", ErrInvalidRequest)
return nil, fmt.Errorf("%w: cluster ID is required", errors.ErrInvalidRequest)
}
if req.Keyspace == "" {
return nil, fmt.Errorf("%w: keyspace name is required", ErrInvalidRequest)
return nil, fmt.Errorf("%w: keyspace name is required", errors.ErrInvalidRequest)
}
if req.Sql == "" {
return nil, fmt.Errorf("%w: SQL query is required", ErrInvalidRequest)
return nil, fmt.Errorf("%w: SQL query is required", errors.ErrInvalidRequest)
}
c, ok := api.clusterMap[req.Cluster]
if !ok {
return nil, ErrUnsupportedCluster
return nil, errors.ErrUnsupportedCluster
}
tablet, err := api.findTablet(ctx, c, func(t *vtadminpb.Tablet) bool {
tablet, err := c.FindTablet(ctx, func(t *vtadminpb.Tablet) bool {
return t.Tablet.Keyspace == req.Keyspace && topo.IsInServingGraph(t.Tablet.Type) && t.Tablet.Type != topodatapb.TabletType_MASTER && t.State == vtadminpb.Tablet_SERVING
})
@ -690,7 +637,7 @@ func (api *API) VTExplain(ctx context.Context, req *vtadminpb.VTExplainRequest)
ksvs, ok := res.SrvVSchema.Keyspaces[req.Keyspace]
if !ok {
er.RecordError(fmt.Errorf("%w: keyspace %s", ErrNoSrvVSchema, req.Keyspace))
er.RecordError(fmt.Errorf("%w: keyspace %s", errors.ErrNoSrvVSchema, req.Keyspace))
return
}

Просмотреть файл

@ -18,28 +18,21 @@ package vtadmin
import (
"context"
"database/sql"
"errors"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"vitess.io/vitess/go/vt/grpcclient"
"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/topo/memorytopo"
"vitess.io/vitess/go/vt/topo/topoproto"
"vitess.io/vitess/go/vt/vitessdriver"
"vitess.io/vitess/go/vt/vtadmin/cluster"
"vitess.io/vitess/go/vt/vtadmin/cluster/discovery/fakediscovery"
vtadminerrors "vitess.io/vitess/go/vt/vtadmin/errors"
"vitess.io/vitess/go/vt/vtadmin/grpcserver"
"vitess.io/vitess/go/vt/vtadmin/http"
vtadmintestutil "vitess.io/vitess/go/vt/vtadmin/testutil"
vtadminvtctldclient "vitess.io/vitess/go/vt/vtadmin/vtctldclient"
"vitess.io/vitess/go/vt/vtadmin/vtsql"
"vitess.io/vitess/go/vt/vtadmin/vtsql/fakevtsql"
"vitess.io/vitess/go/vt/vtctl/grpcvtctldserver"
"vitess.io/vitess/go/vt/vtctl/grpcvtctldserver/testutil"
"vitess.io/vitess/go/vt/vtctl/vtctldclient"
@ -397,8 +390,8 @@ func TestGetKeyspaces(t *testing.T) {
clusterClients := []vtctldclient.VtctldClient{cluster0Client, cluster1Client}
clusters := []*cluster.Cluster{
buildCluster(0, clusterClients[0], nil, nil),
buildCluster(1, clusterClients[1], nil, nil),
vtadmintestutil.BuildCluster(0, clusterClients[0], nil, nil),
vtadmintestutil.BuildCluster(1, clusterClients[1], nil, nil),
}
api := NewAPI(clusters, grpcserver.Options{}, http.Options{})
@ -899,7 +892,7 @@ func TestGetSchemas(t *testing.T) {
}
}
clusters[cdx] = buildCluster(cdx, clusterClients[cdx], cts, nil)
clusters[cdx] = vtadmintestutil.BuildCluster(cdx, clusterClients[cdx], cts, nil)
}
api := NewAPI(clusters, grpcserver.Options{}, http.Options{})
@ -918,7 +911,7 @@ func TestGetTablets(t *testing.T) {
tests := []struct {
name string
clusterTablets [][]*vtadminpb.Tablet
dbconfigs map[string]*dbcfg
dbconfigs map[string]*vtadmintestutil.Dbcfg
req *vtadminpb.GetTabletsRequest
expected []*vtadminpb.Tablet
shouldErr bool
@ -943,7 +936,7 @@ func TestGetTablets(t *testing.T) {
},
},
},
dbconfigs: map[string]*dbcfg{},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{},
req: &vtadminpb.GetTabletsRequest{},
expected: []*vtadminpb.Tablet{
{
@ -1002,8 +995,8 @@ func TestGetTablets(t *testing.T) {
},
},
},
dbconfigs: map[string]*dbcfg{
"c1": {shouldErr: true},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{
"c1": {ShouldErr: true},
},
req: &vtadminpb.GetTabletsRequest{},
expected: nil,
@ -1045,7 +1038,7 @@ func TestGetTablets(t *testing.T) {
},
},
},
dbconfigs: map[string]*dbcfg{},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{},
req: &vtadminpb.GetTabletsRequest{ClusterIds: []string{"c0"}},
expected: []*vtadminpb.Tablet{
{
@ -1075,7 +1068,7 @@ func TestGetTablets(t *testing.T) {
clusters := make([]*cluster.Cluster, len(tt.clusterTablets))
for i, tablets := range tt.clusterTablets {
cluster := buildCluster(i, nil, tablets, tt.dbconfigs)
cluster := vtadmintestutil.BuildCluster(i, nil, tablets, tt.dbconfigs)
clusters[i] = cluster
}
@ -1092,35 +1085,11 @@ func TestGetTablets(t *testing.T) {
}
}
// This test only validates the error handling on dialing database connections.
// Other cases are covered by one or both of TestGetTablets and TestGetTablet.
func Test_getTablets(t *testing.T) {
api := &API{}
disco := fakediscovery.New()
disco.AddTaggedGates(nil, &vtadminpb.VTGate{Hostname: "gate"})
db := vtsql.New(&vtsql.Config{
Cluster: &vtadminpb.Cluster{
Id: "c1",
Name: "one",
},
Discovery: disco,
})
db.DialFunc = func(cfg vitessdriver.Configuration) (*sql.DB, error) {
return nil, assert.AnError
}
_, err := api.getTablets(context.Background(), &cluster.Cluster{
DB: db,
})
assert.Error(t, err)
}
func TestGetTablet(t *testing.T) {
tests := []struct {
name string
clusterTablets [][]*vtadminpb.Tablet
dbconfigs map[string]*dbcfg
dbconfigs map[string]*vtadmintestutil.Dbcfg
req *vtadminpb.GetTabletRequest
expected *vtadminpb.Tablet
shouldErr bool
@ -1145,7 +1114,7 @@ func TestGetTablet(t *testing.T) {
},
},
},
dbconfigs: map[string]*dbcfg{},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{},
req: &vtadminpb.GetTabletRequest{
Hostname: "ks1-00-00-zone1-a",
},
@ -1204,8 +1173,8 @@ func TestGetTablet(t *testing.T) {
},
},
},
dbconfigs: map[string]*dbcfg{
"c1": {shouldErr: true},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{
"c1": {ShouldErr: true},
},
req: &vtadminpb.GetTabletRequest{
Hostname: "doesn't matter",
@ -1249,7 +1218,7 @@ func TestGetTablet(t *testing.T) {
},
},
},
dbconfigs: map[string]*dbcfg{},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{},
req: &vtadminpb.GetTabletRequest{
Hostname: "ks1-00-00-zone1-a",
ClusterIds: []string{"c0"},
@ -1309,7 +1278,7 @@ func TestGetTablet(t *testing.T) {
},
},
},
dbconfigs: map[string]*dbcfg{},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{},
req: &vtadminpb.GetTabletRequest{
Hostname: "ks1-00-00-zone1-a",
},
@ -1322,7 +1291,7 @@ func TestGetTablet(t *testing.T) {
/* cluster 0 */
{},
},
dbconfigs: map[string]*dbcfg{},
dbconfigs: map[string]*vtadmintestutil.Dbcfg{},
req: &vtadminpb.GetTabletRequest{
Hostname: "ks1-00-00-zone1-a",
},
@ -1336,7 +1305,7 @@ func TestGetTablet(t *testing.T) {
clusters := make([]*cluster.Cluster, len(tt.clusterTablets))
for i, tablets := range tt.clusterTablets {
cluster := buildCluster(i, nil, tablets, tt.dbconfigs)
cluster := vtadmintestutil.BuildCluster(i, nil, tablets, tt.dbconfigs)
clusters[i] = cluster
}
@ -1543,7 +1512,7 @@ func TestVTExplain(t *testing.T) {
Keyspace: "commerce",
Sql: "select * from customers",
},
expectedError: ErrNoTablet,
expectedError: vtadminerrors.ErrNoTablet,
},
{
name: "returns an error if cluster unspecified in request",
@ -1551,7 +1520,7 @@ func TestVTExplain(t *testing.T) {
Keyspace: "commerce",
Sql: "select * from customers",
},
expectedError: ErrInvalidRequest,
expectedError: vtadminerrors.ErrInvalidRequest,
},
{
name: "returns an error if keyspace unspecified in request",
@ -1559,7 +1528,7 @@ func TestVTExplain(t *testing.T) {
Cluster: "c0",
Sql: "select * from customers",
},
expectedError: ErrInvalidRequest,
expectedError: vtadminerrors.ErrInvalidRequest,
},
{
name: "returns an error if SQL unspecified in request",
@ -1567,7 +1536,7 @@ func TestVTExplain(t *testing.T) {
Cluster: "c0",
Keyspace: "commerce",
},
expectedError: ErrInvalidRequest,
expectedError: vtadminerrors.ErrInvalidRequest,
},
}
@ -1587,8 +1556,10 @@ func TestVTExplain(t *testing.T) {
})
testutil.WithTestServer(t, vtctldserver, func(t *testing.T, vtctldClient vtctldclient.VtctldClient) {
toposerver.UpdateSrvVSchema(context.Background(), "c0_cell1", tt.srvVSchema)
if tt.srvVSchema != nil {
err := toposerver.UpdateSrvVSchema(context.Background(), "c0_cell1", tt.srvVSchema)
require.NoError(t, err)
}
testutil.AddKeyspaces(context.Background(), t, toposerver, tt.keyspaces...)
testutil.AddShards(context.Background(), t, toposerver, tt.shards...)
@ -1609,7 +1580,7 @@ func TestVTExplain(t *testing.T) {
}
}
c := buildCluster(0, vtctldClient, tt.tablets, nil)
c := vtadmintestutil.BuildCluster(0, vtctldClient, tt.tablets, nil)
clusters := []*cluster.Cluster{c}
api := NewAPI(clusters, grpcserver.Options{}, http.Options{})
@ -1629,51 +1600,6 @@ func TestVTExplain(t *testing.T) {
}
}
type dbcfg struct {
shouldErr bool
}
// shared helper for building a cluster that contains the given tablets and
// talking to the given vtctld server. dbconfigs contains an optional config
// for controlling the behavior of the cluster's DB at the package sql level.
func buildCluster(i int, vtctldClient vtctldclient.VtctldClient, tablets []*vtadminpb.Tablet, dbconfigs map[string]*dbcfg) *cluster.Cluster {
disco := fakediscovery.New()
disco.AddTaggedGates(nil, &vtadminpb.VTGate{Hostname: fmt.Sprintf("cluster%d-gate", i)})
disco.AddTaggedVtctlds(nil, &vtadminpb.Vtctld{Hostname: "doesn't matter"})
cluster := &cluster.Cluster{
ID: fmt.Sprintf("c%d", i),
Name: fmt.Sprintf("cluster%d", i),
Discovery: disco,
}
dbconfig, ok := dbconfigs[cluster.ID]
if !ok {
dbconfig = &dbcfg{shouldErr: false}
}
db := vtsql.New(&vtsql.Config{
Cluster: cluster.ToProto(),
Discovery: disco,
})
db.DialFunc = func(cfg vitessdriver.Configuration) (*sql.DB, error) {
return sql.OpenDB(&fakevtsql.Connector{Tablets: tablets, ShouldErr: dbconfig.shouldErr}), nil
}
vtctld := vtadminvtctldclient.New(&vtadminvtctldclient.Config{
Cluster: cluster.ToProto(),
Discovery: disco,
})
vtctld.DialFunc = func(addr string, ff grpcclient.FailFast, opts ...grpc.DialOption) (vtctldclient.VtctldClient, error) {
return vtctldClient, nil
}
cluster.DB = db
cluster.Vtctld = vtctld
return cluster
}
func init() {
// For tests that don't actually care about mocking the tmclient (i.e. they
// call grpcvtctldserver.NewVtctldServer to initialize the unit under test),

Просмотреть файл

@ -17,12 +17,21 @@ limitations under the License.
package cluster
import (
"context"
"database/sql"
"fmt"
"time"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/topo/topoproto"
"vitess.io/vitess/go/vt/vtadmin/cluster/discovery"
"vitess.io/vitess/go/vt/vtadmin/errors"
"vitess.io/vitess/go/vt/vtadmin/vtadminproto"
"vitess.io/vitess/go/vt/vtadmin/vtctldclient"
"vitess.io/vitess/go/vt/vtadmin/vtsql"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtadminpb "vitess.io/vitess/go/vt/proto/vtadmin"
)
@ -98,3 +107,147 @@ func buildPFlagSlice(flags map[string]string) []string {
return args
}
// parseTablets converts a set of *sql.Rows into a slice of Tablets, for the
// given cluster.
func (c *Cluster) parseTablets(rows *sql.Rows) ([]*vtadminpb.Tablet, error) {
var tablets []*vtadminpb.Tablet
for rows.Next() {
if err := rows.Err(); err != nil {
return nil, err
}
tablet, err := c.parseTablet(rows)
if err != nil {
return nil, err
}
tablets = append(tablets, tablet)
}
if err := rows.Err(); err != nil {
return nil, err
}
return tablets, nil
}
// Fields are:
// Cell | Keyspace | Shard | TabletType (string) | ServingState (string) | Alias | Hostname | MasterTermStartTime.
func (c *Cluster) parseTablet(rows *sql.Rows) (*vtadminpb.Tablet, error) {
var (
cell string
tabletTypeStr string
servingStateStr string
aliasStr string
mtstStr string
topotablet topodatapb.Tablet
err error
)
if err := rows.Scan(
&cell,
&topotablet.Keyspace,
&topotablet.Shard,
&tabletTypeStr,
&servingStateStr,
&aliasStr,
&topotablet.Hostname,
&mtstStr,
); err != nil {
return nil, err
}
tablet := &vtadminpb.Tablet{
Cluster: &vtadminpb.Cluster{
Id: c.ID,
Name: c.Name,
},
Tablet: &topotablet,
}
topotablet.Type, err = topoproto.ParseTabletType(tabletTypeStr)
if err != nil {
return nil, err
}
tablet.State = vtadminproto.ParseTabletServingState(servingStateStr)
topotablet.Alias, err = topoproto.ParseTabletAlias(aliasStr)
if err != nil {
return nil, err
}
if topotablet.Alias.Cell != cell {
// (TODO:@amason) ???
log.Warningf("tablet cell %s does not match alias %s. ignoring for now", cell, topoproto.TabletAliasString(topotablet.Alias))
}
if mtstStr != "" {
timeTime, err := time.Parse(time.RFC3339, mtstStr)
if err != nil {
return nil, err
}
topotablet.MasterTermStartTime = logutil.TimeToProto(timeTime)
}
return tablet, nil
}
// GetTablets returns all tablets in the cluster.
func (c *Cluster) GetTablets(ctx context.Context) ([]*vtadminpb.Tablet, error) {
if err := c.DB.Dial(ctx, ""); err != nil {
return nil, err
}
rows, err := c.DB.ShowTablets(ctx)
if err != nil {
return nil, err
}
return c.parseTablets(rows)
}
// FindTablet returns the first tablet in a given cluster that satisfies the filter function.
func (c *Cluster) FindTablet(ctx context.Context, filter func(*vtadminpb.Tablet) bool) (*vtadminpb.Tablet, error) {
tablets, err := c.FindTablets(ctx, filter, 1)
if err != nil {
return nil, err
}
if len(tablets) != 1 {
return nil, errors.ErrNoTablet
}
return tablets[0], nil
}
// FindTablets returns the first N tablets in the given cluster that satisfy
// the filter function. If N = -1, then all matching tablets are returned.
// Ordering is not guaranteed, and callers should write their filter functions accordingly.
func (c *Cluster) FindTablets(ctx context.Context, filter func(*vtadminpb.Tablet) bool, n int) ([]*vtadminpb.Tablet, error) {
tablets, err := c.GetTablets(ctx)
if err != nil {
return nil, err
}
if n == -1 {
n = len(tablets)
}
results := make([]*vtadminpb.Tablet, 0, n)
for _, t := range tablets {
if len(results) >= n {
break
}
if filter(t) {
results = append(results, t)
}
}
return results, nil
}

Просмотреть файл

@ -0,0 +1,355 @@
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cluster_test
import (
"context"
"database/sql"
"errors"
"testing"
"github.com/stretchr/testify/assert"
"vitess.io/vitess/go/vt/vitessdriver"
"vitess.io/vitess/go/vt/vtadmin/cluster"
"vitess.io/vitess/go/vt/vtadmin/cluster/discovery/fakediscovery"
vtadminerrors "vitess.io/vitess/go/vt/vtadmin/errors"
"vitess.io/vitess/go/vt/vtadmin/testutil"
"vitess.io/vitess/go/vt/vtadmin/vtsql"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
"vitess.io/vitess/go/vt/proto/vtadmin"
vtadminpb "vitess.io/vitess/go/vt/proto/vtadmin"
)
// This test only validates the error handling on dialing database connections.
// Other cases are covered by one or both of TestFindTablets and TestFindTablet.
func TestGetTablets(t *testing.T) {
disco := fakediscovery.New()
disco.AddTaggedGates(nil, &vtadminpb.VTGate{Hostname: "gate"})
db := vtsql.New(&vtsql.Config{
Cluster: &vtadminpb.Cluster{
Id: "c1",
Name: "one",
},
Discovery: disco,
})
db.DialFunc = func(cfg vitessdriver.Configuration) (*sql.DB, error) {
return nil, assert.AnError
}
c := &cluster.Cluster{DB: db}
_, err := c.GetTablets(context.Background())
assert.Error(t, err)
}
func TestFindTablets(t *testing.T) {
tests := []struct {
name string
tablets []*vtadminpb.Tablet
filter func(*vtadminpb.Tablet) bool
n int
expected []*vtadminpb.Tablet
}{
{
name: "returns n filtered tablets",
tablets: []*vtadminpb.Tablet{
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 100,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_NOT_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 101,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 102,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 103,
},
Keyspace: "commerce",
},
},
},
filter: func(t *vtadminpb.Tablet) bool {
return t.State == vtadminpb.Tablet_SERVING
},
n: 2,
expected: []*vtadminpb.Tablet{
{
Cluster: &vtadmin.Cluster{
Id: "c0",
Name: "cluster0",
},
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 100,
},
Keyspace: "commerce",
},
},
{
Cluster: &vtadmin.Cluster{
Id: "c0",
Name: "cluster0",
},
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 102,
},
Keyspace: "commerce",
},
},
},
},
{
name: "returns all filtered tablets when n == -1",
tablets: []*vtadminpb.Tablet{
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 100,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_NOT_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 101,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 102,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 103,
},
Keyspace: "commerce",
},
},
},
filter: func(t *vtadminpb.Tablet) bool {
return t.State == vtadminpb.Tablet_SERVING
},
n: -1,
expected: []*vtadminpb.Tablet{
{
Cluster: &vtadmin.Cluster{
Id: "c0",
Name: "cluster0",
},
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 100,
},
Keyspace: "commerce",
},
},
{
Cluster: &vtadmin.Cluster{
Id: "c0",
Name: "cluster0",
},
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 102,
},
Keyspace: "commerce",
},
},
{
Cluster: &vtadmin.Cluster{
Id: "c0",
Name: "cluster0",
},
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 103,
},
Keyspace: "commerce",
},
},
},
},
}
for _, tt := range tests {
cluster := testutil.BuildCluster(0, nil, tt.tablets, nil)
tablets, err := cluster.FindTablets(context.Background(), tt.filter, tt.n)
assert.NoError(t, err)
testutil.AssertTabletSlicesEqual(t, tt.expected, tablets)
}
}
func TestFindTablet(t *testing.T) {
tests := []struct {
name string
tablets []*vtadminpb.Tablet
filter func(*vtadminpb.Tablet) bool
expected *vtadminpb.Tablet
expectedError error
}{
{
name: "returns the first matching tablet",
tablets: []*vtadminpb.Tablet{
{
State: vtadminpb.Tablet_NOT_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 100,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 101,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 102,
},
Keyspace: "commerce",
},
},
},
filter: func(t *vtadminpb.Tablet) bool {
return t.State == vtadminpb.Tablet_SERVING
},
expected: &vtadminpb.Tablet{
Cluster: &vtadmin.Cluster{
Id: "c0",
Name: "cluster0",
},
State: vtadminpb.Tablet_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 101,
},
Keyspace: "commerce",
},
},
},
{
name: "returns an error if no match found",
tablets: []*vtadminpb.Tablet{
{
State: vtadminpb.Tablet_NOT_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 100,
},
Keyspace: "commerce",
},
},
{
State: vtadminpb.Tablet_NOT_SERVING,
Tablet: &topodatapb.Tablet{
Alias: &topodatapb.TabletAlias{
Cell: "c0_cell1",
Uid: 101,
},
Keyspace: "commerce",
},
},
},
filter: func(t *vtadminpb.Tablet) bool {
return t.State == vtadminpb.Tablet_SERVING
},
expectedError: vtadminerrors.ErrNoTablet,
},
}
for _, tt := range tests {
cluster := testutil.BuildCluster(0, nil, tt.tablets, nil)
tablet, err := cluster.FindTablet(context.Background(), tt.filter)
if tt.expectedError != nil {
assert.True(t, errors.Is(err, tt.expectedError), "expected error type %w does not match actual error type %w", err, tt.expectedError)
} else {
assert.NoError(t, err)
testutil.AssertTabletsEqual(t, tt.expected, tablet)
}
}
}

Просмотреть файл

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package vtadmin
package errors
import "errors"

Просмотреть файл

@ -1,120 +0,0 @@
/*
Copyright 2020 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package vtadmin
import (
"database/sql"
"time"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/topo/topoproto"
"vitess.io/vitess/go/vt/vtadmin/cluster"
"vitess.io/vitess/go/vt/vtadmin/vtadminproto"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtadminpb "vitess.io/vitess/go/vt/proto/vtadmin"
)
// ParseTablets converts a set of *sql.Rows into a slice of Tablets, for the
// given cluster.
func ParseTablets(rows *sql.Rows, c *cluster.Cluster) ([]*vtadminpb.Tablet, error) {
var tablets []*vtadminpb.Tablet
for rows.Next() {
if err := rows.Err(); err != nil {
return nil, err
}
tablet, err := parseTablet(rows, c)
if err != nil {
return nil, err
}
tablets = append(tablets, tablet)
}
if err := rows.Err(); err != nil {
return nil, err
}
return tablets, nil
}
// Fields are:
// Cell | Keyspace | Shard | TabletType (string) | ServingState (string) | Alias | Hostname | MasterTermStartTime.
func parseTablet(rows *sql.Rows, c *cluster.Cluster) (*vtadminpb.Tablet, error) {
var (
cell string
tabletTypeStr string
servingStateStr string
aliasStr string
mtstStr string
topotablet topodatapb.Tablet
err error
)
if err := rows.Scan(
&cell,
&topotablet.Keyspace,
&topotablet.Shard,
&tabletTypeStr,
&servingStateStr,
&aliasStr,
&topotablet.Hostname,
&mtstStr,
); err != nil {
return nil, err
}
tablet := &vtadminpb.Tablet{
Cluster: &vtadminpb.Cluster{
Id: c.ID,
Name: c.Name,
},
Tablet: &topotablet,
}
topotablet.Type, err = topoproto.ParseTabletType(tabletTypeStr)
if err != nil {
return nil, err
}
tablet.State = vtadminproto.ParseTabletServingState(servingStateStr)
topotablet.Alias, err = topoproto.ParseTabletAlias(aliasStr)
if err != nil {
return nil, err
}
if topotablet.Alias.Cell != cell {
// (TODO:@amason) ???
log.Warningf("tablet cell %s does not match alias %s. ignoring for now", cell, topoproto.TabletAliasString(topotablet.Alias))
}
if mtstStr != "" {
timeTime, err := time.Parse(time.RFC3339, mtstStr)
if err != nil {
return nil, err
}
topotablet.MasterTermStartTime = logutil.TimeToProto(timeTime)
}
return tablet, nil
}

Просмотреть файл

@ -0,0 +1,82 @@
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package testutil
import (
"database/sql"
"fmt"
"google.golang.org/grpc"
"vitess.io/vitess/go/vt/grpcclient"
"vitess.io/vitess/go/vt/vitessdriver"
"vitess.io/vitess/go/vt/vtadmin/cluster"
"vitess.io/vitess/go/vt/vtadmin/cluster/discovery/fakediscovery"
vtadminvtctldclient "vitess.io/vitess/go/vt/vtadmin/vtctldclient"
"vitess.io/vitess/go/vt/vtadmin/vtsql"
"vitess.io/vitess/go/vt/vtadmin/vtsql/fakevtsql"
"vitess.io/vitess/go/vt/vtctl/vtctldclient"
vtadminpb "vitess.io/vitess/go/vt/proto/vtadmin"
)
// Dbcfg is a test utility for controlling the behavior of the cluster's DB
// at the package sql level.
type Dbcfg struct {
ShouldErr bool
}
// BuildCluster is a shared helper for building a cluster that contains the given tablets and
// talking to the given vtctld server. dbconfigs contains an optional config
// for controlling the behavior of the cluster's DB at the package sql level.
func BuildCluster(i int, vtctldClient vtctldclient.VtctldClient, tablets []*vtadminpb.Tablet, dbconfigs map[string]*Dbcfg) *cluster.Cluster {
disco := fakediscovery.New()
disco.AddTaggedGates(nil, &vtadminpb.VTGate{Hostname: fmt.Sprintf("cluster%d-gate", i)})
disco.AddTaggedVtctlds(nil, &vtadminpb.Vtctld{Hostname: "doesn't matter"})
cluster := &cluster.Cluster{
ID: fmt.Sprintf("c%d", i),
Name: fmt.Sprintf("cluster%d", i),
Discovery: disco,
}
dbconfig, ok := dbconfigs[cluster.ID]
if !ok {
dbconfig = &Dbcfg{ShouldErr: false}
}
db := vtsql.New(&vtsql.Config{
Cluster: cluster.ToProto(),
Discovery: disco,
})
db.DialFunc = func(cfg vitessdriver.Configuration) (*sql.DB, error) {
return sql.OpenDB(&fakevtsql.Connector{Tablets: tablets, ShouldErr: dbconfig.ShouldErr}), nil
}
vtctld := vtadminvtctldclient.New(&vtadminvtctldclient.Config{
Cluster: cluster.ToProto(),
Discovery: disco,
})
vtctld.DialFunc = func(addr string, ff grpcclient.FailFast, opts ...grpc.DialOption) (vtctldclient.VtctldClient, error) {
return vtctldClient, nil
}
cluster.DB = db
cluster.Vtctld = vtctld
return cluster
}

Просмотреть файл

@ -71,3 +71,43 @@ func AssertSchemaSlicesEqual(t *testing.T, expected []*vtadminpb.Schema, actual
assert.ElementsMatch(t, expected, actual, msgAndArgs...)
}
// AssertTabletSlicesEqual is a convenience function to assert that two
// []*vtadminpb.Tablet slices are equal, after clearing out any reserved
// proto XXX_ fields.
func AssertTabletSlicesEqual(t *testing.T, expected []*vtadminpb.Tablet, actual []*vtadminpb.Tablet, msgAndArgs ...interface{}) {
t.Helper()
for _, ts := range [][]*vtadminpb.Tablet{expected, actual} {
for _, t := range ts {
t.XXX_sizecache = 0
t.XXX_unrecognized = nil
if t.Cluster != nil {
t.Cluster.XXX_sizecache = 0
t.Cluster.XXX_unrecognized = nil
}
if t.Tablet != nil {
t.Tablet.XXX_sizecache = 0
t.Tablet.XXX_unrecognized = nil
if t.Tablet.Alias != nil {
t.Tablet.Alias.XXX_sizecache = 0
t.Tablet.Alias.XXX_unrecognized = nil
}
}
}
}
assert.ElementsMatch(t, expected, actual, msgAndArgs...)
}
// AssertTabletsEqual is a convenience function to assert that two
// *vtadminpb.Tablets are equal, after clearing out any reserved
// proto XXX_ fields.
func AssertTabletsEqual(t *testing.T, expected *vtadminpb.Tablet, actual *vtadminpb.Tablet, msgAndArgs ...interface{}) {
t.Helper()
AssertTabletSlicesEqual(t, []*vtadminpb.Tablet{expected}, []*vtadminpb.Tablet{actual}, msgAndArgs...)
}

Просмотреть файл

@ -82,6 +82,15 @@ func (client *gRPCVtctldClient) DeleteTablets(ctx context.Context, in *vtctldata
return client.c.DeleteTablets(ctx, in, opts...)
}
// EmergencyReparentShard is part of the vtctlservicepb.VtctldClient interface.
func (client *gRPCVtctldClient) EmergencyReparentShard(ctx context.Context, in *vtctldatapb.EmergencyReparentShardRequest, opts ...grpc.CallOption) (*vtctldatapb.EmergencyReparentShardResponse, error) {
if client.c == nil {
return nil, status.Error(codes.Unavailable, connClosedMsg)
}
return client.c.EmergencyReparentShard(ctx, in, opts...)
}
// FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldClient interface.
func (client *gRPCVtctldClient) FindAllShardsInKeyspace(ctx context.Context, in *vtctldatapb.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.FindAllShardsInKeyspaceResponse, error) {
if client.c == nil {
@ -208,6 +217,15 @@ func (client *gRPCVtctldClient) InitShardPrimary(ctx context.Context, in *vtctld
return client.c.InitShardPrimary(ctx, in, opts...)
}
// PlannedReparentShard is part of the vtctlservicepb.VtctldClient interface.
func (client *gRPCVtctldClient) PlannedReparentShard(ctx context.Context, in *vtctldatapb.PlannedReparentShardRequest, opts ...grpc.CallOption) (*vtctldatapb.PlannedReparentShardResponse, error) {
if client.c == nil {
return nil, status.Error(codes.Unavailable, connClosedMsg)
}
return client.c.PlannedReparentShard(ctx, in, opts...)
}
// RemoveKeyspaceCell is part of the vtctlservicepb.VtctldClient interface.
func (client *gRPCVtctldClient) RemoveKeyspaceCell(ctx context.Context, in *vtctldatapb.RemoveKeyspaceCellRequest, opts ...grpc.CallOption) (*vtctldatapb.RemoveKeyspaceCellResponse, error) {
if client.c == nil {
@ -225,3 +243,21 @@ func (client *gRPCVtctldClient) RemoveShardCell(ctx context.Context, in *vtctlda
return client.c.RemoveShardCell(ctx, in, opts...)
}
// ReparentTablet is part of the vtctlservicepb.VtctldClient interface.
func (client *gRPCVtctldClient) ReparentTablet(ctx context.Context, in *vtctldatapb.ReparentTabletRequest, opts ...grpc.CallOption) (*vtctldatapb.ReparentTabletResponse, error) {
if client.c == nil {
return nil, status.Error(codes.Unavailable, connClosedMsg)
}
return client.c.ReparentTablet(ctx, in, opts...)
}
// TabletExternallyReparented is part of the vtctlservicepb.VtctldClient interface.
func (client *gRPCVtctldClient) TabletExternallyReparented(ctx context.Context, in *vtctldatapb.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*vtctldatapb.TabletExternallyReparentedResponse, error) {
if client.c == nil {
return nil, status.Error(codes.Unavailable, connClosedMsg)
}
return client.c.TabletExternallyReparented(ctx, in, opts...)
}

Просмотреть файл

@ -25,6 +25,7 @@ import (
"time"
"google.golang.org/grpc"
"k8s.io/apimachinery/pkg/util/sets"
"vitess.io/vitess/go/event"
"vitess.io/vitess/go/protoutil"
@ -38,6 +39,7 @@ import (
"vitess.io/vitess/go/vt/topo/topoproto"
"vitess.io/vitess/go/vt/topotools"
"vitess.io/vitess/go/vt/topotools/events"
"vitess.io/vitess/go/vt/vtctl/reparentutil"
"vitess.io/vitess/go/vt/vterrors"
"vitess.io/vitess/go/vt/vttablet/tmclient"
@ -316,6 +318,57 @@ func (s *VtctldServer) DeleteTablets(ctx context.Context, req *vtctldatapb.Delet
return &vtctldatapb.DeleteTabletsResponse{}, nil
}
// EmergencyReparentShard is part of the vtctldservicepb.VtctldServer interface.
func (s *VtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldatapb.EmergencyReparentShardRequest) (*vtctldatapb.EmergencyReparentShardResponse, error) {
waitReplicasTimeout, ok, err := protoutil.DurationFromProto(req.WaitReplicasTimeout)
if err != nil {
return nil, err
} else if !ok {
waitReplicasTimeout = time.Second * 30
}
m := sync.RWMutex{}
logstream := []*logutilpb.Event{}
logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) {
m.Lock()
defer m.Unlock()
logstream = append(logstream, e)
})
ev, err := reparentutil.NewEmergencyReparenter(s.ts, s.tmc, logger).ReparentShard(ctx,
req.Keyspace,
req.Shard,
reparentutil.EmergencyReparentOptions{
NewPrimaryAlias: req.NewPrimary,
IgnoreReplicas: sets.NewString(topoproto.TabletAliasList(req.IgnoreReplicas).ToStringSlice()...),
WaitReplicasTimeout: waitReplicasTimeout,
},
)
resp := &vtctldatapb.EmergencyReparentShardResponse{
Keyspace: req.Keyspace,
Shard: req.Shard,
}
if ev != nil {
resp.Keyspace = ev.ShardInfo.Keyspace()
resp.Shard = ev.ShardInfo.ShardName()
if !topoproto.TabletAliasIsZero(ev.NewMaster.Alias) {
resp.PromotedPrimary = ev.NewMaster.Alias
}
}
m.RLock()
defer m.RUnlock()
resp.Events = make([]*logutilpb.Event, len(logstream))
copy(resp.Events, logstream)
return resp, err
}
// FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldServer interface.
func (s *VtctldServer) FindAllShardsInKeyspace(ctx context.Context, req *vtctldatapb.FindAllShardsInKeyspaceRequest) (*vtctldatapb.FindAllShardsInKeyspaceResponse, error) {
result, err := s.ts.FindAllShardsInKeyspace(ctx, req.Keyspace)
@ -646,11 +699,16 @@ func (s *VtctldServer) InitShardPrimary(ctx context.Context, req *vtctldatapb.In
}
defer unlock(&err)
m := sync.RWMutex{}
ev := &events.Reparent{}
logstream := []*logutilpb.Event{}
resp := &vtctldatapb.InitShardPrimaryResponse{}
err = s.InitShardPrimaryLocked(ctx, ev, req, waitReplicasTimeout, tmclient.NewTabletManagerClient(), logutil.NewCallbackLogger(func(e *logutilpb.Event) {
resp.Events = append(resp.Events, e)
m.Lock()
defer m.Unlock()
logstream = append(logstream, e)
}))
if err != nil {
event.DispatchUpdate(ev, "failed InitShardPrimary: "+err.Error())
@ -658,6 +716,12 @@ func (s *VtctldServer) InitShardPrimary(ctx context.Context, req *vtctldatapb.In
event.DispatchUpdate(ev, "finished InitShardPrimary")
}
m.RLock()
defer m.RUnlock()
resp.Events = make([]*logutilpb.Event, len(logstream))
copy(resp.Events, logstream)
return resp, err
}
@ -864,6 +928,57 @@ func (s *VtctldServer) InitShardPrimaryLocked(
return nil
}
// PlannedReparentShard is part of the vtctldservicepb.VtctldServer interface.
func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatapb.PlannedReparentShardRequest) (*vtctldatapb.PlannedReparentShardResponse, error) {
waitReplicasTimeout, ok, err := protoutil.DurationFromProto(req.WaitReplicasTimeout)
if err != nil {
return nil, err
} else if !ok {
waitReplicasTimeout = time.Second * 30
}
m := sync.RWMutex{}
logstream := []*logutilpb.Event{}
logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) {
m.Lock()
defer m.Unlock()
logstream = append(logstream, e)
})
ev, err := reparentutil.NewPlannedReparenter(s.ts, s.tmc, logger).ReparentShard(ctx,
req.Keyspace,
req.Shard,
reparentutil.PlannedReparentOptions{
AvoidPrimaryAlias: req.AvoidPrimary,
NewPrimaryAlias: req.NewPrimary,
WaitReplicasTimeout: waitReplicasTimeout,
},
)
resp := &vtctldatapb.PlannedReparentShardResponse{
Keyspace: req.Keyspace,
Shard: req.Shard,
}
if ev != nil {
resp.Keyspace = ev.ShardInfo.Keyspace()
resp.Shard = ev.ShardInfo.ShardName()
if !topoproto.TabletAliasIsZero(ev.NewMaster.Alias) {
resp.PromotedPrimary = ev.NewMaster.Alias
}
}
m.RLock()
defer m.RUnlock()
resp.Events = make([]*logutilpb.Event, len(logstream))
copy(resp.Events, logstream)
return resp, err
}
// RemoveKeyspaceCell is part of the vtctlservicepb.VtctldServer interface.
func (s *VtctldServer) RemoveKeyspaceCell(ctx context.Context, req *vtctldatapb.RemoveKeyspaceCellRequest) (*vtctldatapb.RemoveKeyspaceCellResponse, error) {
shards, err := s.ts.GetShardNames(ctx, req.Keyspace)
@ -897,6 +1012,110 @@ func (s *VtctldServer) RemoveShardCell(ctx context.Context, req *vtctldatapb.Rem
return &vtctldatapb.RemoveShardCellResponse{}, nil
}
// ReparentTablet is part of the vtctldservicepb.VtctldServer interface.
func (s *VtctldServer) ReparentTablet(ctx context.Context, req *vtctldatapb.ReparentTabletRequest) (*vtctldatapb.ReparentTabletResponse, error) {
if req.Tablet == nil {
return nil, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "tablet alias must not be nil")
}
tablet, err := s.ts.GetTablet(ctx, req.Tablet)
if err != nil {
return nil, err
}
shard, err := s.ts.GetShard(ctx, tablet.Keyspace, tablet.Shard)
if err != nil {
return nil, err
}
if !shard.HasMaster() {
return nil, vterrors.Errorf(vtrpc.Code_FAILED_PRECONDITION, "no master tablet for shard %v/%v", tablet.Keyspace, tablet.Shard)
}
shardPrimary, err := s.ts.GetTablet(ctx, shard.MasterAlias)
if err != nil {
return nil, fmt.Errorf("cannot lookup primary tablet %v for shard %v/%v: %w", topoproto.TabletAliasString(shard.MasterAlias), tablet.Keyspace, tablet.Shard, err)
}
if shardPrimary.Type != topodatapb.TabletType_MASTER {
return nil, vterrors.Errorf(vtrpc.Code_FAILED_PRECONDITION, "TopologyServer has incosistent state for shard master %v", topoproto.TabletAliasString(shard.MasterAlias))
}
if shardPrimary.Keyspace != tablet.Keyspace || shardPrimary.Shard != tablet.Shard {
return nil, vterrors.Errorf(vtrpc.Code_FAILED_PRECONDITION, "master %v and potential replica %v not in same keypace shard (%v/%v)", topoproto.TabletAliasString(shard.MasterAlias), topoproto.TabletAliasString(req.Tablet), tablet.Keyspace, tablet.Shard)
}
if err := s.tmc.SetMaster(ctx, tablet.Tablet, shard.MasterAlias, 0, "", false); err != nil {
return nil, err
}
return &vtctldatapb.ReparentTabletResponse{
Keyspace: tablet.Keyspace,
Shard: tablet.Shard,
Primary: shard.MasterAlias,
}, nil
}
// TabletExternallyReparented is part of the vtctldservicepb.VtctldServer interface.
func (s *VtctldServer) TabletExternallyReparented(ctx context.Context, req *vtctldatapb.TabletExternallyReparentedRequest) (*vtctldatapb.TabletExternallyReparentedResponse, error) {
if req.Tablet == nil {
return nil, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "TabletExternallyReparentedRequest.Tablet must not be nil")
}
tablet, err := s.ts.GetTablet(ctx, req.Tablet)
if err != nil {
log.Warningf("TabletExternallyReparented: failed to read tablet record for %v: %v", topoproto.TabletAliasString(req.Tablet), err)
return nil, err
}
shard, err := s.ts.GetShard(ctx, tablet.Keyspace, tablet.Shard)
if err != nil {
log.Warningf("TabletExternallyReparented: failed to read global shard record for %v/%v: %v", tablet.Keyspace, tablet.Shard, err)
return nil, err
}
resp := &vtctldatapb.TabletExternallyReparentedResponse{
Keyspace: shard.Keyspace(),
Shard: shard.ShardName(),
NewPrimary: req.Tablet,
OldPrimary: shard.MasterAlias,
}
// If the externally reparented (new primary) tablet is already MASTER in
// the topo, this is a no-op.
if tablet.Type == topodatapb.TabletType_MASTER {
return resp, nil
}
log.Infof("TabletExternallyReparented: executing tablet type change %v -> MASTER on %v", tablet.Type, topoproto.TabletAliasString(req.Tablet))
ev := &events.Reparent{
ShardInfo: *shard,
NewMaster: *tablet.Tablet,
OldMaster: topodatapb.Tablet{
Alias: shard.MasterAlias,
Type: topodatapb.TabletType_MASTER,
},
}
defer func() {
// Ensure we dispatch an update with any failure.
if err != nil {
event.DispatchUpdate(ev, "failed: "+err.Error())
}
}()
event.DispatchUpdate(ev, "starting external reparent")
if err := s.tmc.ChangeType(ctx, tablet.Tablet, topodatapb.TabletType_MASTER); err != nil {
log.Warningf("ChangeType(%v, MASTER): %v", topoproto.TabletAliasString(req.Tablet), err)
return nil, err
}
event.DispatchUpdate(ev, "finished")
return resp, nil
}
// StartServer registers a VtctldServer for RPCs on the given gRPC server.
func StartServer(s *grpc.Server, ts *topo.Server) {
vtctlservicepb.RegisterVtctldServer(s, NewVtctldServer(ts))

Просмотреть файл

@ -0,0 +1,596 @@
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package grpcvtctldserver
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/assert"
"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/topo/memorytopo"
"vitess.io/vitess/go/vt/vtctl/grpcvtctldserver/testutil"
"vitess.io/vitess/go/vt/vttablet/tmclient"
replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata"
vtctlservicepb "vitess.io/vitess/go/vt/proto/vtctlservice"
"vitess.io/vitess/go/vt/proto/vttime"
)
func TestEmergencyReparentShardSlow(t *testing.T) {
t.Parallel()
tests := []struct {
name string
ts *topo.Server
tmc tmclient.TabletManagerClient
tablets []*topodatapb.Tablet
req *vtctldatapb.EmergencyReparentShardRequest
expected *vtctldatapb.EmergencyReparentShardResponse
expectEventsToOccur bool
shouldErr bool
}{
{
// Note: this test case and the one below combine to assert that a
// nil WaitReplicasTimeout in the request results in a default 30
// second WaitReplicasTimeout.
//
// They are also very slow, because they require waiting 29 seconds
// and 30 seconds, respectively. Fortunately, we can run them
// concurrently, so the total time is only around 30 seconds, but
// that's still a long time for a unit test!
name: "nil WaitReplicasTimeout and request takes 29 seconds is ok",
ts: memorytopo.NewServer("zone1"),
tablets: []*topodatapb.Tablet{
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 100,
},
Type: topodatapb.TabletType_MASTER,
MasterTermStartTime: &vttime.Time{
Seconds: 100,
},
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
Type: topodatapb.TabletType_REPLICA,
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 101,
},
Type: topodatapb.TabletType_RDONLY,
Keyspace: "testkeyspace",
Shard: "-",
},
},
tmc: &testutil.TabletManagerClient{
DemoteMasterResults: map[string]struct {
Status *replicationdatapb.MasterStatus
Error error
}{
"zone1-0000000100": {
Status: &replicationdatapb.MasterStatus{
Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5",
},
},
},
PopulateReparentJournalDelays: map[string]time.Duration{
"zone1-0000000200": time.Second * 29,
},
PopulateReparentJournalResults: map[string]error{
"zone1-0000000200": nil,
},
PromoteReplicaResults: map[string]struct {
Result string
Error error
}{
"zone1-0000000200": {},
},
SetMasterResults: map[string]error{
"zone1-0000000100": nil,
"zone1-0000000101": nil,
},
StopReplicationAndGetStatusResults: map[string]struct {
Status *replicationdatapb.Status
StopStatus *replicationdatapb.StopReplicationStatus
Error error
}{
"zone1-0000000100": {
Error: mysql.ErrNotReplica,
},
"zone1-0000000101": {
Error: assert.AnError,
},
"zone1-0000000200": {
StopStatus: &replicationdatapb.StopReplicationStatus{
Before: &replicationdatapb.Status{},
After: &replicationdatapb.Status{
MasterUuid: "3E11FA47-71CA-11E1-9E33-C80AA9429562",
RelayLogPosition: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5",
Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5",
},
},
},
},
WaitForPositionResults: map[string]map[string]error{
"zone1-0000000100": {
"MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil,
},
"zone1-0000000200": {
"MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil,
},
},
},
req: &vtctldatapb.EmergencyReparentShardRequest{
Keyspace: "testkeyspace",
Shard: "-",
NewPrimary: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
WaitReplicasTimeout: nil,
},
expected: &vtctldatapb.EmergencyReparentShardResponse{
Keyspace: "testkeyspace",
Shard: "-",
PromotedPrimary: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
},
expectEventsToOccur: true,
shouldErr: false,
},
{
name: "nil WaitReplicasTimeout and request takes 31 seconds is error",
ts: memorytopo.NewServer("zone1"),
tablets: []*topodatapb.Tablet{
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 100,
},
Type: topodatapb.TabletType_MASTER,
MasterTermStartTime: &vttime.Time{
Seconds: 100,
},
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
Type: topodatapb.TabletType_REPLICA,
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 101,
},
Type: topodatapb.TabletType_RDONLY,
Keyspace: "testkeyspace",
Shard: "-",
},
},
tmc: &testutil.TabletManagerClient{
DemoteMasterResults: map[string]struct {
Status *replicationdatapb.MasterStatus
Error error
}{
"zone1-0000000100": {
Status: &replicationdatapb.MasterStatus{
Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5",
},
},
},
PopulateReparentJournalDelays: map[string]time.Duration{
"zone1-0000000200": time.Second * 31,
},
PopulateReparentJournalResults: map[string]error{
"zone1-0000000200": nil,
},
PromoteReplicaResults: map[string]struct {
Result string
Error error
}{
"zone1-0000000200": {},
},
SetMasterResults: map[string]error{
"zone1-0000000100": nil,
"zone1-0000000101": nil,
},
StopReplicationAndGetStatusResults: map[string]struct {
Status *replicationdatapb.Status
StopStatus *replicationdatapb.StopReplicationStatus
Error error
}{
"zone1-0000000100": {
Error: mysql.ErrNotReplica,
},
"zone1-0000000101": {
Error: assert.AnError,
},
"zone1-0000000200": {
StopStatus: &replicationdatapb.StopReplicationStatus{
Before: &replicationdatapb.Status{},
After: &replicationdatapb.Status{
MasterUuid: "3E11FA47-71CA-11E1-9E33-C80AA9429562",
RelayLogPosition: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5",
Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5",
},
},
},
},
WaitForPositionResults: map[string]map[string]error{
"zone1-0000000100": {
"MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil,
},
"zone1-0000000200": {
"MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil,
},
},
},
req: &vtctldatapb.EmergencyReparentShardRequest{
Keyspace: "testkeyspace",
Shard: "-",
NewPrimary: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
WaitReplicasTimeout: nil,
},
expectEventsToOccur: true,
shouldErr: true,
},
}
ctx := context.Background()
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if tt.req == nil {
t.Skip("tt.EmergencyReparentShardRequest = nil implies test not ready to run")
}
testutil.AddTablets(ctx, t, tt.ts, &testutil.AddTabletOptions{
AlsoSetShardMaster: true,
ForceSetShardMaster: true,
SkipShardCreation: false,
}, tt.tablets...)
vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, tt.ts, tt.tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer {
return NewVtctldServer(ts)
})
resp, err := vtctld.EmergencyReparentShard(ctx, tt.req)
// We defer this because we want to check in both error and non-
// error cases, but after the main set of assertions for those
// cases.
defer func() {
if !tt.expectEventsToOccur {
testutil.AssertNoLogutilEventsOccurred(t, resp, "expected no events to occur during ERS")
return
}
testutil.AssertLogutilEventsOccurred(t, resp, "expected events to occur during ERS")
}()
if tt.shouldErr {
assert.Error(t, err)
return
}
assert.NoError(t, err)
testutil.AssertEmergencyReparentShardResponsesEqual(t, *tt.expected, *resp)
})
}
}
func TestPlannedReparentShardSlow(t *testing.T) {
t.Parallel()
tests := []struct {
name string
ts *topo.Server
tmc tmclient.TabletManagerClient
tablets []*topodatapb.Tablet
req *vtctldatapb.PlannedReparentShardRequest
expected *vtctldatapb.PlannedReparentShardResponse
expectEventsToOccur bool
shouldErr bool
}{
{
// Note: this test case and the one below combine to assert that a
// nil WaitReplicasTimeout in the request results in a default 30
// second WaitReplicasTimeout.
name: "nil WaitReplicasTimeout and request takes 29 seconds is ok",
ts: memorytopo.NewServer("zone1"),
tablets: []*topodatapb.Tablet{
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 100,
},
Type: topodatapb.TabletType_MASTER,
MasterTermStartTime: &vttime.Time{
Seconds: 100,
},
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
Type: topodatapb.TabletType_REPLICA,
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 101,
},
Type: topodatapb.TabletType_RDONLY,
Keyspace: "testkeyspace",
Shard: "-",
},
},
tmc: &testutil.TabletManagerClient{
DemoteMasterResults: map[string]struct {
Status *replicationdatapb.MasterStatus
Error error
}{
"zone1-0000000100": {
Status: &replicationdatapb.MasterStatus{
Position: "primary-demotion position",
},
Error: nil,
},
},
MasterPositionResults: map[string]struct {
Position string
Error error
}{
"zone1-0000000100": {
Position: "doesn't matter",
Error: nil,
},
},
PopulateReparentJournalResults: map[string]error{
"zone1-0000000200": nil,
},
PromoteReplicaPostDelays: map[string]time.Duration{
"zone1-0000000200": time.Second * 28,
},
PromoteReplicaResults: map[string]struct {
Result string
Error error
}{
"zone1-0000000200": {
Result: "promotion position",
Error: nil,
},
},
SetMasterResults: map[string]error{
"zone1-0000000200": nil, // waiting for master-position during promotion
// reparent SetMaster calls
"zone1-0000000100": nil,
"zone1-0000000101": nil,
},
WaitForPositionResults: map[string]map[string]error{
"zone1-0000000200": {
"primary-demotion position": nil,
},
},
},
req: &vtctldatapb.PlannedReparentShardRequest{
Keyspace: "testkeyspace",
Shard: "-",
NewPrimary: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
WaitReplicasTimeout: nil,
},
expected: &vtctldatapb.PlannedReparentShardResponse{
Keyspace: "testkeyspace",
Shard: "-",
PromotedPrimary: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
},
expectEventsToOccur: true,
shouldErr: false,
},
{
name: "nil WaitReplicasTimeout and request takes 31 seconds is error",
ts: memorytopo.NewServer("zone1"),
tablets: []*topodatapb.Tablet{
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 100,
},
Type: topodatapb.TabletType_MASTER,
MasterTermStartTime: &vttime.Time{
Seconds: 100,
},
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
Type: topodatapb.TabletType_REPLICA,
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 101,
},
Type: topodatapb.TabletType_RDONLY,
Keyspace: "testkeyspace",
Shard: "-",
},
},
tmc: &testutil.TabletManagerClient{
DemoteMasterResults: map[string]struct {
Status *replicationdatapb.MasterStatus
Error error
}{
"zone1-0000000100": {
Status: &replicationdatapb.MasterStatus{
Position: "primary-demotion position",
},
Error: nil,
},
},
MasterPositionResults: map[string]struct {
Position string
Error error
}{
"zone1-0000000100": {
Position: "doesn't matter",
Error: nil,
},
},
PopulateReparentJournalResults: map[string]error{
"zone1-0000000200": nil,
},
PromoteReplicaPostDelays: map[string]time.Duration{
"zone1-0000000200": time.Second * 30,
},
PromoteReplicaResults: map[string]struct {
Result string
Error error
}{
"zone1-0000000200": {
Result: "promotion position",
Error: nil,
},
},
SetMasterResults: map[string]error{
"zone1-0000000200": nil, // waiting for master-position during promotion
// reparent SetMaster calls
"zone1-0000000100": nil,
"zone1-0000000101": nil,
},
WaitForPositionResults: map[string]map[string]error{
"zone1-0000000200": {
"primary-demotion position": nil,
},
},
},
req: &vtctldatapb.PlannedReparentShardRequest{
Keyspace: "testkeyspace",
Shard: "-",
NewPrimary: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
WaitReplicasTimeout: nil,
},
expected: &vtctldatapb.PlannedReparentShardResponse{
Keyspace: "testkeyspace",
Shard: "-",
PromotedPrimary: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 200,
},
},
expectEventsToOccur: true,
shouldErr: false,
},
}
ctx := context.Background()
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
testutil.AddTablets(ctx, t, tt.ts, &testutil.AddTabletOptions{
AlsoSetShardMaster: true,
ForceSetShardMaster: true,
SkipShardCreation: false,
}, tt.tablets...)
vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, tt.ts, tt.tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer {
return NewVtctldServer(ts)
})
resp, err := vtctld.PlannedReparentShard(ctx, tt.req)
// We defer this because we want to check in both error and non-
// error cases, but after the main set of assertions for those
// cases.
defer func() {
if !tt.expectEventsToOccur {
testutil.AssertNoLogutilEventsOccurred(t, resp, "expected no events to occur during ERS")
return
}
testutil.AssertLogutilEventsOccurred(t, resp, "expected events to occur during ERS")
}()
if tt.shouldErr {
assert.Error(t, err)
return
}
assert.NoError(t, err)
testutil.AssertPlannedReparentShardResponsesEqual(t, *tt.expected, *resp)
})
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -21,9 +21,37 @@ import (
"github.com/stretchr/testify/assert"
logutilpb "vitess.io/vitess/go/vt/proto/logutil"
vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata"
)
// AssertEmergencyReparentShardResponsesEqual asserts that two
// vtctldatapb.EmergencyReparentShardResponse objects are equal, ignoring their
// respective Events field in the comparison.
func AssertEmergencyReparentShardResponsesEqual(t *testing.T, expected vtctldatapb.EmergencyReparentShardResponse, actual vtctldatapb.EmergencyReparentShardResponse, msgAndArgs ...interface{}) {
t.Helper()
// We take both the expected and actual values by value, rather than by
// reference, so this mutation is safe to do and will not interfere with
// other assertions performed in the calling function.
expected.Events = nil
actual.Events = nil
assert.Equal(t, expected, actual, msgAndArgs...)
}
// AssertPlannedReparentShardResponsesEqual asserts that two
// vtctldatapb.PlannedReparentShardResponse objects are equal, ignoring their
// respective Events field in the comparison.
func AssertPlannedReparentShardResponsesEqual(t *testing.T, expected vtctldatapb.PlannedReparentShardResponse, actual vtctldatapb.PlannedReparentShardResponse, msgAndArgs ...interface{}) {
t.Helper()
expected.Events = nil
actual.Events = nil
assert.Equal(t, expected, actual, msgAndArgs...)
}
// AssertKeyspacesEqual is a convenience function to assert that two
// vtctldatapb.Keyspace objects are equal, after clearing out any reserved
// proto XXX_ fields.
@ -44,3 +72,41 @@ func AssertKeyspacesEqual(t *testing.T, expected *vtctldatapb.Keyspace, actual *
assert.Equal(t, expected, actual, msgAndArgs...)
}
// AssertLogutilEventsOccurred asserts that for something containing a slice of
// logutilpb.Event, that the container is non-nil, and the event slice is
// non-zero.
//
// This test function is generalized with an anonymous interface that any
// protobuf type containing a slice of logutilpb.Event elements called Events,
// which is the convention in protobuf types in the Vitess codebase, already
// implements.
func AssertLogutilEventsOccurred(t *testing.T, container interface{ GetEvents() []*logutilpb.Event }, msgAndArgs ...interface{}) {
t.Helper()
if container == nil {
assert.Fail(t, "Events container must not be nil", msgAndArgs...)
return
}
assert.Greater(t, len(container.GetEvents()), 0, msgAndArgs...)
}
// AssertNoLogutilEventsOccurred asserts that for something containing a slice
// of logutilpb.Event, that the container is either nil, or that the event slice
// is exactly zero length.
//
// This test function is generalized with an anonymous interface that any
// protobuf type containing a slice of logutilpb.Event elements called Events,
// which is the convention in protobuf types in the Vitess codebase, already
// implements.
func AssertNoLogutilEventsOccurred(t *testing.T, container interface{ GetEvents() []*logutilpb.Event }, msgAndArgs ...interface{}) {
t.Helper()
if container == nil {
return
}
assert.Equal(t, len(container.GetEvents()), 0, msgAndArgs...)
}

Просмотреть файл

@ -335,6 +335,8 @@ func (erp *EmergencyReparenter) reparentShardLocked(ctx context.Context, ev *eve
return err
}
ev.NewMaster = *tabletMap[winningPrimaryTabletAliasStr].Tablet
return nil
}
@ -351,17 +353,44 @@ func (erp *EmergencyReparenter) waitForAllRelayLogsToApply(
groupCtx, groupCancel := context.WithTimeout(ctx, opts.WaitReplicasTimeout)
defer groupCancel()
waiterCount := 0
for candidate := range validCandidates {
// When we called StopReplicationAndBuildStatusMaps, we got back two
// maps: (1) the StopReplicationStatus of any replicas that actually
// stopped replication; and (2) the MasterStatus of anything that
// returned ErrNotReplica, which is a tablet that is either the current
// primary or is stuck thinking it is a MASTER but is not in actuality.
//
// If we have a tablet in the validCandidates map that does not appear
// in the statusMap, then we have either (a) the current primary, which
// is not replicating, so it is not applying relay logs; or (b) a tablet
// that is stuck thinking it is MASTER but is not in actuality. In that
// second case - (b) - we will most likely find that the stuck MASTER
// does not have a winning position, and fail the ERS. If, on the other
// hand, it does have a winning position, we are trusting the operator
// to know what they are doing by emergency-reparenting onto that
// tablet. In either case, it does not make sense to wait for relay logs
// to apply on a tablet that was never applying relay logs in the first
// place, so we skip it, and log that we did.
status, ok := statusMap[candidate]
if !ok {
erp.logger.Infof("EmergencyReparent candidate %v not in replica status map; this means it was not running replication (because it was formerly MASTER), so skipping WaitForRelayLogsToApply step for this candidate", candidate)
continue
}
go func(alias string) {
var err error
defer func() { errCh <- err }()
err = WaitForRelayLogsToApply(groupCtx, erp.tmc, tabletMap[alias], statusMap[alias])
err = WaitForRelayLogsToApply(groupCtx, erp.tmc, tabletMap[alias], status)
}(candidate)
waiterCount++
}
errgroup := concurrency.ErrorGroup{
NumGoroutines: len(validCandidates),
NumRequiredSuccesses: len(validCandidates),
NumGoroutines: waiterCount,
NumRequiredSuccesses: waiterCount,
NumAllowedErrors: 0,
}
rec := errgroup.Wait(groupCancel, errCh)

Просмотреть файл

@ -336,6 +336,111 @@ func TestEmergencyReparenter_reparentShardLocked(t *testing.T) {
},
shouldErr: false,
},
{
name: "success with existing primary",
ts: memorytopo.NewServer("zone1"),
tmc: &testutil.TabletManagerClient{
DemoteMasterResults: map[string]struct {
Status *replicationdatapb.MasterStatus
Error error
}{
"zone1-0000000100": {
Status: &replicationdatapb.MasterStatus{
Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-21",
},
},
},
PopulateReparentJournalResults: map[string]error{
"zone1-0000000102": nil,
},
PromoteReplicaResults: map[string]struct {
Result string
Error error
}{
"zone1-0000000102": {
Result: "ok",
Error: nil,
},
},
SetMasterResults: map[string]error{
"zone1-0000000100": nil,
"zone1-0000000101": nil,
},
StopReplicationAndGetStatusResults: map[string]struct {
Status *replicationdatapb.Status
StopStatus *replicationdatapb.StopReplicationStatus
Error error
}{
"zone1-0000000100": { // This tablet claims MASTER, so is not running replication.
Error: mysql.ErrNotReplica,
},
"zone1-0000000101": {
StopStatus: &replicationdatapb.StopReplicationStatus{
Before: &replicationdatapb.Status{},
After: &replicationdatapb.Status{
MasterUuid: "3E11FA47-71CA-11E1-9E33-C80AA9429562",
RelayLogPosition: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-21",
},
},
},
"zone1-0000000102": {
StopStatus: &replicationdatapb.StopReplicationStatus{
Before: &replicationdatapb.Status{},
After: &replicationdatapb.Status{
MasterUuid: "3E11FA47-71CA-11E1-9E33-C80AA9429562",
RelayLogPosition: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-26",
},
},
},
},
WaitForPositionResults: map[string]map[string]error{
"zone1-0000000101": {
"MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-21": nil,
},
"zone1-0000000102": {
"MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-26": nil,
},
},
},
shards: []*vtctldatapb.Shard{
{
Keyspace: "testkeyspace",
Name: "-",
},
},
tablets: []*topodatapb.Tablet{
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 100,
},
Keyspace: "testkeyspace",
Shard: "-",
Type: topodatapb.TabletType_MASTER,
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 101,
},
Keyspace: "testkeyspace",
Shard: "-",
},
{
Alias: &topodatapb.TabletAlias{
Cell: "zone1",
Uid: 102,
},
Keyspace: "testkeyspace",
Shard: "-",
Hostname: "most up-to-date position, wins election",
},
},
keyspace: "testkeyspace",
shard: "-",
opts: EmergencyReparentOptions{},
shouldErr: false,
},
{
name: "shard not found",
ts: memorytopo.NewServer("zone1"),

Просмотреть файл

@ -1032,7 +1032,7 @@ func commandRefreshStateByShard(ctx context.Context, wr *wrangler.Wrangler, subF
if *cellsStr != "" {
cells = strings.Split(*cellsStr, ",")
}
return wr.RefreshTabletsByShard(ctx, si, nil /* tabletTypes */, cells)
return wr.RefreshTabletsByShard(ctx, si, cells)
}
func commandRunHealthCheck(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error {

Просмотреть файл

@ -443,6 +443,45 @@ func (cached *PulloutSubquery) CachedSize(alloc bool) int64 {
}
return size
}
func (cached *RenameFields) CachedSize(alloc bool) int64 {
if cached == nil {
return int64(0)
}
size := int64(0)
if alloc {
size += int64(64)
}
// field Cols []string
{
size += int64(cap(cached.Cols)) * int64(16)
for _, elem := range cached.Cols {
size += int64(len(elem))
}
}
// field Indices []int
{
size += int64(cap(cached.Indices)) * int64(8)
}
// field Input vitess.io/vitess/go/vt/vtgate/engine.Primitive
if cc, ok := cached.Input.(cachedObject); ok {
size += cc.CachedSize(true)
}
return size
}
func (cached *ReplaceVariables) CachedSize(alloc bool) int64 {
if cached == nil {
return int64(0)
}
size := int64(0)
if alloc {
size += int64(16)
}
// field Input vitess.io/vitess/go/vt/vtgate/engine.Primitive
if cc, ok := cached.Input.(cachedObject); ok {
size += cc.CachedSize(true)
}
return size
}
func (cached *Route) CachedSize(alloc bool) int64 {
if cached == nil {
return int64(0)

Просмотреть файл

@ -0,0 +1,118 @@
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package engine
import (
"vitess.io/vitess/go/sqltypes"
querypb "vitess.io/vitess/go/vt/proto/query"
"vitess.io/vitess/go/vt/proto/vtrpc"
"vitess.io/vitess/go/vt/vterrors"
)
var _ Primitive = (*RenameFields)(nil)
// RenameFields is a primitive that renames the fields
type RenameFields struct {
Cols []string
Indices []int
Input Primitive
noTxNeeded
}
// NewRenameField creates a new rename field
func NewRenameField(cols []string, indices []int, input Primitive) (*RenameFields, error) {
if len(cols) != len(indices) {
return nil, vterrors.New(vtrpc.Code_INTERNAL, "Unequal length of columns and indices in RenameField primitive")
}
return &RenameFields{
Cols: cols,
Indices: indices,
Input: input,
}, nil
}
// RouteType implements the primitive interface
func (r *RenameFields) RouteType() string {
return r.Input.RouteType()
}
// GetKeyspaceName implements the primitive interface
func (r *RenameFields) GetKeyspaceName() string {
return r.Input.GetKeyspaceName()
}
// GetTableName implements the primitive interface
func (r *RenameFields) GetTableName() string {
return r.Input.GetTableName()
}
// Execute implements the primitive interface
func (r *RenameFields) Execute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) {
qr, err := r.Input.Execute(vcursor, bindVars, wantfields)
if err != nil {
return nil, err
}
if wantfields {
r.renameFields(qr)
}
return qr, nil
}
func (r *RenameFields) renameFields(qr *sqltypes.Result) {
for ind, index := range r.Indices {
colName := r.Cols[ind]
qr.Fields[index].Name = colName
}
}
// StreamExecute implements the primitive interface
func (r *RenameFields) StreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error {
if wantfields {
innerCallback := callback
callback = func(result *sqltypes.Result) error {
r.renameFields(result)
return innerCallback(result)
}
}
return r.Input.StreamExecute(vcursor, bindVars, wantfields, callback)
}
// GetFields implements the primitive interface
func (r *RenameFields) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
qr, err := r.Input.GetFields(vcursor, bindVars)
if err != nil {
return nil, err
}
r.renameFields(qr)
return qr, nil
}
// Inputs implements the primitive interface
func (r *RenameFields) Inputs() []Primitive {
return []Primitive{r.Input}
}
// description implements the primitive interface
func (r *RenameFields) description() PrimitiveDescription {
return PrimitiveDescription{
OperatorType: "RenameFields",
Other: map[string]interface{}{
"Indices": r.Indices,
"Columns": r.Cols,
},
}
}

Просмотреть файл

@ -0,0 +1,97 @@
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package engine
import (
"vitess.io/vitess/go/sqltypes"
querypb "vitess.io/vitess/go/vt/proto/query"
)
var _ Primitive = (*ReplaceVariables)(nil)
// ReplaceVariables is used in SHOW VARIABLES statements so that it replaces the values for vitess-aware variables
type ReplaceVariables struct {
Input Primitive
noTxNeeded
}
// NewReplaceVariables is used to create a new ReplaceVariables primitive
func NewReplaceVariables(input Primitive) *ReplaceVariables {
return &ReplaceVariables{Input: input}
}
// RouteType implements the Primitive interface
func (r *ReplaceVariables) RouteType() string {
return r.Input.RouteType()
}
// GetKeyspaceName implements the Primitive interface
func (r *ReplaceVariables) GetKeyspaceName() string {
return r.Input.GetKeyspaceName()
}
// GetTableName implements the Primitive interface
func (r *ReplaceVariables) GetTableName() string {
return r.Input.GetTableName()
}
// Execute implements the Primitive interface
func (r *ReplaceVariables) Execute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) {
qr, err := r.Input.Execute(vcursor, bindVars, wantfields)
if err != nil {
return nil, err
}
replaceVariables(qr, bindVars)
return qr, nil
}
// StreamExecute implements the Primitive interface
func (r *ReplaceVariables) StreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error {
innerCallback := callback
callback = func(result *sqltypes.Result) error {
replaceVariables(result, bindVars)
return innerCallback(result)
}
return r.Input.StreamExecute(vcursor, bindVars, wantfields, callback)
}
// GetFields implements the Primitive interface
func (r *ReplaceVariables) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
return r.Input.GetFields(vcursor, bindVars)
}
// Inputs implements the Primitive interface
func (r *ReplaceVariables) Inputs() []Primitive {
return []Primitive{r.Input}
}
// description implements the Primitive interface
func (r *ReplaceVariables) description() PrimitiveDescription {
return PrimitiveDescription{
OperatorType: "ReplaceVariables",
}
}
func replaceVariables(qr *sqltypes.Result, bindVars map[string]*querypb.BindVariable) {
for i, row := range qr.Rows {
variableName := row[0].ToString()
res, found := bindVars["__vt"+variableName]
if found {
qr.Rows[i][1] = sqltypes.NewVarChar(string(res.GetValue()))
}
}
}

Просмотреть файл

@ -1237,7 +1237,7 @@ func (e *Executor) getPlan(vcursor *vcursorImpl, sql string, comments sqlparser.
vcursor.SetIgnoreMaxMemoryRows(ignoreMaxMemoryRows)
// Normalize if possible and retry.
if (e.normalize && sqlparser.CanNormalize(stmt)) || sqlparser.IsSetStatement(stmt) {
if (e.normalize && sqlparser.CanNormalize(stmt)) || sqlparser.MustRewriteAST(stmt) {
parameterize := e.normalize // the public flag is called normalize
result, err := sqlparser.PrepareAST(stmt, bindVars, "vtg", parameterize, vcursor.keyspace)
if err != nil {

Просмотреть файл

@ -54,9 +54,10 @@ func buildShowBasicPlan(show *sqlparser.ShowBasic, vschema ContextVSchema) (engi
switch show.Command {
case sqlparser.Charset:
return buildCharsetPlan(show)
case sqlparser.Collation, sqlparser.Function, sqlparser.Privilege, sqlparser.Procedure,
sqlparser.VariableGlobal, sqlparser.VariableSession:
case sqlparser.Collation, sqlparser.Function, sqlparser.Privilege, sqlparser.Procedure:
return buildSendAnywherePlan(show, vschema)
case sqlparser.VariableGlobal, sqlparser.VariableSession:
return buildVariablePlan(show, vschema)
case sqlparser.Column, sqlparser.Index:
return buildShowTblPlan(show, vschema)
case sqlparser.Database, sqlparser.Keyspace:
@ -98,6 +99,15 @@ func buildSendAnywherePlan(show *sqlparser.ShowBasic, vschema ContextVSchema) (e
}, nil
}
func buildVariablePlan(show *sqlparser.ShowBasic, vschema ContextVSchema) (engine.Primitive, error) {
plan, err := buildSendAnywherePlan(show, vschema)
if err != nil {
return nil, err
}
plan = engine.NewReplaceVariables(plan)
return plan, nil
}
func buildShowTblPlan(show *sqlparser.ShowBasic, vschema ContextVSchema) (engine.Primitive, error) {
if show.DbName != "" {
show.Tbl.Qualifier = sqlparser.NewTableIdent(show.DbName)
@ -164,17 +174,18 @@ func buildDBPlan(show *sqlparser.ShowBasic, vschema ContextVSchema) (engine.Prim
func buildPlanWithDB(show *sqlparser.ShowBasic, vschema ContextVSchema) (engine.Primitive, error) {
dbName := show.DbName
if sqlparser.SystemSchema(dbName) {
dbDestination := show.DbName
if sqlparser.SystemSchema(dbDestination) {
ks, err := vschema.AnyKeyspace()
if err != nil {
return nil, err
}
dbName = ks.Name
dbDestination = ks.Name
} else {
// Remove Database Name from the query.
show.DbName = ""
}
destination, keyspace, _, err := vschema.TargetDestination(dbName)
destination, keyspace, _, err := vschema.TargetDestination(dbDestination)
if err != nil {
return nil, err
}
@ -182,14 +193,26 @@ func buildPlanWithDB(show *sqlparser.ShowBasic, vschema ContextVSchema) (engine.
destination = key.DestinationAnyShard{}
}
if dbName == "" {
dbName = keyspace.Name
}
query := sqlparser.String(show)
return &engine.Send{
var plan engine.Primitive
plan = &engine.Send{
Keyspace: keyspace,
TargetDestination: destination,
Query: query,
IsDML: false,
SingleShardOnly: true,
}, nil
}
if show.Command == sqlparser.Table {
plan, err = engine.NewRenameField([]string{"Tables_in_" + dbName}, []int{0}, plan)
if err != nil {
return nil, err
}
}
return plan, nil
}

Просмотреть файл

@ -220,15 +220,43 @@
"QueryType": "SHOW",
"Original": "show variables",
"Instructions": {
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show variables",
"SingleShardOnly": true
"OperatorType": "ReplaceVariables",
"Inputs": [
{
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show variables",
"SingleShardOnly": true
}
]
}
}
# show global variables
"show global variables"
{
"QueryType": "SHOW",
"Original": "show global variables",
"Instructions": {
"OperatorType": "ReplaceVariables",
"Inputs": [
{
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show global variables",
"SingleShardOnly": true
}
]
}
}
@ -396,15 +424,26 @@
"QueryType": "SHOW",
"Original": "show tables",
"Instructions": {
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show tables",
"SingleShardOnly": true
"OperatorType": "RenameFields",
"Columns": [
"Tables_in_main"
],
"Indices": [
0
],
"Inputs": [
{
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show tables",
"SingleShardOnly": true
}
]
}
}
@ -414,15 +453,26 @@
"QueryType": "SHOW",
"Original": "show tables from user",
"Instructions": {
"OperatorType": "Send",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show tables",
"SingleShardOnly": true
"OperatorType": "RenameFields",
"Columns": [
"Tables_in_user"
],
"Indices": [
0
],
"Inputs": [
{
"OperatorType": "Send",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show tables",
"SingleShardOnly": true
}
]
}
}
@ -432,15 +482,25 @@
"QueryType": "SHOW",
"Original": "show tables from performance_schema",
"Instructions": {
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show tables from performance_schema",
"SingleShardOnly": true
"OperatorType": "RenameFields",
"Columns": [
"Tables_in_performance_schema"
],
"Indices": [
0
],
"Inputs": [
{
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show tables from performance_schema",
"SingleShardOnly": true
}
]
}
}

Просмотреть файл

@ -40,14 +40,19 @@
"QueryType": "SHOW",
"Original": "show variables",
"Instructions": {
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show variables",
"SingleShardOnly": true
"OperatorType": "ReplaceVariables",
"Inputs": [
{
"OperatorType": "Send",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"TargetDestination": "AnyShard()",
"IsDML": false,
"Query": "show variables",
"SingleShardOnly": true
}
]
}
}

Просмотреть файл

@ -49,6 +49,9 @@ func TestBinaryMap(t *testing.T) {
}{{
in: sqltypes.NewVarChar("test1"),
out: []byte("test1"),
}, {
in: sqltypes.NULL,
out: []byte(nil),
}, {
in: sqltypes.NewVarChar("test2"),
out: []byte("test2"),

Просмотреть файл

@ -44,19 +44,23 @@ func TestBinaryMD5Info(t *testing.T) {
func TestBinaryMD5Map(t *testing.T) {
tcases := []struct {
in, out string
in sqltypes.Value
out string
}{{
in: "Test",
out: "\f\xbcf\x11\xf5T\vЀ\x9a8\x8d\xc9Za[",
in: sqltypes.NewVarBinary("test1"),
out: "Z\x10^\x8b\x9d@\xe12\x97\x80\xd6.\xa2&]\x8a",
}, {
in: "TEST",
in: sqltypes.NewVarBinary("TEST"),
out: "\x03;\xd9K\x11h\xd7\xe4\xf0\xd6D\xc3\xc9^5\xbf",
}, {
in: "Test",
in: sqltypes.NULL,
out: "\xd4\x1d\x8cُ\x00\xb2\x04\xe9\x80\t\x98\xec\xf8B~",
}, {
in: sqltypes.NewVarBinary("Test"),
out: "\f\xbcf\x11\xf5T\vЀ\x9a8\x8d\xc9Za[",
}}
for _, tcase := range tcases {
got, err := binVindex.Map(nil, []sqltypes.Value{sqltypes.NewVarBinary(tcase.in)})
got, err := binVindex.Map(nil, []sqltypes.Value{tcase.in})
if err != nil {
t.Error(err)
}

Просмотреть файл

@ -53,6 +53,7 @@ func TestNullMap(t *testing.T) {
sqltypes.NewInt64(5),
sqltypes.NewInt64(6),
sqltypes.NewVarChar("1234567890123"),
sqltypes.NULL,
})
require.NoError(t, err)
want := []key.Destination{
@ -63,6 +64,7 @@ func TestNullMap(t *testing.T) {
key.DestinationKeyspaceID([]byte{0}),
key.DestinationKeyspaceID([]byte{0}),
key.DestinationKeyspaceID([]byte{0}),
key.DestinationKeyspaceID([]byte{0}),
}
if !reflect.DeepEqual(got, want) {
t.Errorf("Map(): %#v, want %+v", got, want)

Просмотреть файл

@ -63,6 +63,7 @@ func TestNumericStaticMapMap(t *testing.T) {
sqltypes.NewInt64(6),
sqltypes.NewInt64(7),
sqltypes.NewInt64(8),
sqltypes.NULL,
})
require.NoError(t, err)
@ -78,6 +79,7 @@ func TestNumericStaticMapMap(t *testing.T) {
key.DestinationKeyspaceID([]byte("\x00\x00\x00\x00\x00\x00\x00\x06")),
key.DestinationKeyspaceID([]byte("\x00\x00\x00\x00\x00\x00\x00\x07")),
key.DestinationKeyspaceID([]byte("\x00\x00\x00\x00\x00\x00\x00\x08")),
key.DestinationNone{},
}
if !reflect.DeepEqual(got, want) {
t.Errorf("Map(): %+v, want %+v", got, want)

Просмотреть файл

@ -53,6 +53,7 @@ func TestNumericMap(t *testing.T) {
sqltypes.NewInt64(7),
sqltypes.NewInt64(8),
sqltypes.NewInt32(8),
sqltypes.NULL,
})
require.NoError(t, err)
want := []key.Destination{
@ -66,6 +67,7 @@ func TestNumericMap(t *testing.T) {
key.DestinationKeyspaceID([]byte("\x00\x00\x00\x00\x00\x00\x00\x07")),
key.DestinationKeyspaceID([]byte("\x00\x00\x00\x00\x00\x00\x00\x08")),
key.DestinationKeyspaceID([]byte("\x00\x00\x00\x00\x00\x00\x00\x08")),
key.DestinationNone{},
}
if !reflect.DeepEqual(got, want) {
t.Errorf("Map(): %+v, want %+v", got, want)

Просмотреть файл

@ -42,40 +42,44 @@ func TestUnicodeLooseMD5Info(t *testing.T) {
func TestUnicodeLooseMD5Map(t *testing.T) {
tcases := []struct {
in, out string
in sqltypes.Value
out string
}{{
in: "Test",
in: sqltypes.NewVarBinary("Test"),
out: "\v^۴\x01\xfdu$96\x90I\x1dd\xf1\xf5",
}, {
in: "TEST",
in: sqltypes.NewVarBinary("TEST"),
out: "\v^۴\x01\xfdu$96\x90I\x1dd\xf1\xf5",
}, {
in: "Te\u0301st",
in: sqltypes.NewVarBinary("Te\u0301st"),
out: "\v^۴\x01\xfdu$96\x90I\x1dd\xf1\xf5",
}, {
in: "Tést",
in: sqltypes.NewVarBinary("Tést"),
out: "\v^۴\x01\xfdu$96\x90I\x1dd\xf1\xf5",
}, {
in: "Bést",
in: sqltypes.NewVarBinary("Bést"),
out: "²3.Os\xd0\aA\x02bIpo/\xb6",
}, {
in: "Test ",
in: sqltypes.NewVarBinary("Test "),
out: "\v^۴\x01\xfdu$96\x90I\x1dd\xf1\xf5",
}, {
in: " Test",
in: sqltypes.NewVarBinary(" Test"),
out: "\xa2\xe3Q\\~\x8d\xf1\xff\xd2\xcc\xfc\x11Ʊ\x9d\xd1",
}, {
in: "Test\t",
in: sqltypes.NewVarBinary("Test\t"),
out: "\x82Em\xd8z\x9cz\x02\xb1\xc2\x05kZ\xba\xa2r",
}, {
in: "TéstLooong",
in: sqltypes.NewVarBinary("TéstLooong"),
out: "\x96\x83\xe1+\x80C\f\xd4S\xf5\xdfߺ\x81ɥ",
}, {
in: "T",
in: sqltypes.NewVarBinary("T"),
out: "\xac\x0f\x91y\xf5\x1d\xb8\u007f\xe8\xec\xc0\xcf@ʹz",
}, {
in: sqltypes.NULL,
out: "\xd4\x1d\x8cُ\x00\xb2\x04\xe9\x80\t\x98\xec\xf8B~",
}}
for _, tcase := range tcases {
got, err := charVindexMD5.Map(nil, []sqltypes.Value{sqltypes.NewVarBinary(tcase.in)})
got, err := charVindexMD5.Map(nil, []sqltypes.Value{tcase.in})
if err != nil {
t.Error(err)
}

Просмотреть файл

@ -42,40 +42,44 @@ func TestUnicodeLooseXXHashInfo(t *testing.T) {
func TestUnicodeLooseXXHashMap(t *testing.T) {
tcases := []struct {
in, out string
in sqltypes.Value
out string
}{{
in: "Test",
in: sqltypes.NewVarBinary("Test"),
out: "B\xd2\x13a\bzL\a",
}, {
in: "TEst",
in: sqltypes.NewVarBinary("TEst"),
out: "B\xd2\x13a\bzL\a",
}, {
in: "Te\u0301st",
in: sqltypes.NewVarBinary("Te\u0301st"),
out: "B\xd2\x13a\bzL\a",
}, {
in: "Tést",
in: sqltypes.NewVarBinary("Tést"),
out: "B\xd2\x13a\bzL\a",
}, {
in: "Bést",
in: sqltypes.NewVarBinary("Bést"),
out: "\x92iu\xb9\xce.\xc3\x16",
}, {
in: "Test ",
in: sqltypes.NewVarBinary("Test "),
out: "B\xd2\x13a\bzL\a",
}, {
in: " Test",
in: sqltypes.NewVarBinary(" Test"),
out: "Oˋ\xe3N\xc0Wu",
}, {
in: "Test\t",
in: sqltypes.NewVarBinary("Test\t"),
out: " \xaf\x87\xfc6\xe3\xfdQ",
}, {
in: "TéstLooong",
in: sqltypes.NewVarBinary("TéstLooong"),
out: "\xd3\xea\x879B\xb4\x84\xa7",
}, {
in: "T",
in: sqltypes.NewVarBinary("T"),
out: "\xf8\x1c;\xe2\xd5\x01\xfe\x18",
}, {
in: sqltypes.NULL,
out: "\x99\xe9\xd8Q7\xdbF\xef",
}}
for _, tcase := range tcases {
got, err := charVindexXXHash.Map(nil, []sqltypes.Value{sqltypes.NewVarBinary(tcase.in)})
got, err := charVindexXXHash.Map(nil, []sqltypes.Value{tcase.in})
if err != nil {
t.Error(err)
}

Просмотреть файл

@ -21,6 +21,8 @@ import (
"strings"
"testing"
"vitess.io/vitess/go/test/utils"
"context"
"github.com/golang/protobuf/proto"
@ -207,9 +209,7 @@ func TestVTGateStreamExecute(t *testing.T) {
}, {
Rows: sandboxconn.StreamRowResult.Rows,
}}
if !reflect.DeepEqual(want, qrs) {
t.Errorf("want \n%+v, got \n%+v", want, qrs)
}
utils.MustMatch(t, want, qrs)
if !proto.Equal(sbc.Options[0], executeOptions) {
t.Errorf("got ExecuteOptions \n%+v, want \n%+v", sbc.Options[0], executeOptions)
}

Просмотреть файл

@ -0,0 +1,331 @@
package grpctabletconn
import (
"context"
"fmt"
"math/rand"
"net"
"sort"
"testing"
"google.golang.org/grpc"
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/callerid"
binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata"
querypb "vitess.io/vitess/go/vt/proto/query"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
"vitess.io/vitess/go/vt/vttablet/grpcqueryservice"
"vitess.io/vitess/go/vt/vttablet/tabletconn"
"vitess.io/vitess/go/vt/vttablet/tabletconntest"
)
type BenchmarkService struct {
t testing.TB
batchResult []sqltypes.Result
}
func (b *BenchmarkService) Begin(ctx context.Context, target *querypb.Target, options *querypb.ExecuteOptions) (int64, *topodatapb.TabletAlias, error) {
panic("should not be called")
}
func (b *BenchmarkService) Commit(ctx context.Context, target *querypb.Target, transactionID int64) (int64, error) {
panic("should not be called")
}
func (b *BenchmarkService) Rollback(ctx context.Context, target *querypb.Target, transactionID int64) (int64, error) {
panic("should not be called")
}
func (b *BenchmarkService) Prepare(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error) {
panic("should not be called")
}
func (b *BenchmarkService) CommitPrepared(ctx context.Context, target *querypb.Target, dtid string) (err error) {
panic("should not be called")
}
func (b *BenchmarkService) RollbackPrepared(ctx context.Context, target *querypb.Target, dtid string, originalID int64) (err error) {
panic("should not be called")
}
func (b *BenchmarkService) CreateTransaction(ctx context.Context, target *querypb.Target, dtid string, participants []*querypb.Target) (err error) {
panic("should not be called")
}
func (b *BenchmarkService) StartCommit(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error) {
panic("should not be called")
}
func (b *BenchmarkService) SetRollback(ctx context.Context, target *querypb.Target, dtid string, transactionID int64) (err error) {
panic("should not be called")
}
func (b *BenchmarkService) ConcludeTransaction(ctx context.Context, target *querypb.Target, dtid string) (err error) {
panic("should not be called")
}
func (b *BenchmarkService) ReadTransaction(ctx context.Context, target *querypb.Target, dtid string) (metadata *querypb.TransactionMetadata, err error) {
panic("should not be called")
}
func (b *BenchmarkService) Execute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]*querypb.BindVariable, transactionID, reservedID int64, options *querypb.ExecuteOptions) (*sqltypes.Result, error) {
panic("should not be called")
}
func (b *BenchmarkService) StreamExecute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]*querypb.BindVariable, transactionID int64, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) error {
panic("should not be called")
}
func (b *BenchmarkService) ExecuteBatch(ctx context.Context, target *querypb.Target, queries []*querypb.BoundQuery, asTransaction bool, transactionID int64, options *querypb.ExecuteOptions) ([]sqltypes.Result, error) {
return b.batchResult, nil
}
func (b *BenchmarkService) BeginExecute(ctx context.Context, target *querypb.Target, preQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, reservedID int64, options *querypb.ExecuteOptions) (*sqltypes.Result, int64, *topodatapb.TabletAlias, error) {
panic("should not be called")
}
func (b *BenchmarkService) BeginExecuteBatch(ctx context.Context, target *querypb.Target, queries []*querypb.BoundQuery, asTransaction bool, options *querypb.ExecuteOptions) ([]sqltypes.Result, int64, *topodatapb.TabletAlias, error) {
panic("should not be called")
}
func (b *BenchmarkService) MessageStream(ctx context.Context, target *querypb.Target, name string, callback func(*sqltypes.Result) error) error {
panic("should not be called")
}
func (b *BenchmarkService) MessageAck(ctx context.Context, target *querypb.Target, name string, ids []*querypb.Value) (count int64, err error) {
panic("should not be called")
}
func (b *BenchmarkService) VStream(ctx context.Context, target *querypb.Target, startPos string, tableLastPKs []*binlogdatapb.TableLastPK, filter *binlogdatapb.Filter, send func([]*binlogdatapb.VEvent) error) error {
panic("should not be called")
}
func (b *BenchmarkService) VStreamRows(ctx context.Context, target *querypb.Target, query string, lastpk *querypb.QueryResult, send func(*binlogdatapb.VStreamRowsResponse) error) error {
panic("should not be called")
}
func (b *BenchmarkService) VStreamResults(ctx context.Context, target *querypb.Target, query string, send func(*binlogdatapb.VStreamResultsResponse) error) error {
panic("should not be called")
}
func (b *BenchmarkService) StreamHealth(ctx context.Context, callback func(*querypb.StreamHealthResponse) error) error {
panic("should not be called")
}
func (b *BenchmarkService) HandlePanic(err *error) {
if x := recover(); x != nil {
*err = fmt.Errorf("caught test panic: %v", x)
}
}
func (b *BenchmarkService) ReserveBeginExecute(ctx context.Context, target *querypb.Target, preQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (*sqltypes.Result, int64, int64, *topodatapb.TabletAlias, error) {
panic("should not be called")
}
func (b *BenchmarkService) ReserveExecute(ctx context.Context, target *querypb.Target, preQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, transactionID int64, options *querypb.ExecuteOptions) (*sqltypes.Result, int64, *topodatapb.TabletAlias, error) {
panic("should not be called")
}
func (b *BenchmarkService) Release(ctx context.Context, target *querypb.Target, transactionID, reservedID int64) error {
panic("should not be called")
}
func (b *BenchmarkService) Close(ctx context.Context) error {
panic("should not be called")
}
type generator struct {
n int
r *rand.Rand
tt []querypb.Type
}
func (gen *generator) randomString(min, max int) string {
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
n := min + gen.r.Intn(max-min)
b := make([]byte, n)
for i := range b {
b[i] = letters[gen.r.Intn(len(letters))]
}
return string(b)
}
func (gen *generator) generateBindVar(tt int) interface{} {
if gen.n < 0 {
return nil
}
gen.n--
switch tt {
case 0:
return gen.randomString(1, 256)
case 1:
return gen.r.Float64()
case 2:
return gen.r.Uint64()
case 3:
return gen.r.Int63()
case 4, 5, 6, 7:
var (
ary []interface{}
l = gen.r.Intn(32)
)
for i := 0; i < l && gen.n > 0; i++ {
ary = append(ary, gen.generateBindVar(tt-4))
}
return ary
default:
panic("unreachable")
}
}
func (gen *generator) generateBindVars() map[string]*querypb.BindVariable {
bv := make(map[string]*querypb.BindVariable)
c := gen.r.Intn(128)
for i := 0; i < c && gen.n > 0; i++ {
tt := gen.r.Intn(8)
v, err := sqltypes.BuildBindVariable(gen.generateBindVar(tt))
if err != nil {
panic(err)
}
bv[fmt.Sprintf("bind%d", i)] = v
}
return bv
}
func (gen *generator) generateBoundQuery() (bq []*querypb.BoundQuery) {
for gen.n > 0 {
q := &querypb.BoundQuery{
Sql: gen.randomString(32, 1024),
BindVariables: gen.generateBindVars(),
}
gen.n--
bq = append(bq, q)
}
return
}
func (gen *generator) generateType() querypb.Type {
if len(gen.tt) == 0 {
for _, tt := range querypb.Type_value {
gen.tt = append(gen.tt, querypb.Type(tt))
}
sort.Slice(gen.tt, func(i, j int) bool {
return gen.tt[i] < gen.tt[j]
})
}
return gen.tt[gen.r.Intn(len(gen.tt))]
}
func (gen *generator) generateRows() (fields []*querypb.Field, rows [][]sqltypes.Value) {
fieldCount := 1 + gen.r.Intn(16)
for i := 0; i < fieldCount; i++ {
fields = append(fields, &querypb.Field{
Name: fmt.Sprintf("field%d", i),
Type: gen.generateType(),
})
}
for gen.n > 0 {
var row []sqltypes.Value
for _, f := range fields {
row = append(row, sqltypes.TestValue(f.Type, gen.randomString(8, 32)))
gen.n--
}
rows = append(rows, row)
}
return
}
func (gen *generator) generateQueryResultList() (qrl []sqltypes.Result) {
for gen.n > 0 {
fields, rows := gen.generateRows()
r := sqltypes.Result{
Fields: fields,
RowsAffected: gen.r.Uint64(),
InsertID: gen.r.Uint64(),
Rows: rows,
}
gen.n--
qrl = append(qrl, r)
}
return
}
func BenchmarkGRPCTabletConn(b *testing.B) {
// fake service
service := &BenchmarkService{
t: b,
}
// listen on a random port
listener, err := net.Listen("tcp", ":0")
if err != nil {
b.Fatalf("Cannot listen: %v", err)
}
host := listener.Addr().(*net.TCPAddr).IP.String()
port := listener.Addr().(*net.TCPAddr).Port
// Create a gRPC server and listen on the port
server := grpc.NewServer()
grpcqueryservice.Register(server, service)
go server.Serve(listener)
tablet := &topodatapb.Tablet{
Keyspace: tabletconntest.TestTarget.Keyspace,
Shard: tabletconntest.TestTarget.Shard,
Type: tabletconntest.TestTarget.TabletType,
Alias: tabletconntest.TestAlias,
Hostname: host,
PortMap: map[string]int32{
"grpc": int32(port),
},
}
var querySizes = []int{8, 64, 512, 4096, 32768}
var requests = make(map[int][]*querypb.BoundQuery)
var responses = make(map[int][]sqltypes.Result)
for _, size := range querySizes {
gen := &generator{
n: size,
r: rand.New(rand.NewSource(int64(0x33333 ^ size))),
}
requests[size] = gen.generateBoundQuery()
gen = &generator{
n: size,
r: rand.New(rand.NewSource(int64(0x44444 ^ size))),
}
responses[size] = gen.generateQueryResultList()
}
for _, reqSize := range querySizes {
for _, respSize := range querySizes {
b.Run(fmt.Sprintf("Req%d-Resp%d", reqSize, respSize), func(b *testing.B) {
conn, err := tabletconn.GetDialer()(tablet, false)
if err != nil {
b.Fatalf("dial failed: %v", err)
}
defer conn.Close(context.Background())
requestQuery := requests[reqSize]
service.batchResult = responses[respSize]
b.SetParallelism(4)
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
ctx := context.Background()
ctx = callerid.NewContext(ctx, tabletconntest.TestCallerID, tabletconntest.TestVTGateCallerID)
_, err := conn.ExecuteBatch(ctx, tabletconntest.TestTarget, requestQuery, tabletconntest.TestAsTransaction, tabletconntest.ExecuteBatchTransactionID, tabletconntest.TestExecuteOptions)
if err != nil {
b.Fatalf("ExecuteBatch failed: %v", err)
}
}
})
})
}
}
}

Просмотреть файл

@ -505,7 +505,7 @@ func (sbc *SandboxConn) getNextResult(stmt sqlparser.Statement) *sqltypes.Result
}
if stmt == nil {
// if we didn't get a valid query, we'll assume we need a SELECT
return SingleRowResult
return getSingleRowResult()
}
switch stmt.(type) {
case *sqlparser.Select,
@ -513,7 +513,7 @@ func (sbc *SandboxConn) getNextResult(stmt sqlparser.Statement) *sqltypes.Result
*sqlparser.Show,
sqlparser.Explain,
*sqlparser.OtherRead:
return SingleRowResult
return getSingleRowResult()
case *sqlparser.Set,
sqlparser.DDLStatement,
*sqlparser.AlterVschema,
@ -551,6 +551,25 @@ func (sbc *SandboxConn) StringQueries() []string {
return result
}
// getSingleRowResult is used to get a SingleRowResult but it creates separate fields because some tests change the fields
// If these fields are not created separately then the constants value also changes which leads to some other tests failing later
func getSingleRowResult() *sqltypes.Result {
singleRowResult := &sqltypes.Result{
InsertID: SingleRowResult.InsertID,
StatusFlags: SingleRowResult.StatusFlags,
Rows: SingleRowResult.Rows,
}
for _, field := range SingleRowResult.Fields {
singleRowResult.Fields = append(singleRowResult.Fields, &querypb.Field{
Name: field.Name,
Type: field.Type,
})
}
return singleRowResult
}
// SingleRowResult is returned when there is no pre-stored result.
var SingleRowResult = &sqltypes.Result{
Fields: []*querypb.Field{

Просмотреть файл

@ -39,7 +39,7 @@ import (
// FakeQueryService implements a programmable fake for the query service
// server side.
type FakeQueryService struct {
t *testing.T
t testing.TB
TestingGateway bool
// these fields are used to simulate and synchronize on errors
@ -740,7 +740,7 @@ func (f *FakeQueryService) Release(ctx context.Context, target *querypb.Target,
}
// CreateFakeServer returns the fake server for the tests
func CreateFakeServer(t *testing.T) *FakeQueryService {
func CreateFakeServer(t testing.TB) *FakeQueryService {
return &FakeQueryService{
t: t,
}

Просмотреть файл

@ -719,7 +719,11 @@ func (tsv *TabletServer) Execute(ctx context.Context, target *querypb.Target, sq
if sqltypes.IncludeFieldsOrDefault(options) == querypb.ExecuteOptions_ALL {
for _, f := range result.Fields {
if f.Database != "" {
f.Database = tsv.sm.target.Keyspace
if qre.plan.PlanID == planbuilder.PlanShow {
f.Database = "information_schema"
} else {
f.Database = tsv.sm.target.Keyspace
}
}
}
}

Просмотреть файл

@ -379,7 +379,7 @@ func (wr *Wrangler) cancelHorizontalResharding(ctx context.Context, keyspace, sh
destinationShards[i] = updatedShard
if err := wr.RefreshTabletsByShard(ctx, si, nil, nil); err != nil {
if err := wr.RefreshTabletsByShard(ctx, si, nil); err != nil {
return err
}
}
@ -450,6 +450,8 @@ func (wr *Wrangler) MigrateServedTypes(ctx context.Context, keyspace, shard stri
// refresh
// TODO(b/26388813): Integrate vtctl WaitForDrain here instead of just sleeping.
// Anything that's not a replica will use the RDONLY sleep time.
// Master Migrate performs its own refresh but we will refresh all non master
// tablets after each migration
waitForDrainSleep := *waitForDrainSleepRdonly
if servedType == topodatapb.TabletType_REPLICA {
waitForDrainSleep = *waitForDrainSleepReplica
@ -465,7 +467,7 @@ func (wr *Wrangler) MigrateServedTypes(ctx context.Context, keyspace, shard stri
refreshShards = destinationShards
}
for _, si := range refreshShards {
rec.RecordError(wr.RefreshTabletsByShard(ctx, si, []topodatapb.TabletType{servedType}, cells))
rec.RecordError(wr.RefreshTabletsByShard(ctx, si, cells))
}
return rec.Error()
}
@ -813,6 +815,12 @@ func (wr *Wrangler) masterMigrateServedType(ctx context.Context, keyspace string
}
}
for _, si := range destinationShards {
if err := wr.RefreshTabletsByShard(ctx, si, nil); err != nil {
return err
}
}
event.DispatchUpdate(ev, "finished")
return nil
}
@ -932,7 +940,7 @@ func (wr *Wrangler) updateShardRecords(ctx context.Context, keyspace string, sha
// For 'to' shards, refresh to make them serve.
// The 'from' shards will be refreshed after traffic has migrated.
if !isFrom {
wr.RefreshTabletsByShard(ctx, si, []topodatapb.TabletType{servedType}, cells)
wr.RefreshTabletsByShard(ctx, si, cells)
}
}
return nil
@ -1268,7 +1276,7 @@ func (wr *Wrangler) replicaMigrateServedFrom(ctx context.Context, ki *topo.Keysp
// Now refresh the source servers so they reload their
// blacklisted table list
event.DispatchUpdate(ev, "refreshing sources tablets state so they update their blacklisted tables")
return wr.RefreshTabletsByShard(ctx, sourceShard, []topodatapb.TabletType{servedType}, cells)
return wr.RefreshTabletsByShard(ctx, sourceShard, cells)
}
// masterMigrateServedFrom handles the master migration. The ordering is
@ -1374,10 +1382,8 @@ func (wr *Wrangler) SetKeyspaceServedFrom(ctx context.Context, keyspace string,
return wr.ts.UpdateKeyspace(ctx, ki)
}
// RefreshTabletsByShard calls RefreshState on all the tables of a
// given type in a shard. It would work for the master, but the
// discovery wouldn't be very efficient.
func (wr *Wrangler) RefreshTabletsByShard(ctx context.Context, si *topo.ShardInfo, tabletTypes []topodatapb.TabletType, cells []string) error {
// RefreshTabletsByShard calls RefreshState on all the tablets in a given shard.
func (wr *Wrangler) RefreshTabletsByShard(ctx context.Context, si *topo.ShardInfo, cells []string) error {
wr.Logger().Infof("RefreshTabletsByShard called on shard %v/%v", si.Keyspace(), si.ShardName())
tabletMap, err := wr.ts.GetTabletMapForShardByCell(ctx, si.Keyspace(), si.ShardName(), cells)
switch {
@ -1392,9 +1398,6 @@ func (wr *Wrangler) RefreshTabletsByShard(ctx context.Context, si *topo.ShardInf
// ignore errors in this phase
wg := sync.WaitGroup{}
for _, ti := range tabletMap {
if tabletTypes != nil && !topoproto.IsTypeInList(ti.Type, tabletTypes) {
continue
}
if ti.Hostname == "" {
// The tablet is not running, we don't have the host
// name to connect to, so we just skip this tablet.

Просмотреть файл

@ -1129,7 +1129,7 @@ func (ts *trafficSwitcher) changeTableSourceWrites(ctx context.Context, access a
}); err != nil {
return err
}
return ts.wr.RefreshTabletsByShard(ctx, source.si, nil, nil)
return ts.wr.RefreshTabletsByShard(ctx, source.si, nil)
})
}
@ -1364,7 +1364,7 @@ func (ts *trafficSwitcher) allowTableTargetWrites(ctx context.Context) error {
}); err != nil {
return err
}
return ts.wr.RefreshTabletsByShard(ctx, target.si, nil, nil)
return ts.wr.RefreshTabletsByShard(ctx, target.si, nil)
})
}
@ -1522,7 +1522,7 @@ func (ts *trafficSwitcher) dropSourceBlacklistedTables(ctx context.Context) erro
}); err != nil {
return err
}
return ts.wr.RefreshTabletsByShard(ctx, source.si, nil, nil)
return ts.wr.RefreshTabletsByShard(ctx, source.si, nil)
})
}

Просмотреть файл

@ -22,8 +22,6 @@ option go_package = "vitess.io/vitess/go/vt/proto/vtctldata";
package vtctldata;
import "google/protobuf/duration.proto";
import "logutil.proto";
import "mysqlctl.proto";
import "tabletmanagerdata.proto";
@ -151,6 +149,37 @@ message DeleteTabletsRequest {
message DeleteTabletsResponse {
}
message EmergencyReparentShardRequest {
// Keyspace is the name of the keyspace to perform the Emergency Reparent in.
string keyspace = 1;
// Shard is the name of the shard to perform the Emergency Reparent in.
string shard = 2;
// Optional alias of a tablet that should become the new shard primary. If not
// not specified, the vtctld will select the most up-to-date canditate to
// promote.
topodata.TabletAlias new_primary = 3;
// List of replica aliases to ignore during the Emergency Reparent. The vtctld
// will not attempt to stop replication on these tablets, nor attempt to
// demote any that may think they are the shard primary.
repeated topodata.TabletAlias ignore_replicas = 4;
// WaitReplicasTimeout is the duration of time to wait for replicas to catch
// up in reparenting.
vttime.Duration wait_replicas_timeout = 5;
}
message EmergencyReparentShardResponse {
// Keyspace is the name of the keyspace the Emergency Reparent took place in.
string keyspace = 1;
// Shard is the name of the shard the Emergency Reparent took place in.
string shard = 2;
// PromotedPrimary is the alias of the tablet that was promoted to shard
// primary. If NewPrimary was set in the request, then this will be the same
// alias. Otherwise, it will be the alias of the tablet found to be most
// up-to-date.
topodata.TabletAlias promoted_primary = 3;
repeated logutil.Event events = 4;
}
message GetBackupsRequest {
string keyspace = 1;
string shard = 2;
@ -186,7 +215,7 @@ message GetKeyspacesRequest {
}
message GetKeyspacesResponse {
repeated Keyspace keyspaces = 1;
repeated Keyspace keyspaces = 1;
}
message GetKeyspaceRequest {
@ -273,13 +302,51 @@ message InitShardPrimaryRequest {
string shard = 2;
topodata.TabletAlias primary_elect_tablet_alias = 3;
bool force = 4;
google.protobuf.Duration wait_replicas_timeout = 5;
vttime.Duration wait_replicas_timeout = 5;
}
message InitShardPrimaryResponse {
repeated logutil.Event events = 1;
}
message PlannedReparentShardRequest {
// Keyspace is the name of the keyspace to perform the Planned Reparent in.
string keyspace = 1;
// Shard is the name of the shard to perform teh Planned Reparent in.
string shard = 2;
// NewPrimary is the alias of the tablet to promote to shard primary. If not
// specified, the vtctld will select the most up-to-date candidate to promote.
//
// It is an error to set NewPrimary and AvoidPrimary to the same alias.
topodata.TabletAlias new_primary = 3;
// AvoidPrimary is the alias of the tablet to demote. In other words,
// specifying an AvoidPrimary alias tells the vtctld to promote any replica
// other than this one. A shard whose current primary is not this one is then
// a no-op.
//
// It is an error to set NewPrimary and AvoidPrimary to the same alias.
topodata.TabletAlias avoid_primary = 4;
// WaitReplicasTimeout is the duration of time to wait for replicas to catch
// up in replication both before and after the reparent. The timeout is not
// cumulative across both wait periods, meaning that the replicas have
// WaitReplicasTimeout time to catch up before the reparent, and an additional
// WaitReplicasTimeout time to catch up after the reparent.
vttime.Duration wait_replicas_timeout = 5;
}
message PlannedReparentShardResponse {
// Keyspace is the name of the keyspace the Planned Reparent took place in.
string keyspace = 1;
// Shard is the name of the shard the Planned Reparent took place in.
string shard = 2;
// PromotedPrimary is the alias of the tablet that was promoted to shard
// primary. If NewPrimary was set in the request, then this will be the same
// alias. Otherwise, it will be the alias of the tablet found to be most
// up-to-date.
topodata.TabletAlias promoted_primary = 3;
repeated logutil.Event events = 4;
}
message RemoveKeyspaceCellRequest {
string keyspace = 1;
string cell = 2;
@ -315,6 +382,34 @@ message RemoveShardCellResponse {
// and any deleted Tablet objects here.
}
message ReparentTabletRequest {
// Tablet is the alias of the tablet that should be reparented under the
// current shard primary.
topodata.TabletAlias tablet = 1;
}
message ReparentTabletResponse {
// Keyspace is the name of the keyspace the tablet was reparented in.
string keyspace = 1;
// Shard is the name of the shard the tablet was reparented in.
string shard = 2;
// Primary is the alias of the tablet that the tablet was reparented under.
topodata.TabletAlias primary = 3;
}
message TabletExternallyReparentedRequest {
// Tablet is the alias of the tablet that was promoted externally and should
// be updated to the shard primary in the topo.
topodata.TabletAlias tablet = 1;
}
message TabletExternallyReparentedResponse {
string keyspace = 1;
string shard = 2;
topodata.TabletAlias new_primary = 3;
topodata.TabletAlias old_primary = 4;
}
message Keyspace {
string name = 1;
topodata.Keyspace keyspace = 2;

Просмотреть файл

@ -55,6 +55,9 @@ service Vtctld {
rpc DeleteShards(vtctldata.DeleteShardsRequest) returns (vtctldata.DeleteShardsResponse) {};
// DeleteTablets deletes one or more tablets from the topology.
rpc DeleteTablets(vtctldata.DeleteTabletsRequest) returns (vtctldata.DeleteTabletsResponse) {};
// EmergencyReparentShard reparents the shard to the new primary. It assumes
// the old primary is dead or otherwise not responding.
rpc EmergencyReparentShard(vtctldata.EmergencyReparentShardRequest) returns (vtctldata.EmergencyReparentShardResponse) {};
// FindAllShardsInKeyspace returns a map of shard names to shard references
// for a given keyspace.
rpc FindAllShardsInKeyspace(vtctldata.FindAllShardsInKeyspaceRequest) returns (vtctldata.FindAllShardsInKeyspaceResponse) {};
@ -92,6 +95,14 @@ service Vtctld {
// PlannedReparentShard or EmergencyReparentShard should be used in those
// cases instead.
rpc InitShardPrimary(vtctldata.InitShardPrimaryRequest) returns (vtctldata.InitShardPrimaryResponse) {};
// PlannedReparentShard reparents the shard to the new primary, or away from
// an old primary. Both the old and new primaries need to be reachable and
// running.
//
// **NOTE**: The vtctld will not consider any replicas outside the cell the
// current shard primary is in for promotion unless NewPrimary is explicitly
// provided in the request.
rpc PlannedReparentShard(vtctldata.PlannedReparentShardRequest) returns (vtctldata.PlannedReparentShardResponse) {};
// RemoveKeyspaceCell removes the specified cell from the Cells list for all
// shards in the specified keyspace, as well as from the SrvKeyspace for that
// keyspace in that cell.
@ -99,4 +110,15 @@ service Vtctld {
// RemoveShardCell removes the specified cell from the specified shard's Cells
// list.
rpc RemoveShardCell(vtctldata.RemoveShardCellRequest) returns (vtctldata.RemoveShardCellResponse) {};
// ReparentTablet reparents a tablet to the current primary in the shard. This
// only works if the current replica position matches the last known reparent
// action.
rpc ReparentTablet(vtctldata.ReparentTabletRequest) returns (vtctldata.ReparentTabletResponse) {};
// TabletExternallyReparented changes metadata in the topology server to
// acknowledge a shard primary change performed by an external tool (e.g.
// orchestrator).
//
// See the Reparenting guide for more information:
// https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting.
rpc TabletExternallyReparented(vtctldata.TabletExternallyReparentedRequest) returns (vtctldata.TabletExternallyReparentedResponse) {};
}

Просмотреть файл

@ -28,3 +28,7 @@ message Time {
int32 nanoseconds = 2;
}
message Duration {
int64 seconds = 1;
int32 nanos = 2;
}