From 06a7816577c4625ddfe24bad6ae6a7225141db4c Mon Sep 17 00:00:00 2001 From: junot Date: Tue, 6 Dec 2022 16:21:31 +0800 Subject: [PATCH] Query: Allow to ignore No StoreAPIs matched error Signed-off-by: junot --- cmd/thanos/query.go | 6 + docs/components/query.md | 4 + pkg/api/query/grpc.go | 2 + pkg/api/query/querypb/query.pb.go | 212 ++++++++++++++++++++---------- pkg/api/query/querypb/query.proto | 4 + pkg/api/query/v1.go | 66 ++++++++-- pkg/query/querier.go | 110 +++++++++------- pkg/query/querier_test.go | 10 +- pkg/query/query_test.go | 1 + pkg/store/proxy.go | 4 + pkg/store/proxy_test.go | 10 ++ pkg/store/storepb/rpc.pb.go | 203 ++++++++++++++++------------ pkg/store/storepb/rpc.proto | 3 + 13 files changed, 416 insertions(+), 219 deletions(-) diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index 8aa6d28bf6b..0b965f9279d 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -174,6 +174,9 @@ func registerQuery(app *extkingpin.App) { enableQueryPartialResponse := cmd.Flag("query.partial-response", "Enable partial response for queries if no partial_response param is specified. --no-query.partial-response for disabling."). Default("true").Bool() + enableQueryIgnoreNoStoresMatched := cmd.Flag("query.ignore-no-stores-matched", "Enable to ignore no StoreAPIs matched error for queries if no ignore_no_stores_matched param is specified."). + Default("false").Bool() + enableRulePartialResponse := cmd.Flag("rule.partial-response", "Enable partial response for rules endpoint. --no-rule.partial-response for disabling."). Hidden().Default("true").Bool() @@ -298,6 +301,7 @@ func registerQuery(app *extkingpin.App) { *exemplarEndpoints, *enableAutodownsampling, *enableQueryPartialResponse, + *enableQueryIgnoreNoStoresMatched, *enableRulePartialResponse, *enableTargetPartialResponse, *enableMetricMetadataPartialResponse, @@ -374,6 +378,7 @@ func runQuery( exemplarAddrs []string, enableAutodownsampling bool, enableQueryPartialResponse bool, + enableQueryIgnoreNoStoresMatched bool, enableRulePartialResponse bool, enableTargetPartialResponse bool, enableMetricMetadataPartialResponse bool, @@ -685,6 +690,7 @@ func runQuery( exemplars.NewGRPCClientWithDedup(exemplarsProxy, queryReplicaLabels), enableAutodownsampling, enableQueryPartialResponse, + enableQueryIgnoreNoStoresMatched, enableRulePartialResponse, enableTargetPartialResponse, enableMetricMetadataPartialResponse, diff --git a/docs/components/query.md b/docs/components/query.md index 9de81aab5a2..a841debc8c5 100644 --- a/docs/components/query.md +++ b/docs/components/query.md @@ -358,6 +358,10 @@ Flags: = max(rangeSeconds / 250, defaultStep)). This will not work from Grafana, but Grafana has __step variable which can be used. + --query.ignore-no-stores-matched + Enable to ignore no StoreAPIs matched error for + queries if no ignore_no_stores_matched param is + specified. --query.lookback-delta=QUERY.LOOKBACK-DELTA The maximum lookback duration for retrieving metrics during expression evaluations. diff --git a/pkg/api/query/grpc.go b/pkg/api/query/grpc.go index 8848cd2ffee..ff5795df8fb 100644 --- a/pkg/api/query/grpc.go +++ b/pkg/api/query/grpc.go @@ -91,6 +91,7 @@ func (g *GRPCAPI) Query(request *querypb.QueryRequest, server querypb.Query_Quer storeMatchers, maxResolution, request.EnablePartialResponse, + request.EnableIgnoreNoStoresMatched, request.EnableQueryPushdown, false, request.ShardInfo, @@ -166,6 +167,7 @@ func (g *GRPCAPI) QueryRange(request *querypb.QueryRangeRequest, srv querypb.Que storeMatchers, maxResolution, request.EnablePartialResponse, + request.EnableIgnoreNoStoresMatched, request.EnableQueryPushdown, false, request.ShardInfo, diff --git a/pkg/api/query/querypb/query.pb.go b/pkg/api/query/querypb/query.pb.go index b729ba8eb8e..4e0a50319dc 100644 --- a/pkg/api/query/querypb/query.pb.go +++ b/pkg/api/query/querypb/query.pb.go @@ -31,18 +31,19 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type QueryRequest struct { - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - TimeSeconds int64 `protobuf:"varint,2,opt,name=time_seconds,json=timeSeconds,proto3" json:"time_seconds,omitempty"` - TimeoutSeconds int64 `protobuf:"varint,3,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` - MaxResolutionSeconds int64 `protobuf:"varint,4,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` - ReplicaLabels []string `protobuf:"bytes,5,rep,name=replica_labels,json=replicaLabels,proto3" json:"replica_labels,omitempty"` - StoreMatchers []StoreMatchers `protobuf:"bytes,6,rep,name=storeMatchers,proto3" json:"storeMatchers"` - EnableDedup bool `protobuf:"varint,7,opt,name=enableDedup,proto3" json:"enableDedup,omitempty"` - EnablePartialResponse bool `protobuf:"varint,8,opt,name=enablePartialResponse,proto3" json:"enablePartialResponse,omitempty"` - EnableQueryPushdown bool `protobuf:"varint,9,opt,name=enableQueryPushdown,proto3" json:"enableQueryPushdown,omitempty"` - SkipChunks bool `protobuf:"varint,10,opt,name=skipChunks,proto3" json:"skipChunks,omitempty"` - ShardInfo *storepb.ShardInfo `protobuf:"bytes,11,opt,name=shard_info,json=shardInfo,proto3" json:"shard_info,omitempty"` - LookbackDeltaSeconds int64 `protobuf:"varint,12,opt,name=lookback_delta_seconds,json=lookbackDeltaSeconds,proto3" json:"lookback_delta_seconds,omitempty"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + TimeSeconds int64 `protobuf:"varint,2,opt,name=time_seconds,json=timeSeconds,proto3" json:"time_seconds,omitempty"` + TimeoutSeconds int64 `protobuf:"varint,3,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` + MaxResolutionSeconds int64 `protobuf:"varint,4,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` + ReplicaLabels []string `protobuf:"bytes,5,rep,name=replica_labels,json=replicaLabels,proto3" json:"replica_labels,omitempty"` + StoreMatchers []StoreMatchers `protobuf:"bytes,6,rep,name=storeMatchers,proto3" json:"storeMatchers"` + EnableDedup bool `protobuf:"varint,7,opt,name=enableDedup,proto3" json:"enableDedup,omitempty"` + EnablePartialResponse bool `protobuf:"varint,8,opt,name=enablePartialResponse,proto3" json:"enablePartialResponse,omitempty"` + EnableQueryPushdown bool `protobuf:"varint,9,opt,name=enableQueryPushdown,proto3" json:"enableQueryPushdown,omitempty"` + SkipChunks bool `protobuf:"varint,10,opt,name=skipChunks,proto3" json:"skipChunks,omitempty"` + ShardInfo *storepb.ShardInfo `protobuf:"bytes,11,opt,name=shard_info,json=shardInfo,proto3" json:"shard_info,omitempty"` + LookbackDeltaSeconds int64 `protobuf:"varint,12,opt,name=lookback_delta_seconds,json=lookbackDeltaSeconds,proto3" json:"lookback_delta_seconds,omitempty"` + EnableIgnoreNoStoresMatched bool `protobuf:"varint,13,opt,name=enableIgnoreNoStoresMatched,proto3" json:"enableIgnoreNoStoresMatched,omitempty"` } func (m *QueryRequest) Reset() { *m = QueryRequest{} } @@ -201,20 +202,21 @@ func (*QueryResponse) XXX_OneofWrappers() []interface{} { } type QueryRangeRequest struct { - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - StartTimeSeconds int64 `protobuf:"varint,2,opt,name=start_time_seconds,json=startTimeSeconds,proto3" json:"start_time_seconds,omitempty"` - EndTimeSeconds int64 `protobuf:"varint,3,opt,name=end_time_seconds,json=endTimeSeconds,proto3" json:"end_time_seconds,omitempty"` - IntervalSeconds int64 `protobuf:"varint,4,opt,name=interval_seconds,json=intervalSeconds,proto3" json:"interval_seconds,omitempty"` - TimeoutSeconds int64 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` - MaxResolutionSeconds int64 `protobuf:"varint,6,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` - ReplicaLabels []string `protobuf:"bytes,7,rep,name=replica_labels,json=replicaLabels,proto3" json:"replica_labels,omitempty"` - StoreMatchers []StoreMatchers `protobuf:"bytes,8,rep,name=storeMatchers,proto3" json:"storeMatchers"` - EnableDedup bool `protobuf:"varint,9,opt,name=enableDedup,proto3" json:"enableDedup,omitempty"` - EnablePartialResponse bool `protobuf:"varint,10,opt,name=enablePartialResponse,proto3" json:"enablePartialResponse,omitempty"` - EnableQueryPushdown bool `protobuf:"varint,11,opt,name=enableQueryPushdown,proto3" json:"enableQueryPushdown,omitempty"` - SkipChunks bool `protobuf:"varint,12,opt,name=skipChunks,proto3" json:"skipChunks,omitempty"` - ShardInfo *storepb.ShardInfo `protobuf:"bytes,13,opt,name=shard_info,json=shardInfo,proto3" json:"shard_info,omitempty"` - LookbackDeltaSeconds int64 `protobuf:"varint,14,opt,name=lookback_delta_seconds,json=lookbackDeltaSeconds,proto3" json:"lookback_delta_seconds,omitempty"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + StartTimeSeconds int64 `protobuf:"varint,2,opt,name=start_time_seconds,json=startTimeSeconds,proto3" json:"start_time_seconds,omitempty"` + EndTimeSeconds int64 `protobuf:"varint,3,opt,name=end_time_seconds,json=endTimeSeconds,proto3" json:"end_time_seconds,omitempty"` + IntervalSeconds int64 `protobuf:"varint,4,opt,name=interval_seconds,json=intervalSeconds,proto3" json:"interval_seconds,omitempty"` + TimeoutSeconds int64 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` + MaxResolutionSeconds int64 `protobuf:"varint,6,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` + ReplicaLabels []string `protobuf:"bytes,7,rep,name=replica_labels,json=replicaLabels,proto3" json:"replica_labels,omitempty"` + StoreMatchers []StoreMatchers `protobuf:"bytes,8,rep,name=storeMatchers,proto3" json:"storeMatchers"` + EnableDedup bool `protobuf:"varint,9,opt,name=enableDedup,proto3" json:"enableDedup,omitempty"` + EnablePartialResponse bool `protobuf:"varint,10,opt,name=enablePartialResponse,proto3" json:"enablePartialResponse,omitempty"` + EnableQueryPushdown bool `protobuf:"varint,11,opt,name=enableQueryPushdown,proto3" json:"enableQueryPushdown,omitempty"` + SkipChunks bool `protobuf:"varint,12,opt,name=skipChunks,proto3" json:"skipChunks,omitempty"` + ShardInfo *storepb.ShardInfo `protobuf:"bytes,13,opt,name=shard_info,json=shardInfo,proto3" json:"shard_info,omitempty"` + LookbackDeltaSeconds int64 `protobuf:"varint,14,opt,name=lookback_delta_seconds,json=lookbackDeltaSeconds,proto3" json:"lookback_delta_seconds,omitempty"` + EnableIgnoreNoStoresMatched bool `protobuf:"varint,15,opt,name=enableIgnoreNoStoresMatched,proto3" json:"enableIgnoreNoStoresMatched,omitempty"` } func (m *QueryRangeRequest) Reset() { *m = QueryRangeRequest{} } @@ -346,51 +348,53 @@ func init() { func init() { proto.RegisterFile("api/query/querypb/query.proto", fileDescriptor_4b2aba43925d729f) } var fileDescriptor_4b2aba43925d729f = []byte{ - // 692 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x6e, 0xd3, 0x40, - 0x18, 0x8c, 0x49, 0x93, 0x26, 0x5f, 0x92, 0xfe, 0x2c, 0x29, 0xb8, 0x01, 0x8c, 0x89, 0x54, 0x11, - 0x24, 0x94, 0x54, 0xa1, 0xe2, 0x86, 0x04, 0xa5, 0x48, 0x45, 0x2a, 0x52, 0xeb, 0xf6, 0xc4, 0x25, - 0xda, 0xc4, 0xdb, 0xc4, 0x8a, 0xb3, 0xeb, 0xee, 0xae, 0xfb, 0x23, 0xee, 0x70, 0xe5, 0x19, 0x78, - 0x9a, 0x1e, 0x7b, 0xe4, 0x84, 0xa0, 0x7d, 0x11, 0xe4, 0xf5, 0x0f, 0x76, 0x15, 0x95, 0x96, 0x4a, - 0x5c, 0x5c, 0xef, 0xcc, 0x7c, 0xdd, 0xf5, 0x64, 0x46, 0x0b, 0x8f, 0xb0, 0xe7, 0x74, 0x0e, 0x7c, - 0xc2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, 0x23, 0x77, 0x7a, 0x6e, 0x68, 0x67, 0xe7, 0x86, 0xf6, 0xf3, 0xdc, - 0xd0, 0xbe, 0x5e, 0x18, 0xb9, 0xb3, 0x0b, 0x23, 0xf7, 0xfd, 0xc2, 0xc8, 0x7d, 0x9c, 0x8d, 0xae, - 0xc9, 0x7e, 0x51, 0xdd, 0x56, 0x2f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x8f, 0xd7, 0xf7, - 0x42, 0x07, 0x00, 0x00, + // 722 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0x5b, 0x4f, 0xdb, 0x48, + 0x14, 0xc7, 0xe3, 0x0d, 0x09, 0xc9, 0x49, 0xc2, 0x65, 0x36, 0xec, 0x9a, 0xb0, 0xeb, 0xf5, 0x46, + 0x42, 0x9b, 0x95, 0x56, 0x09, 0xca, 0xa2, 0xbe, 0x55, 0xa2, 0x94, 0x4a, 0x20, 0xd1, 0x0a, 0x0c, + 0x4f, 0x7d, 0x89, 0x26, 0xf1, 0x90, 0x58, 0x71, 0x66, 0xcc, 0xcc, 0x98, 0x8b, 0xfa, 0xde, 0xe7, + 0x7e, 0x2c, 0xfa, 0xc6, 0x63, 0x9f, 0xaa, 0x16, 0xfa, 0x41, 0x2a, 0x8f, 0x2f, 0xb5, 0x51, 0xc4, + 0x55, 0xea, 0x8b, 0x33, 0x73, 0xfe, 0xff, 0x13, 0x1f, 0x9f, 0x39, 0x3f, 0x0d, 0xfc, 0x89, 0x3d, + 0xa7, 0x73, 0xec, 0x13, 0x7e, 0x1e, 0x3e, 0xbd, 0x7e, 0xf8, 0xdb, 0xf6, 0x38, 0x93, 0x0c, 0x15, + 0xe5, 0x08, 0x53, 0x26, 0x1a, 0xf5, 0x21, 0x1b, 0x32, 0x15, 0xea, 0x04, 0xab, 0x50, 0x6d, 0x2c, + 0x0b, 0xc9, 0x38, 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, 0x55, 0xb2, 0xd2, 0x21, 0xb4, 0x0e, 0x4b, + 0xe1, 0x76, 0x0f, 0x73, 0xe9, 0x60, 0xd7, 0x22, 0xc2, 0x63, 0x54, 0x10, 0xbd, 0xa4, 0xbc, 0xd3, + 0x45, 0xb4, 0x06, 0xbf, 0x86, 0x82, 0xea, 0xf7, 0x9e, 0x2f, 0x46, 0x36, 0x3b, 0xa5, 0x7a, 0x59, + 0xe5, 0x4c, 0x93, 0x90, 0x01, 0x20, 0xc6, 0x8e, 0xf7, 0x72, 0xe4, 0xd3, 0xb1, 0xd0, 0x41, 0x19, + 0x53, 0x11, 0xb4, 0x06, 0x20, 0x46, 0x98, 0xdb, 0x3d, 0x87, 0x1e, 0x31, 0xbd, 0x62, 0x6a, 0xad, + 0x4a, 0x77, 0x31, 0xf9, 0xd2, 0x40, 0xd9, 0xa1, 0x47, 0xcc, 0x2a, 0x8b, 0x78, 0x19, 0xf4, 0xde, + 0x65, 0x6c, 0xdc, 0xc7, 0x83, 0x71, 0xcf, 0x26, 0xae, 0xc4, 0x49, 0xef, 0xab, 0x61, 0xef, 0x63, + 0x75, 0x2b, 0x10, 0xe3, 0xde, 0x6f, 0xc0, 0x4a, 0x58, 0xde, 0xce, 0x90, 0x32, 0x4e, 0xde, 0x30, + 0xd5, 0x45, 0x11, 0x76, 0xcc, 0xd6, 0x6b, 0xaa, 0xb0, 0xdb, 0x2c, 0xcd, 0x7d, 0xa8, 0x65, 0x3a, + 0x8f, 0x36, 0xa0, 0xa6, 0x8e, 0x31, 0x39, 0x27, 0x4d, 0x9d, 0x53, 0x3d, 0xae, 0x7e, 0x37, 0x25, + 0xc6, 0xc7, 0x94, 0x49, 0x68, 0x9e, 0x40, 0x2d, 0x1a, 0xdc, 0xa8, 0xbf, 0x7f, 0x40, 0xe9, 0x14, + 0x73, 0xea, 0xd0, 0xa1, 0x08, 0x87, 0x77, 0x3b, 0x67, 0x25, 0x11, 0xf4, 0x1c, 0x20, 0x98, 0x43, + 0x41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xed, 0xf2, 0xca, 0xd0, 0xbe, 0x5c, 0x19, 0xda, 0x87, + 0x6b, 0x23, 0x77, 0x79, 0x6d, 0xe4, 0x3e, 0x5d, 0x1b, 0xb9, 0xb7, 0xb3, 0xd1, 0x55, 0xdd, 0x2f, + 0xaa, 0x1b, 0xf3, 0xff, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x37, 0x2d, 0xa3, 0x87, 0xc6, 0x07, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -583,6 +587,16 @@ func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.EnableIgnoreNoStoresMatched { + i-- + if m.EnableIgnoreNoStoresMatched { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } if m.LookbackDeltaSeconds != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.LookbackDeltaSeconds)) i-- @@ -812,6 +826,16 @@ func (m *QueryRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.EnableIgnoreNoStoresMatched { + i-- + if m.EnableIgnoreNoStoresMatched { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } if m.LookbackDeltaSeconds != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.LookbackDeltaSeconds)) i-- @@ -1055,6 +1079,9 @@ func (m *QueryRequest) Size() (n int) { if m.LookbackDeltaSeconds != 0 { n += 1 + sovQuery(uint64(m.LookbackDeltaSeconds)) } + if m.EnableIgnoreNoStoresMatched { + n += 2 + } return n } @@ -1163,6 +1190,9 @@ func (m *QueryRangeRequest) Size() (n int) { if m.LookbackDeltaSeconds != 0 { n += 1 + sovQuery(uint64(m.LookbackDeltaSeconds)) } + if m.EnableIgnoreNoStoresMatched { + n += 2 + } return n } @@ -1526,6 +1556,26 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { break } } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableIgnoreNoStoresMatched", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableIgnoreNoStoresMatched = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2105,6 +2155,26 @@ func (m *QueryRangeRequest) Unmarshal(dAtA []byte) error { break } } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableIgnoreNoStoresMatched", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableIgnoreNoStoresMatched = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/pkg/api/query/querypb/query.proto b/pkg/api/query/querypb/query.proto index ef5c5d0a92a..df840724b02 100644 --- a/pkg/api/query/querypb/query.proto +++ b/pkg/api/query/querypb/query.proto @@ -41,6 +41,8 @@ message QueryRequest { ShardInfo shard_info = 11; int64 lookback_delta_seconds = 12; + + bool enableIgnoreNoStoresMatched = 13; } message StoreMatchers { @@ -78,6 +80,8 @@ message QueryRangeRequest { ShardInfo shard_info = 13; int64 lookback_delta_seconds = 14; + + bool enableIgnoreNoStoresMatched = 15; } message QueryRangeResponse { diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index 918bcbf5fdd..73c96cb050e 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -63,16 +63,17 @@ import ( ) const ( - DedupParam = "dedup" - PartialResponseParam = "partial_response" - MaxSourceResolutionParam = "max_source_resolution" - ReplicaLabelsParam = "replicaLabels[]" - MatcherParam = "match[]" - StoreMatcherParam = "storeMatch[]" - Step = "step" - Stats = "stats" - ShardInfoParam = "shard_info" - LookbackDeltaParam = "lookback_delta" + DedupParam = "dedup" + PartialResponseParam = "partial_response" + MaxSourceResolutionParam = "max_source_resolution" + ReplicaLabelsParam = "replicaLabels[]" + MatcherParam = "match[]" + StoreMatcherParam = "storeMatch[]" + Step = "step" + Stats = "stats" + ShardInfoParam = "shard_info" + LookbackDeltaParam = "lookback_delta" + IgnoreNoStoresMatchedParam = "ignore_no_stores_matched" ) // QueryAPI is an API used by Thanos Querier. @@ -91,6 +92,7 @@ type QueryAPI struct { enableAutodownsampling bool enableQueryPartialResponse bool + enableQueryIgnoreNoStoresMatched bool enableRulePartialResponse bool enableTargetPartialResponse bool enableMetricMetadataPartialResponse bool @@ -128,6 +130,7 @@ func NewQueryAPI( exemplars exemplars.UnaryClient, enableAutodownsampling bool, enableQueryPartialResponse bool, + enableQueryIgnoreNoStoresMatched bool, enableRulePartialResponse bool, enableTargetPartialResponse bool, enableMetricMetadataPartialResponse bool, @@ -159,6 +162,7 @@ func NewQueryAPI( exemplars: exemplars, enableAutodownsampling: enableAutodownsampling, enableQueryPartialResponse: enableQueryPartialResponse, + enableQueryIgnoreNoStoresMatched: enableQueryIgnoreNoStoresMatched, enableRulePartialResponse: enableRulePartialResponse, enableTargetPartialResponse: enableTargetPartialResponse, enableMetricMetadataPartialResponse: enableMetricMetadataPartialResponse, @@ -312,6 +316,18 @@ func (qapi *QueryAPI) parsePartialResponseParam(r *http.Request, defaultEnablePa return defaultEnablePartialResponse, nil } +func (qapi *QueryAPI) parseIgnoreNoStoresMatchedParam(r *http.Request, defaultIgnoreNoStoresMatched bool) (enableIgnoreNoStoresMatched bool, _ *api.ApiError) { + // Overwrite the cli flag when provided as a query parameter. + if val := r.FormValue(IgnoreNoStoresMatchedParam); val != "" { + var err error + defaultIgnoreNoStoresMatched, err = strconv.ParseBool(val) + if err != nil { + return false, &api.ApiError{Typ: api.ErrorBadData, Err: errors.Wrapf(err, "'%s' parameter", IgnoreNoStoresMatchedParam)} + } + } + return defaultIgnoreNoStoresMatched, nil +} + func (qapi *QueryAPI) parseStep(r *http.Request, defaultRangeQueryStep time.Duration, rangeSeconds int64) (time.Duration, *api.ApiError) { // Overwrite the cli flag when provided as a query parameter. if val := r.FormValue(Step); val != "" { @@ -383,6 +399,11 @@ func (qapi *QueryAPI) query(r *http.Request) (interface{}, []error, *api.ApiErro return nil, nil, apiErr, func() {} } + enableIgnoreNoStoresMatched, apiErr := qapi.parseIgnoreNoStoresMatchedParam(r, qapi.enableQueryIgnoreNoStoresMatched) + if apiErr != nil { + return nil, nil, apiErr, func() {} + } + maxSourceResolution, apiErr := qapi.parseDownsamplingParamMillis(r, qapi.defaultInstantQueryMaxSourceResolution) if apiErr != nil { return nil, nil, apiErr, func() {} @@ -415,6 +436,7 @@ func (qapi *QueryAPI) query(r *http.Request) (interface{}, []error, *api.ApiErro storeDebugMatchers, maxSourceResolution, enablePartialResponse, + enableIgnoreNoStoresMatched, qapi.enableQueryPushdown, false, shardInfo, @@ -536,6 +558,11 @@ func (qapi *QueryAPI) queryRange(r *http.Request) (interface{}, []error, *api.Ap return nil, nil, apiErr, func() {} } + enableIgnoreNoStoresMatched, apiErr := qapi.parseIgnoreNoStoresMatchedParam(r, qapi.enableQueryIgnoreNoStoresMatched) + if apiErr != nil { + return nil, nil, apiErr, func() {} + } + shardInfo, apiErr := qapi.parseShardInfo(r) if apiErr != nil { return nil, nil, apiErr, func() {} @@ -566,6 +593,7 @@ func (qapi *QueryAPI) queryRange(r *http.Request) (interface{}, []error, *api.Ap storeDebugMatchers, maxSourceResolution, enablePartialResponse, + enableIgnoreNoStoresMatched, qapi.enableQueryPushdown, false, shardInfo, @@ -635,6 +663,11 @@ func (qapi *QueryAPI) labelValues(r *http.Request) (interface{}, []error, *api.A return nil, nil, apiErr, func() {} } + enableIgnoreNoStoresMatched, apiErr := qapi.parseIgnoreNoStoresMatchedParam(r, qapi.enableQueryIgnoreNoStoresMatched) + if apiErr != nil { + return nil, nil, apiErr, func() {} + } + storeDebugMatchers, apiErr := qapi.parseStoreDebugMatchersParam(r) if apiErr != nil { return nil, nil, apiErr, func() {} @@ -655,6 +688,7 @@ func (qapi *QueryAPI) labelValues(r *http.Request) (interface{}, []error, *api.A storeDebugMatchers, 0, enablePartialResponse, + enableIgnoreNoStoresMatched, qapi.enableQueryPushdown, true, nil, @@ -745,12 +779,18 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr return nil, nil, apiErr, func() {} } + enableIgnoreNoStoresMatched, apiErr := qapi.parseIgnoreNoStoresMatchedParam(r, qapi.enableQueryIgnoreNoStoresMatched) + if apiErr != nil { + return nil, nil, apiErr, func() {} + } + q, err := qapi.queryableCreate( enableDedup, replicaLabels, storeDebugMatchers, math.MaxInt64, enablePartialResponse, + enableIgnoreNoStoresMatched, qapi.enableQueryPushdown, true, nil, @@ -791,6 +831,11 @@ func (qapi *QueryAPI) labelNames(r *http.Request) (interface{}, []error, *api.Ap return nil, nil, apiErr, func() {} } + enableIgnoreNoStoresMatched, apiErr := qapi.parseIgnoreNoStoresMatchedParam(r, qapi.enableQueryIgnoreNoStoresMatched) + if apiErr != nil { + return nil, nil, apiErr, func() {} + } + storeDebugMatchers, apiErr := qapi.parseStoreDebugMatchersParam(r) if apiErr != nil { return nil, nil, apiErr, func() {} @@ -811,6 +856,7 @@ func (qapi *QueryAPI) labelNames(r *http.Request) (interface{}, []error, *api.Ap storeDebugMatchers, 0, enablePartialResponse, + enableIgnoreNoStoresMatched, qapi.enableQueryPushdown, true, nil, diff --git a/pkg/query/querier.go b/pkg/query/querier.go index b094cbd45c8..c760950e51d 100644 --- a/pkg/query/querier.go +++ b/pkg/query/querier.go @@ -54,6 +54,7 @@ type QueryableCreator func( storeDebugMatchers [][]*labels.Matcher, maxResolutionMillis int64, partialResponse, + ignoreNoStoresMatched, enableQueryPushdown, skipChunks bool, shardInfo *storepb.ShardInfo, @@ -78,20 +79,22 @@ func NewQueryableCreator( storeDebugMatchers [][]*labels.Matcher, maxResolutionMillis int64, partialResponse, + ignoreNoStoresMatched, enableQueryPushdown, skipChunks bool, shardInfo *storepb.ShardInfo, seriesStatsReporter seriesStatsReporter, ) storage.Queryable { return &queryable{ - logger: logger, - replicaLabels: replicaLabels, - storeDebugMatchers: storeDebugMatchers, - proxy: proxy, - deduplicate: deduplicate, - maxResolutionMillis: maxResolutionMillis, - partialResponse: partialResponse, - skipChunks: skipChunks, + logger: logger, + replicaLabels: replicaLabels, + storeDebugMatchers: storeDebugMatchers, + proxy: proxy, + deduplicate: deduplicate, + maxResolutionMillis: maxResolutionMillis, + partialResponse: partialResponse, + ignoreNoStoresMatched: ignoreNoStoresMatched, + skipChunks: skipChunks, gateProviderFn: func() gate.Gate { return gate.InstrumentGateDuration(duration, promgate.New(maxConcurrentSelects)) }, @@ -105,44 +108,46 @@ func NewQueryableCreator( } type queryable struct { - logger log.Logger - replicaLabels []string - storeDebugMatchers [][]*labels.Matcher - proxy storepb.StoreServer - deduplicate bool - maxResolutionMillis int64 - partialResponse bool - skipChunks bool - gateProviderFn func() gate.Gate - maxConcurrentSelects int - selectTimeout time.Duration - enableQueryPushdown bool - shardInfo *storepb.ShardInfo - seriesStatsReporter seriesStatsReporter + logger log.Logger + replicaLabels []string + storeDebugMatchers [][]*labels.Matcher + proxy storepb.StoreServer + deduplicate bool + maxResolutionMillis int64 + partialResponse bool + ignoreNoStoresMatched bool + skipChunks bool + gateProviderFn func() gate.Gate + maxConcurrentSelects int + selectTimeout time.Duration + enableQueryPushdown bool + shardInfo *storepb.ShardInfo + seriesStatsReporter seriesStatsReporter } // Querier returns a new storage querier against the underlying proxy store API. func (q *queryable) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error) { - return newQuerier(ctx, q.logger, mint, maxt, q.replicaLabels, q.storeDebugMatchers, q.proxy, q.deduplicate, q.maxResolutionMillis, q.partialResponse, q.enableQueryPushdown, q.skipChunks, q.gateProviderFn(), q.selectTimeout, q.shardInfo, q.seriesStatsReporter), nil + return newQuerier(ctx, q.logger, mint, maxt, q.replicaLabels, q.storeDebugMatchers, q.proxy, q.deduplicate, q.maxResolutionMillis, q.partialResponse, q.ignoreNoStoresMatched, q.enableQueryPushdown, q.skipChunks, q.gateProviderFn(), q.selectTimeout, q.shardInfo, q.seriesStatsReporter), nil } type querier struct { - ctx context.Context - logger log.Logger - cancel func() - mint, maxt int64 - replicaLabels map[string]struct{} - storeDebugMatchers [][]*labels.Matcher - proxy storepb.StoreServer - deduplicate bool - maxResolutionMillis int64 - partialResponse bool - enableQueryPushdown bool - skipChunks bool - selectGate gate.Gate - selectTimeout time.Duration - shardInfo *storepb.ShardInfo - seriesStatsReporter seriesStatsReporter + ctx context.Context + logger log.Logger + cancel func() + mint, maxt int64 + replicaLabels map[string]struct{} + storeDebugMatchers [][]*labels.Matcher + proxy storepb.StoreServer + deduplicate bool + maxResolutionMillis int64 + partialResponse bool + ignoreNoStoresMatched bool + enableQueryPushdown bool + skipChunks bool + selectGate gate.Gate + selectTimeout time.Duration + shardInfo *storepb.ShardInfo + seriesStatsReporter seriesStatsReporter } // newQuerier creates implementation of storage.Querier that fetches data from the proxy @@ -158,6 +163,7 @@ func newQuerier( deduplicate bool, maxResolutionMillis int64, partialResponse, + ignoreNoStoresMatched bool, enableQueryPushdown, skipChunks bool, selectGate gate.Gate, @@ -181,18 +187,19 @@ func newQuerier( selectGate: selectGate, selectTimeout: selectTimeout, - mint: mint, - maxt: maxt, - replicaLabels: rl, - storeDebugMatchers: storeDebugMatchers, - proxy: proxy, - deduplicate: deduplicate, - maxResolutionMillis: maxResolutionMillis, - partialResponse: partialResponse, - skipChunks: skipChunks, - enableQueryPushdown: enableQueryPushdown, - shardInfo: shardInfo, - seriesStatsReporter: seriesStatsReporter, + mint: mint, + maxt: maxt, + replicaLabels: rl, + storeDebugMatchers: storeDebugMatchers, + proxy: proxy, + deduplicate: deduplicate, + maxResolutionMillis: maxResolutionMillis, + partialResponse: partialResponse, + ignoreNoStoresMatched: ignoreNoStoresMatched, + skipChunks: skipChunks, + enableQueryPushdown: enableQueryPushdown, + shardInfo: shardInfo, + seriesStatsReporter: seriesStatsReporter, } } @@ -360,6 +367,7 @@ func (q *querier) selectFn(ctx context.Context, hints *storage.SelectHints, ms . SkipChunks: q.skipChunks, Step: hints.Step, Range: hints.Range, + IgnoreNoStoresMatched: q.ignoreNoStoresMatched, }, resp); err != nil { return nil, storepb.SeriesStatsCounter{}, errors.Wrap(err, "proxy Series()") } diff --git a/pkg/query/querier_test.go b/pkg/query/querier_test.go index 2e31fa65a09..dbcbbac4c32 100644 --- a/pkg/query/querier_test.go +++ b/pkg/query/querier_test.go @@ -52,6 +52,7 @@ func TestQueryableCreator_MaxResolution(t *testing.T) { false, false, false, + false, nil, NoopSeriesStatsReporter, ) @@ -94,6 +95,7 @@ func TestQuerier_DownsampledData(t *testing.T) { false, false, false, + false, nil, NoopSeriesStatsReporter, ) @@ -390,7 +392,7 @@ func TestQuerier_Select_AfterPromQL(t *testing.T) { g := gate.New(2) mq := &mockedQueryable{ Creator: func(mint, maxt int64) storage.Querier { - return newQuerier(context.Background(), nil, mint, maxt, tcase.replicaLabels, nil, tcase.storeAPI, sc.dedup, 0, true, false, false, g, timeout, nil, NoopSeriesStatsReporter) + return newQuerier(context.Background(), nil, mint, maxt, tcase.replicaLabels, nil, tcase.storeAPI, sc.dedup, 0, true, false, false, false, g, timeout, nil, NoopSeriesStatsReporter) }, } t.Cleanup(func() { @@ -634,7 +636,7 @@ func TestQuerier_Select(t *testing.T) { {dedup: true, expected: []series{tcase.expectedAfterDedup}}, } { g := gate.New(2) - q := newQuerier(context.Background(), nil, tcase.mint, tcase.maxt, tcase.replicaLabels, nil, tcase.storeAPI, sc.dedup, 0, true, false, false, g, timeout, nil, func(i storepb.SeriesStatsCounter) {}) + q := newQuerier(context.Background(), nil, tcase.mint, tcase.maxt, tcase.replicaLabels, nil, tcase.storeAPI, sc.dedup, 0, true, false, false, false, g, timeout, nil, func(i storepb.SeriesStatsCounter) {}) t.Cleanup(func() { testutil.Ok(t, q.Close()) }) t.Run(fmt.Sprintf("dedup=%v", sc.dedup), func(t *testing.T) { @@ -863,7 +865,7 @@ func TestQuerierWithDedupUnderstoodByPromQL_Rate(t *testing.T) { timeout := 100 * time.Second g := gate.New(2) - q := newQuerier(context.Background(), logger, realSeriesWithStaleMarkerMint, realSeriesWithStaleMarkerMaxt, []string{"replica"}, nil, s, false, 0, true, false, false, g, timeout, nil, NoopSeriesStatsReporter) + q := newQuerier(context.Background(), logger, realSeriesWithStaleMarkerMint, realSeriesWithStaleMarkerMaxt, []string{"replica"}, nil, s, false, 0, true, false, false, false, g, timeout, nil, NoopSeriesStatsReporter) t.Cleanup(func() { testutil.Ok(t, q.Close()) }) @@ -933,7 +935,7 @@ func TestQuerierWithDedupUnderstoodByPromQL_Rate(t *testing.T) { timeout := 5 * time.Second g := gate.New(2) - q := newQuerier(context.Background(), logger, realSeriesWithStaleMarkerMint, realSeriesWithStaleMarkerMaxt, []string{"replica"}, nil, s, true, 0, true, false, false, g, timeout, nil, NoopSeriesStatsReporter) + q := newQuerier(context.Background(), logger, realSeriesWithStaleMarkerMint, realSeriesWithStaleMarkerMaxt, []string{"replica"}, nil, s, true, 0, true, false, false, false, g, timeout, nil, NoopSeriesStatsReporter) t.Cleanup(func() { testutil.Ok(t, q.Close()) }) diff --git a/pkg/query/query_test.go b/pkg/query/query_test.go index 060571fc704..764ff9dcc84 100644 --- a/pkg/query/query_test.go +++ b/pkg/query/query_test.go @@ -61,6 +61,7 @@ func TestQuerier_Proxy(t *testing.T) { false, false, false, + false, nil, NoopSeriesStatsReporter, ) diff --git a/pkg/store/proxy.go b/pkg/store/proxy.go index 508b4c62cab..edfa8ce114b 100644 --- a/pkg/store/proxy.go +++ b/pkg/store/proxy.go @@ -264,6 +264,7 @@ func (s *ProxyStore) Series(originalRequest *storepb.SeriesRequest, srv storepb. PartialResponseDisabled: originalRequest.PartialResponseDisabled, PartialResponseStrategy: originalRequest.PartialResponseStrategy, ShardInfo: originalRequest.ShardInfo, + IgnoreNoStoresMatched: originalRequest.IgnoreNoStoresMatched, } stores := []Client{} @@ -280,6 +281,9 @@ func (s *ProxyStore) Series(originalRequest *storepb.SeriesRequest, srv storepb. if len(stores) == 0 { err := errors.New("No StoreAPIs matched for this query") level.Warn(reqLogger).Log("err", err, "stores", strings.Join(storeDebugMsgs, ";")) + if r.IgnoreNoStoresMatched { + return nil + } if sendErr := srv.Send(storepb.NewWarnSeriesResponse(err)); sendErr != nil { level.Error(reqLogger).Log("err", sendErr) return status.Error(codes.Unknown, errors.Wrap(sendErr, "send series response").Error()) diff --git a/pkg/store/proxy_test.go b/pkg/store/proxy_test.go index 8a997907e43..30f1cec8a17 100644 --- a/pkg/store/proxy_test.go +++ b/pkg/store/proxy_test.go @@ -134,6 +134,16 @@ func TestProxyStore_Series(t *testing.T) { }, expectedWarningsLen: 1, // No store matched for this query. }, + { + title: "ignore No StoreAPIs matched error", + req: &storepb.SeriesRequest{ + MinTime: 1, + MaxTime: 300, + Matchers: []storepb.LabelMatcher{{Name: "a", Value: "a", Type: storepb.LabelMatcher_EQ}}, + IgnoreNoStoresMatched: true, + }, + expectedWarningsLen: 0, // No store matched for this query. + }, { title: "no storeAPI available for 301-302 time range", storeAPIs: []Client{ diff --git a/pkg/store/storepb/rpc.pb.go b/pkg/store/storepb/rpc.pb.go index bf670d0f637..698156f54ae 100644 --- a/pkg/store/storepb/rpc.pb.go +++ b/pkg/store/storepb/rpc.pb.go @@ -292,6 +292,8 @@ type SeriesRequest struct { // shard_info is used by the querier to request a specific // shard of blocks instead of entire blocks. ShardInfo *ShardInfo `protobuf:"bytes,13,opt,name=shard_info,json=shardInfo,proto3" json:"shard_info,omitempty"` + // ignore_no_stores_matched controls whether to ignore No StoreAPIs matched error. + IgnoreNoStoresMatched bool `protobuf:"varint,14,opt,name=ignore_no_stores_matched,json=ignoreNoStoresMatched,proto3" json:"ignore_no_stores_matched,omitempty"` } func (m *SeriesRequest) Reset() { *m = SeriesRequest{} } @@ -830,89 +832,91 @@ func init() { func init() { proto.RegisterFile("store/storepb/rpc.proto", fileDescriptor_a938d55a388af629) } var fileDescriptor_a938d55a388af629 = []byte{ - // 1298 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x5d, 0x6f, 0x13, 0x47, - 0x17, 0xf6, 0x7a, 0xbd, 0xfe, 0x38, 0x4e, 0xf2, 0x9a, 0xc1, 0xc0, 0xc6, 0x48, 0x8e, 0xdf, 0x7d, - 0xf5, 0x4a, 0x11, 0xa2, 0x36, 0x35, 0x15, 0x52, 0x2b, 0x6e, 0x92, 0x60, 0x48, 0x54, 0x62, 0xca, - 0x38, 0x21, 0x2d, 0x55, 0x65, 0xad, 0xed, 0xc9, 0x7a, 0xc5, 0x7a, 0x77, 0xd9, 0x99, 0x6d, 0xe2, - 0xdb, 0xf6, 0xbe, 0xaa, 0xfa, 0x13, 0xfa, 0x2b, 0xfa, 0x13, 0xb8, 0x2b, 0x57, 0x55, 0xd5, 0x0b, - 0xd4, 0xc2, 0x1f, 0xa9, 0xe6, 0x63, 0xd7, 0xde, 0x34, 0x40, 0x11, 0xdc, 0x44, 0x73, 0x9e, 0xe7, - 0xcc, 0x99, 0xf3, 0xed, 0x0d, 0x5c, 0xa1, 0x2c, 0x88, 0x48, 0x47, 0xfc, 0x0d, 0x47, 0x9d, 0x28, - 0x1c, 0xb7, 0xc3, 0x28, 0x60, 0x01, 0x2a, 0xb2, 0xa9, 0xed, 0x07, 0xb4, 0xb1, 0x9e, 0x55, 0x60, - 0xf3, 0x90, 0x50, 0xa9, 0xd2, 0xa8, 0x3b, 0x81, 0x13, 0x88, 0x63, 0x87, 0x9f, 0x14, 0xda, 0xca, - 0x5e, 0x08, 0xa3, 0x60, 0x76, 0xe6, 0x9e, 0x32, 0xe9, 0xd9, 0x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, 0x7b, 0xf6, 0xb2, 0xa9, 0x3d, 0x7f, 0xd9, 0xd4, 0xfe, 0x7c, 0xd9, 0xd4, 0x7e, 0x7c, - 0xd5, 0xcc, 0x3d, 0x7f, 0xd5, 0xcc, 0xfd, 0xfe, 0xaa, 0x99, 0x7b, 0x5c, 0x52, 0xff, 0x13, 0x8c, - 0x8a, 0xa2, 0x67, 0x6e, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x02, 0x42, 0x0e, 0xd0, 0x7d, 0x0c, - 0x00, 0x00, + // 1329 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdd, 0x6e, 0x13, 0xc7, + 0x17, 0xf7, 0x7a, 0xbd, 0xfe, 0x38, 0x4e, 0xf2, 0x37, 0x43, 0x02, 0x1b, 0x23, 0x39, 0xfe, 0xbb, + 0xaa, 0x14, 0x21, 0x6a, 0x53, 0x53, 0x51, 0xb5, 0xe2, 0x26, 0x09, 0x86, 0x44, 0x25, 0xa6, 0x8c, + 0x13, 0xd2, 0x52, 0x55, 0xd6, 0xda, 0x9e, 0xac, 0x57, 0xd8, 0xbb, 0xcb, 0xce, 0xb8, 0x89, 0x6f, + 0xdb, 0xfb, 0xb6, 0xea, 0x23, 0xf4, 0x29, 0xfa, 0x08, 0xdc, 0x95, 0xcb, 0xaa, 0x17, 0xa8, 0x85, + 0x17, 0xa9, 0xe6, 0xcc, 0xac, 0xed, 0x4d, 0x03, 0x14, 0xc1, 0x4d, 0x34, 0xe7, 0xf7, 0x3b, 0x73, + 0xe6, 0x7c, 0x7b, 0x03, 0x97, 0xb9, 0x08, 0x22, 0xd6, 0xc0, 0xbf, 0x61, 0xaf, 0x11, 0x85, 0xfd, + 0x7a, 0x18, 0x05, 0x22, 0x20, 0x59, 0x31, 0x74, 0xfc, 0x80, 0x97, 0xd7, 0x93, 0x0a, 0x62, 0x1a, + 0x32, 0xae, 0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 0xa8, 0x6b, 0x8a, 0x6f, 0x07, 0xd8, 0xd0, 0x5c, 0x75, + 0xc8, 0xa0, 0xf6, 0xab, 0x01, 0x30, 0xf7, 0x02, 0xb3, 0x24, 0x58, 0xd8, 0x1d, 0x7b, 0xa3, 0x91, + 0xc7, 0x75, 0x47, 0x82, 0x84, 0xf6, 0x11, 0x21, 0x55, 0xc8, 0x1c, 0x4f, 0xfc, 0x3e, 0x36, 0x64, + 0x71, 0xde, 0x07, 0x77, 0x26, 0x7e, 0x9f, 0x22, 0x43, 0xae, 0x41, 0xde, 0x8d, 0x82, 0x49, 0xe8, + 0xf9, 0x2e, 0xb6, 0x55, 0xb1, 0x59, 0x8a, 0xb5, 0xee, 0x6a, 0x9c, 0xce, 0x34, 0xc8, 0x07, 0x71, + 0xd6, 0x2c, 0x54, 0x9d, 0x2d, 0x05, 0x2a, 0x41, 0x9d, 0xc4, 0xda, 0x09, 0x14, 0x66, 0x51, 0xa3, + 0x8b, 0x3a, 0x39, 0x03, 0x76, 0x3a, 0x73, 0x51, 0xf1, 0x03, 0x76, 0x4a, 0xfe, 0x0f, 0x4b, 0x22, + 0x10, 0xce, 0xa8, 0x8b, 0x18, 0xd7, 0xb3, 0x53, 0x44, 0x0c, 0xcd, 0x70, 0xb2, 0x02, 0xe9, 0xde, + 0x14, 0xb7, 0x40, 0x9e, 0xa6, 0x7b, 0x53, 0xb9, 0xed, 0xf4, 0x6e, 0xca, 0x54, 0x4d, 0xb9, 0xed, + 0x94, 0x54, 0x2b, 0x43, 0x46, 0x46, 0x26, 0xeb, 0xed, 0x3b, 0x7a, 0x42, 0x0b, 0x14, 0xcf, 0xb5, + 0x26, 0xe4, 0xe3, 0x78, 0xb4, 0x3d, 0xe3, 0x1c, 0x7b, 0x66, 0xc2, 0xde, 0x06, 0x58, 0x18, 0x98, + 0x54, 0x48, 0xa4, 0x58, 0x4b, 0xb5, 0x1f, 0x0d, 0x58, 0x89, 0x17, 0x84, 0xde, 0x9b, 0x9b, 0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 0xdf, 0x81, 0xe2, 0x42, + 0x59, 0x49, 0x52, 0x35, 0x31, 0x3c, 0xe5, 0x2b, 0xe7, 0x72, 0xca, 0x4e, 0xb3, 0x0d, 0x2b, 0xf8, + 0xe9, 0x2d, 0xa7, 0x42, 0x25, 0xe3, 0x16, 0x14, 0x29, 0x1b, 0x07, 0x82, 0x21, 0x4e, 0x66, 0xe1, + 0x2f, 0x7e, 0xa1, 0x97, 0xd7, 0xce, 0xa0, 0xfa, 0x4b, 0x3e, 0xb5, 0xfd, 0xe1, 0xd3, 0xbf, 0x2b, + 0xa9, 0xa7, 0x2f, 0x2a, 0xc6, 0xb3, 0x17, 0x15, 0xe3, 0xaf, 0x17, 0x15, 0xe3, 0xe7, 0x97, 0x95, + 0xd4, 0xb3, 0x97, 0x95, 0xd4, 0x1f, 0x2f, 0x2b, 0xa9, 0x47, 0x39, 0xfd, 0xcf, 0x44, 0x2f, 0x8b, + 0x3d, 0x73, 0xe3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x74, 0x64, 0x6a, 0x82, 0xb6, 0x0c, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1412,6 +1416,16 @@ func (m *SeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.IgnoreNoStoresMatched { + i-- + if m.IgnoreNoStoresMatched { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } if m.ShardInfo != nil { { size, err := m.ShardInfo.MarshalToSizedBuffer(dAtA[:i]) @@ -2234,6 +2248,9 @@ func (m *SeriesRequest) Size() (n int) { l = m.ShardInfo.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.IgnoreNoStoresMatched { + n += 2 + } return n } @@ -3300,6 +3317,26 @@ func (m *SeriesRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreNoStoresMatched", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IgnoreNoStoresMatched = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) diff --git a/pkg/store/storepb/rpc.proto b/pkg/store/storepb/rpc.proto index 72afaba8ed2..c6ce06e8311 100644 --- a/pkg/store/storepb/rpc.proto +++ b/pkg/store/storepb/rpc.proto @@ -122,6 +122,9 @@ message SeriesRequest { // shard_info is used by the querier to request a specific // shard of blocks instead of entire blocks. ShardInfo shard_info = 13; + + // ignore_no_stores_matched controls whether to ignore No StoreAPIs matched error. + bool ignore_no_stores_matched = 14; }