diff --git a/go/vt/proto/vtadmin/vtadmin.pb.go b/go/vt/proto/vtadmin/vtadmin.pb.go index 90beb3595b4..3632a1f4748 100644 --- a/go/vt/proto/vtadmin/vtadmin.pb.go +++ b/go/vt/proto/vtadmin/vtadmin.pb.go @@ -1276,10 +1276,11 @@ func (m *GetSchemasResponse) GetSchemas() []*Schema { } type GetSchemaTableSizeOptions struct { - AggregateSizes bool `protobuf:"varint,1,opt,name=aggregate_sizes,json=aggregateSizes,proto3" json:"aggregate_sizes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + AggregateSizes bool `protobuf:"varint,1,opt,name=aggregate_sizes,json=aggregateSizes,proto3" json:"aggregate_sizes,omitempty"` + IncludeNonServingShards bool `protobuf:"varint,2,opt,name=include_non_serving_shards,json=includeNonServingShards,proto3" json:"include_non_serving_shards,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetSchemaTableSizeOptions) Reset() { *m = GetSchemaTableSizeOptions{} } @@ -1322,6 +1323,13 @@ func (m *GetSchemaTableSizeOptions) GetAggregateSizes() bool { return false } +func (m *GetSchemaTableSizeOptions) GetIncludeNonServingShards() bool { + if m != nil { + return m.IncludeNonServingShards + } + return false +} + type GetTabletRequest struct { Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` // ClusterIDs is an optional parameter to narrow the scope of the search, if @@ -1981,99 +1989,101 @@ func init() { func init() { proto.RegisterFile("vtadmin.proto", fileDescriptor_609739e22a0a50b3) } var fileDescriptor_609739e22a0a50b3 = []byte{ - // 1465 bytes of a gzipped FileDescriptorProto + // 1498 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x5f, 0x6f, 0xdb, 0x54, - 0x14, 0xaf,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0x0d, 0x51, 0x13, 0xf4, 0xa9, 0x58, 0xd4, 0xb5, - 0xed, 0xfc, 0x4e, 0xa5, 0xb5, 0xda, 0x10, 0xb8, 0x45, 0x98, 0x19, 0xc7, 0x20, 0x03, 0xca, 0x53, - 0x3b, 0xf0, 0x5c, 0x6f, 0x18, 0xd6, 0x73, 0xdb, 0xf9, 0x1d, 0xdd, 0x94, 0x6b, 0xfc, 0x8f, 0x06, - 0xe5, 0x87, 0xce, 0x2c, 0x1c, 0xdb, 0x7d, 0x07, 0xbd, 0x0d, 0xa5, 0x3e, 0xab, 0x46, 0x61, 0x55, - 0x5a, 0x35, 0x99, 0x97, 0xa3, 0x30, 0x45, 0x00, 0x6a, 0x42, 0xf9, 0x19, 0x7f, 0x8f, 0x22, 0xae, - 0xb4, 0x2e, 0x34, 0xe2, 0xcd, 0x8a, 0x94, 0xa6, 0x0c, 0x42, 0x37, 0xa0, 0x18, 0x1e, 0xda, 0xc1, - 0x20, 0xac, 0xe7, 0x29, 0xe6, 0x4b, 0x32, 0xb7, 0x08, 0x6e, 0x74, 0xa9, 0xff, 0xbe, 0x47, 0x82, - 0x99, 0xc9, 0x83, 0x8d, 0x87, 0x50, 0x51, 0xcc, 0xa8, 0x06, 0xf9, 0x67, 0xce, 0x8c, 0x77, 0x2d, - 0x7a, 0x44, 0x57, 0x60, 0x79, 0x62, 0x8f, 0x8e, 0x05, 0x8a, 0x9a, 0x82, 0x82, 0xbe, 0x68, 0x32, - 0xf7, 0xfb, 0xb9, 0xf7, 0x34, 0xfc, 0x6f, 0x01, 0x8a, 0x5d, 0x7a, 0x3e, 0x67, 0xda, 0xab, 0x91, - 0xda, 0xab, 0xae, 0x6c, 0x6b, 0x0f, 0x56, 0x29, 0x37, 0xac, 0x81, 0xf3, 0xd4, 0xf5, 0x5c, 0xe2, - 0xfa, 0x9e, 0xd8, 0x21, 0x6e, 0x64, 0x59, 0xb3, 0x1f, 0x59, 0x76, 0x65, 0xa8, 0x59, 0x23, 0x49, - 0x43, 0x88, 0x3e, 0x82, 0x0a, 0x4b, 0x18, 0xba, 0x5f, 0x3b, 0x61, 0xbd, 0x40, 0x53, 0x5d, 0x96, - 0xe0, 0x18, 0x7c, 0x96, 0xa7, 0x1b, 0x45, 0xb0, 0x76, 0x01, 0x91, 0x06, 0xe3, 0x0b, 0xa8, 0xa6, - 0xdc, 0x73, 0xda, 0xd6, 0x4c, 0xb6, 0x6d, 0x7d, 0x61, 0x01, 0xa5, 0x7f, 0x46, 0x07, 0x56, 0x68, - 0x4f, 0xa5, 0x13, 0x6d, 0x80, 0x1e, 0xf8, 0x53, 0xab, 0xef, 0x1f, 0x7b, 0x84, 0xa6, 0x2f, 0x98, - 0xe5, 0xc0, 0x9f, 0xde, 0x8b, 0xd6, 0xe8, 0x32, 0x54, 0xa2, 0x4d, 0x5b, 0x23, 0xc7, 0x1b, 0x92, - 0x43, 0x5a, 0xa9, 0x60, 0x42, 0x64, 0xfa, 0x94, 0x5a, 0x8c, 0xbf, 0x35, 0xd0, 0x5f, 0x53, 0x2e, - 0x74, 0x07, 0xca, 0x07, 0x33, 0x8b, 0xb2, 0x86, 0xf7, 0xff, 0xca, 0xc2, 0x3d, 0x35, 0xee, 0xce, - 0xe8, 0x3e, 0x58, 0xef, 0x4a, 0x07, 0x6c, 0x65, 0x3c, 0x81, 0x73, 0xaa, 0x63, 0x4e, 0xd7, 0xae, - 0x27, 0xbb, 0xb6, 0x95, 0xae, 0x90, 0xec, 0x8e, 0x4a, 0xbd, 0xdf, 0x34, 0x28, 0x52, 0x07, 0x39, - 0x13, 0xf5, 0x76, 0xa0, 0xc8, 0x48, 0x24, 0xe9, 0x2d, 0x05, 0x87, 0x65, 0x33, 0xb9, 0x1f, 0xb5, - 0x60, 0x39, 0x24, 0x36, 0x71, 0xea, 0xf9, 0x6d, 0x6d, 0x67, 0xa5, 0xb5, 0x29, 0x73, 0xb2, 0xb8, - 0x46, 0xd7, 0x09, 0x26, 0xae, 0x37, 0xec, 0x46, 0x31,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 0x51, 0xaa, 0x64, 0x76, 0x4a, 0x1b, 0x17, + 0xe6, 0x78, 0x65, 0xba, 0x1b, 0xa0, 0x4b, 0x65, 0x47, 0x6b, 0xf9, 0xf1, 0x72, 0x4c, 0x63, 0x3a, + 0x00, 0xc9, 0x58, 0x51, 0xba, 0x9a, 0x9b, 0x79, 0xc6, 0xfa, 0x4c, 0x5f, 0x06, 0x03, 0xff, 0x19, + 0x92, 0xc2, 0x90, 0x92, 0x7b, 0x23, 0x2b, 0xaa, 0x12, 0x03, 0x97, 0xe3, 0x34, 0x86, 0xb4, 0xb2, + 0xa7, 0x31, 0x64, 0xf4, 0x1b, 0x2f, 0xa0, 0x0f, 0x68, 0xa2, 0x5e, 0x8e, 0x22, 0x39, 0xad, 0x36, + 0x72, 0x7a, 0x28, 0x39, 0x22, 0xd4, 0x34, 0xcd, 0x91, 0x8c, 0x34, 0xa7, 0x39, 0xd2, 0xcb, 0x77, + 0xe3, 0x16, 0xcd, 0x25, 0x2f, 0xd8, 0xeb, 0xb3, 0x14, 0x40, 0xe4, 0xca, 0xff, 0xc3, 0x22, 0x19, + 0x92, 0xfc, 0x33, 0xb3, 0x31, 0x47, 0x43, 0x66, 0x30, 0x24, 0xa7, 0x30, 0x78, 0x01, 0xdd, 0x03, + 0x5d, 0x9e, 0x3c, 0xe5, 0xeb, 0x64, 0x4f, 0xba, 0x61, 0xcc, 0x72, 0x89, 0x2c, 0x77, 0xae, 0xff, + 0xfa, 0x62, 0x53, 0xfb, 0xfd, 0xc5, 0xa6, 0xf6, 0xc7, 0x8b, 0x4d, 0xed, 0xc7, 0xbf, 0x36, 0x17, + 0x9e, 0xbc, 0x31, 0x76, 0x89, 0x13, 0x45, 0x4d, 0x37, 0x68, 0xb1, 0xa7, 0xd6, 0x30, 0x68, 0x8d, + 0x49, 0x8b, 0xfe, 0x23, 0xd5, 0xe2, 0xb9, 0xf6, 0x97, 0xe8, 0xf2, 0xdd, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0xc7, 0xf9, 0x61, 0x16, 0x03, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3723,6 +3733,16 @@ func (m *GetSchemaTableSizeOptions) MarshalToSizedBuffer(dAtA []byte) (int, erro i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.IncludeNonServingShards { + i-- + if m.IncludeNonServingShards { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } if m.AggregateSizes { i-- if m.AggregateSizes { @@ -4737,6 +4757,9 @@ func (m *GetSchemaTableSizeOptions) Size() (n int) { if m.AggregateSizes { n += 2 } + if m.IncludeNonServingShards { + n += 2 + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -7969,6 +7992,26 @@ func (m *GetSchemaTableSizeOptions) Unmarshal(dAtA []byte) error { } } m.AggregateSizes = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeNonServingShards", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtadmin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeNonServingShards = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtadmin(dAtA[iNdEx:]) diff --git a/go/vt/vtadmin/cluster/cluster.go b/go/vt/vtadmin/cluster/cluster.go index 25edbd883d5..a12f7df0257 100644 --- a/go/vt/vtadmin/cluster/cluster.go +++ b/go/vt/vtadmin/cluster/cluster.go @@ -466,18 +466,27 @@ type GetSchemaOptions struct { // each shard. If this option is false, we make exactly one GetSchema request to // a single, randomly-chosen, tablet in the keyspace. // -// (3) We will only make GetSchema RPCs to tablets that are in SERVING state; we -// don't want to use a tablet that might be in a bad state as the source of -// truth for a schema. Therefore if we can't find a SERVING tablet for the -// keyspace (in non-aggregation mode) or for a shard in that keyspace (in -// aggregation mode), then we will return an error back to the caller. +// (2.1) If, in size aggregation mode, opts.SizeOpts.IncludeNonServingShards is +// false (the default), then we will filter out any shards for which +// IsMasterServing is false in the topo, and make GetSchema RPCs to one tablet +// in every _serving_ shard. Otherwise we will make a GetSchema RPC to one +// tablet in _every_ shard. +// +// (3) Irrespective of whether we're including nonserving shards, or whether +// we're doing size aggregation at all, we will only make GetSchema RPCs to +// tablets that are in SERVING state; we don't want to use a tablet that might +// be in a bad state as the source of truth for a schema. Therefore if we can't +// find a SERVING tablet for the keyspace (in non-aggregation mode) or for a +// shard in that keyspace (in aggregation mode), then we will return an error +// back to the caller. func (c *Cluster) GetSchema(ctx context.Context, keyspace string, opts GetSchemaOptions) (*vtadminpb.Schema, error) { span, ctx := trace.NewSpan(ctx, "Cluster.GetSchema") defer span.Finish() if opts.TableSizeOptions == nil { opts.TableSizeOptions = &vtadminpb.GetSchemaTableSizeOptions{ - AggregateSizes: false, + AggregateSizes: false, + IncludeNonServingShards: false, } } @@ -638,9 +647,11 @@ func (c *Cluster) getTabletsToQueryForSchemas(ctx context.Context, keyspace stri // operations will work. In our case, we care about whether the // shard is truly serving, which we define as also having a known // primary (via MasterAlias) in addition to the IsMasterServing bit. - if !(shard.Shard.IsMasterServing && shard.Shard.MasterAlias != nil) { - log.Infof("%s/%s is not serving; ignoring ...", keyspace, shard.Name) - continue + if !shard.Shard.IsMasterServing || shard.Shard.MasterAlias == nil { + if !opts.TableSizeOptions.IncludeNonServingShards { + log.Infof("%s/%s is not serving; ignoring because IncludeNonServingShards = false", keyspace, shard.Name) + continue + } } shardTablets := vtadminproto.FilterTablets(func(tablet *vtadminpb.Tablet) bool { diff --git a/go/vt/vtadmin/cluster/cluster_test.go b/go/vt/vtadmin/cluster/cluster_test.go index 703da92c4e3..ec2e444e150 100644 --- a/go/vt/vtadmin/cluster/cluster_test.go +++ b/go/vt/vtadmin/cluster/cluster_test.go @@ -734,6 +734,174 @@ func TestGetSchema(t *testing.T) { }, shouldErr: false, }, + { + name: "include nonserving shards", + cfg: testutil.TestClusterConfig{ + Cluster: &vtadminpb.Cluster{ + Id: "c0", + Name: "cluster0", + }, + Tablets: []*vtadminpb.Tablet{ + { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Keyspace: "testkeyspace", + Shard: "-80", + }, + State: vtadminpb.Tablet_SERVING, + }, + { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + Keyspace: "testkeyspace", + Shard: "80-", + }, + State: vtadminpb.Tablet_SERVING, + }, + { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 300, + }, + Keyspace: "testkeyspace", + Shard: "-", + }, + State: vtadminpb.Tablet_SERVING, + }, + }, + VtctldClient: &testutil.VtctldClient{ + FindAllShardsInKeyspaceResults: map[string]struct { + Response *vtctldatapb.FindAllShardsInKeyspaceResponse + Error error + }{ + "testkeyspace": { + Response: &vtctldatapb.FindAllShardsInKeyspaceResponse{ + Shards: map[string]*vtctldatapb.Shard{ + "-80": { + Name: "-80", + Shard: &topodatapb.Shard{ + IsMasterServing: true, + }, + }, + "80-": { + Name: "80-", + Shard: &topodatapb.Shard{ + IsMasterServing: true, + }, + }, + "-": { + Name: "-", + Shard: &topodatapb.Shard{ + IsMasterServing: false, + }, + }, + }, + }, + }, + }, + GetSchemaResults: map[string]struct { + Response *vtctldatapb.GetSchemaResponse + Error error + }{ + "zone1-0000000100": { + Response: &vtctldatapb.GetSchemaResponse{ + Schema: &tabletmanagerdatapb.SchemaDefinition{ + DatabaseSchema: "CREATE DATABASE vt_testkeyspcae", + TableDefinitions: []*tabletmanagerdatapb.TableDefinition{ + { + Name: "foo", + Schema: "CREATE TABLE foo (\n\tid INT(11) NOT NULL\n) ENGINE=InnoDB", + DataLength: 100, + RowCount: 5, + }, + }, + }, + }, + }, + "zone1-0000000200": { + Response: &vtctldatapb.GetSchemaResponse{ + Schema: &tabletmanagerdatapb.SchemaDefinition{ + DatabaseSchema: "CREATE DATABASE vt_testkeyspcae", + TableDefinitions: []*tabletmanagerdatapb.TableDefinition{ + { + Name: "foo", + Schema: "CREATE TABLE foo (\n\tid INT(11) NOT NULL\n) ENGINE=InnoDB", + DataLength: 200, + RowCount: 420, + }, + }, + }, + }, + }, + "zone1-0000000300": { + Response: &vtctldatapb.GetSchemaResponse{ + Schema: &tabletmanagerdatapb.SchemaDefinition{ + DatabaseSchema: "CREATE DATABASE vt_testkeyspcae", + TableDefinitions: []*tabletmanagerdatapb.TableDefinition{ + { + Name: "foo", + Schema: "CREATE TABLE foo (\n\tid INT(11) NOT NULL\n) ENGINE=InnoDB", + DataLength: 1000, + RowCount: 200, + }, + }, + }, + }, + }, + }, + }, + }, + keyspace: "testkeyspace", + opts: cluster.GetSchemaOptions{ + TableSizeOptions: &vtadminpb.GetSchemaTableSizeOptions{ + AggregateSizes: true, + IncludeNonServingShards: true, + }, + }, + expected: &vtadminpb.Schema{ + Cluster: &vtadminpb.Cluster{ + Id: "c0", + Name: "cluster0", + }, + Keyspace: "testkeyspace", + TableDefinitions: []*tabletmanagerdatapb.TableDefinition{ + { + Name: "foo", + Schema: "CREATE TABLE foo (\n\tid INT(11) NOT NULL\n) ENGINE=InnoDB", + DataLength: 0, + RowCount: 0, + }, + }, + TableSizes: map[string]*vtadminpb.Schema_TableSize{ + "foo": { + DataLength: 100 + 200 + 1000, + RowCount: 5 + 420 + 200, + ByShard: map[string]*vtadminpb.Schema_ShardTableSize{ + "-80": { + DataLength: 100, + RowCount: 5, + }, + "80-": { + DataLength: 200, + RowCount: 420, + }, + "-": { + DataLength: 1000, + RowCount: 200, + }, + }, + }, + }, + }, + shouldErr: false, + }, { name: "no serving tablets found for shard", cfg: testutil.TestClusterConfig{ diff --git a/go/vt/vtadmin/http/schemas.go b/go/vt/vtadmin/http/schemas.go index d309b5411c4..c08160a62da 100644 --- a/go/vt/vtadmin/http/schemas.go +++ b/go/vt/vtadmin/http/schemas.go @@ -84,7 +84,13 @@ func getTableSizeOpts(r Request) (*vtadminpb.GetSchemaTableSizeOptions, error) { return nil, err } + includeNonServingShards, err := r.ParseQueryParamAsBool("include_non_serving_shards", false) + if err != nil { + return nil, err + } + return &vtadminpb.GetSchemaTableSizeOptions{ - AggregateSizes: aggregateSizes, + AggregateSizes: aggregateSizes, + IncludeNonServingShards: includeNonServingShards, }, nil } diff --git a/go/vt/vtadmin/vtadminproto/trace.go b/go/vt/vtadmin/vtadminproto/trace.go index 7110dd95d0c..6dbb35d7c60 100644 --- a/go/vt/vtadmin/vtadminproto/trace.go +++ b/go/vt/vtadmin/vtadminproto/trace.go @@ -36,4 +36,5 @@ func AnnotateSpanWithGetSchemaTableSizeOptions(opts *vtadminpb.GetSchemaTableSiz } span.Annotate("aggregate_table_sizes", opts.AggregateSizes) + span.Annotate("include_non_serving_shards", opts.IncludeNonServingShards) } diff --git a/proto/vtadmin.proto b/proto/vtadmin.proto index 3b8ee1a9112..c6669febd81 100644 --- a/proto/vtadmin.proto +++ b/proto/vtadmin.proto @@ -212,6 +212,7 @@ message GetSchemasResponse { message GetSchemaTableSizeOptions { bool aggregate_sizes = 1; + bool include_non_serving_shards = 2; } message GetTabletRequest { diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index dd7940efce8..e8784ca2b85 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -2363,6 +2363,9 @@ export namespace vtadmin { /** GetSchemaTableSizeOptions aggregate_sizes */ aggregate_sizes?: (boolean|null); + + /** GetSchemaTableSizeOptions include_non_serving_shards */ + include_non_serving_shards?: (boolean|null); } /** Represents a GetSchemaTableSizeOptions. */ @@ -2377,6 +2380,9 @@ export namespace vtadmin { /** GetSchemaTableSizeOptions aggregate_sizes. */ public aggregate_sizes: boolean; + /** GetSchemaTableSizeOptions include_non_serving_shards. */ + public include_non_serving_shards: boolean; + /** * Creates a new GetSchemaTableSizeOptions instance using the specified properties. * @param [properties] Properties to set diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index cb5a8c16b13..5f43f35006f 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -5511,6 +5511,7 @@ $root.vtadmin = (function() { * @memberof vtadmin * @interface IGetSchemaTableSizeOptions * @property {boolean|null} [aggregate_sizes] GetSchemaTableSizeOptions aggregate_sizes + * @property {boolean|null} [include_non_serving_shards] GetSchemaTableSizeOptions include_non_serving_shards */ /** @@ -5536,6 +5537,14 @@ $root.vtadmin = (function() { */ GetSchemaTableSizeOptions.prototype.aggregate_sizes = false; + /** + * GetSchemaTableSizeOptions include_non_serving_shards. + * @member {boolean} include_non_serving_shards + * @memberof vtadmin.GetSchemaTableSizeOptions + * @instance + */ + GetSchemaTableSizeOptions.prototype.include_non_serving_shards = false; + /** * Creates a new GetSchemaTableSizeOptions instance using the specified properties. * @function create @@ -5562,6 +5571,8 @@ $root.vtadmin = (function() { writer = $Writer.create(); if (message.aggregate_sizes != null && Object.hasOwnProperty.call(message, "aggregate_sizes")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.aggregate_sizes); + if (message.include_non_serving_shards != null && Object.hasOwnProperty.call(message, "include_non_serving_shards")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.include_non_serving_shards); return writer; }; @@ -5599,6 +5610,9 @@ $root.vtadmin = (function() { case 1: message.aggregate_sizes = reader.bool(); break; + case 2: + message.include_non_serving_shards = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -5637,6 +5651,9 @@ $root.vtadmin = (function() { if (message.aggregate_sizes != null && message.hasOwnProperty("aggregate_sizes")) if (typeof message.aggregate_sizes !== "boolean") return "aggregate_sizes: boolean expected"; + if (message.include_non_serving_shards != null && message.hasOwnProperty("include_non_serving_shards")) + if (typeof message.include_non_serving_shards !== "boolean") + return "include_non_serving_shards: boolean expected"; return null; }; @@ -5654,6 +5671,8 @@ $root.vtadmin = (function() { var message = new $root.vtadmin.GetSchemaTableSizeOptions(); if (object.aggregate_sizes != null) message.aggregate_sizes = Boolean(object.aggregate_sizes); + if (object.include_non_serving_shards != null) + message.include_non_serving_shards = Boolean(object.include_non_serving_shards); return message; }; @@ -5670,10 +5689,14 @@ $root.vtadmin = (function() { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.aggregate_sizes = false; + object.include_non_serving_shards = false; + } if (message.aggregate_sizes != null && message.hasOwnProperty("aggregate_sizes")) object.aggregate_sizes = message.aggregate_sizes; + if (message.include_non_serving_shards != null && message.hasOwnProperty("include_non_serving_shards")) + object.include_non_serving_shards = message.include_non_serving_shards; return object; };