diff --git a/CHANGELOG.md b/CHANGELOG.md index 66fe87b6c0..bf19725f45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ We use *breaking* word for marking changes that are not backward compatible (rel - [#2501](https://github.com/thanos-io/thanos/pull/2501) Query: gracefully handle additional fields in `SeriesResponse` protobuf message that may be added in the future. +### Added + +- [#2502](https://github.com/thanos-io/thanos/pull/2502) Added `hints` field to `SeriesResponse`. Hints in an opaque data structure that can be used to carry additional information from the store and its content is implementation specific. + ### Changed - [#2505](https://github.com/thanos.io/thanos/pull/2505) Store: remove obsolete `thanos_store_node_info` metric. diff --git a/pkg/store/storepb/rpc.pb.go b/pkg/store/storepb/rpc.pb.go index dc6d835753..ee79ba2419 100644 --- a/pkg/store/storepb/rpc.pb.go +++ b/pkg/store/storepb/rpc.pb.go @@ -12,6 +12,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -379,6 +380,7 @@ type SeriesResponse struct { // Types that are valid to be assigned to Result: // *SeriesResponse_Series // *SeriesResponse_Warning + // *SeriesResponse_Hints Result isSeriesResponse_Result `protobuf_oneof:"result"` } @@ -427,9 +429,13 @@ type SeriesResponse_Series struct { type SeriesResponse_Warning struct { Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` } +type SeriesResponse_Hints struct { + Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3,oneof" json:"hints,omitempty"` +} func (*SeriesResponse_Series) isSeriesResponse_Result() {} func (*SeriesResponse_Warning) isSeriesResponse_Result() {} +func (*SeriesResponse_Hints) isSeriesResponse_Result() {} func (m *SeriesResponse) GetResult() isSeriesResponse_Result { if m != nil { @@ -452,11 +458,19 @@ func (m *SeriesResponse) GetWarning() string { return "" } +func (m *SeriesResponse) GetHints() *types.Any { + if x, ok := m.GetResult().(*SeriesResponse_Hints); ok { + return x.Hints + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*SeriesResponse) XXX_OneofWrappers() []interface{} { return []interface{}{ (*SeriesResponse_Series)(nil), (*SeriesResponse_Warning)(nil), + (*SeriesResponse_Hints)(nil), } } @@ -635,65 +649,68 @@ func init() { func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) } var fileDescriptor_77a6da22d6a3feb1 = []byte{ - // 927 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0x76, 0x7b, 0xfc, 0x5b, 0xde, 0x98, 0xd9, 0x8e, 0x93, 0x9d, 0x78, 0x25, 0xc7, 0x1a, 0x09, - 0xc9, 0x0a, 0xc8, 0x01, 0x23, 0x40, 0x20, 0x2e, 0xb6, 0xd7, 0xab, 0xb5, 0xd8, 0x38, 0xd0, 0xb6, - 0xd7, 0xfc, 0x1c, 0xcc, 0xd8, 0x69, 0x9c, 0xd1, 0xce, 0x1f, 0xd3, 0x6d, 0x92, 0x5c, 0xe1, 0x05, - 0xb8, 0xf2, 0x0e, 0xbc, 0x05, 0x97, 0x1c, 0xf7, 0x08, 0x17, 0x04, 0xc9, 0x8b, 0xa0, 0xee, 0xe9, - 0x71, 0x66, 0x96, 0x6c, 0x24, 0x94, 0x5b, 0xd7, 0xf7, 0x55, 0x77, 0x55, 0x7d, 0x5d, 0x35, 0x3d, - 0x50, 0x0e, 0x83, 0x65, 0x3b, 0x08, 0x7d, 0xee, 0xe3, 0x02, 0x3f, 0xb5, 0x3c, 0x9f, 0xd5, 0x2b, - 0xfc, 0x22, 0xa0, 0x2c, 0x02, 0xeb, 0xb5, 0x95, 0xbf, 0xf2, 0xe5, 0xf2, 0x50, 0xac, 0x14, 0x8a, - 0x83, 0xd0, 0x77, 0x83, 0xc5, 0x61, 0xc2, 0xd3, 0x7c, 0x0b, 0xb6, 0x66, 0xa1, 0xcd, 0x29, 0xa1, - 0x2c, 0xf0, 0x3d, 0x46, 0xcd, 0x9f, 0x11, 0x3c, 0x50, 0xc8, 0x0f, 0x6b, 0xca, 0x38, 0xee, 0x02, - 0x70, 0xdb, 0xa5, 0x8c, 0x86, 0x36, 0x65, 0x06, 0x6a, 0x6a, 0xad, 0x4a, 0xe7, 0xb1, 0xd8, 0xed, - 0x52, 0x7e, 0x4a, 0xd7, 0x6c, 0xbe, 0xf4, 0x83, 0x8b, 0xf6, 0xc4, 0x76, 0xe9, 0x58, 0xba, 0xf4, - 0x72, 0x97, 0x7f, 0xed, 0x67, 0x48, 0x62, 0x13, 0xde, 0x85, 0x02, 0xa7, 0x9e, 0xe5, 0x71, 0x23, - 0xdb, 0x44, 0xad, 0x32, 0x51, 0x16, 0x36, 0xa0, 0x18, 0xd2, 0xc0, 0xb1, 0x97, 0x96, 0xa1, 0x35, - 0x51, 0x4b, 0x23, 0xb1, 0x69, 0x6e, 0x41, 0x65, 0xe8, 0x7d, 0xef, 0xab, 0x1c, 0xcc, 0x3f, 0x11, - 0x3c, 0x88, 0xec, 0x28, 0x4b, 0xfc, 0x0e, 0x14, 0x1c, 0x6b, 0x41, 0x9d, 0x38, 0xa1, 0xad, 0x76, - 0x24, 0x43, 0xfb, 0xb9, 0x40, 0x55, 0x0a, 0xca, 0x05, 0xef, 0x41, 0xc9, 0xb5, 0xbd, 0xb9, 0x48, - 0x48, 0x26, 0xa0, 0x91, 0xa2, 0x6b, 0x7b, 0x22, 0x63, 0x49, 0x59, 0xe7, 0x11, 0xa5, 0x52, 0x70, - 0xad, 0x73, 0x49, 0x1d, 0x42, 0x99, 0x71, 0x3f, 0xa4, 0x93, 0x8b, 0x80, 0x1a, 0xb9, 0x26, 0x6a, - 0x55, 0x3b, 0x0f, 0xe3, 0x28, 0xe3, 0x98, 0x20, 0x37, 0x3e, 0xf8, 0x43, 0x00,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9b, 0xf2, 0x93, 0x4f, - 0x74, 0x7d, 0xe7, 0x35, 0x54, 0x3d, 0xe5, 0x99, 0xde, 0xdb, 0x97, 0xff, 0x34, 0x32, 0x97, 0x57, - 0x0d, 0xf4, 0xea, 0xaa, 0x81, 0xfe, 0xbe, 0x6a, 0xa0, 0x5f, 0xae, 0x1b, 0x99, 0x57, 0xd7, 0x8d, - 0xcc, 0x1f, 0xd7, 0x8d, 0xcc, 0x37, 0x45, 0xf9, 0x76, 0x05, 0x8b, 0x45, 0x41, 0xfe, 0x0b, 0x7c, - 0xf0, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x85, 0xb9, 0xc1, 0x57, 0x08, 0x00, 0x00, + // 966 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4b, 0x6f, 0x23, 0x45, + 0x10, 0x9e, 0xf6, 0xf8, 0x59, 0xde, 0x84, 0xd9, 0xce, 0x63, 0x27, 0x5e, 0xc9, 0x89, 0x46, 0x42, + 0xb2, 0xc2, 0xca, 0x01, 0x23, 0x40, 0x20, 0x2e, 0x4e, 0xd6, 0xab, 0x44, 0x6c, 0x1c, 0x68, 0x27, + 0x1b, 0x1e, 0x07, 0x6b, 0xec, 0xf4, 0x8e, 0x47, 0x3b, 0x2f, 0xa6, 0xdb, 0x24, 0xbe, 0xc2, 0x1d, + 0x71, 0xe5, 0x3f, 0xf0, 0x2f, 0xb8, 0xe4, 0xb8, 0x47, 0xb8, 0x20, 0x48, 0xfe, 0x08, 0xea, 0xc7, + 0x38, 0x9e, 0x25, 0x1b, 0x09, 0xe5, 0x36, 0xf5, 0x7d, 0xd5, 0x5d, 0x55, 0x5f, 0x55, 0x4d, 0x43, + 0x2d, 0x4d, 0xc6, 0xed, 0x24, 0x8d, 0x79, 0x8c, 0xcb, 0x7c, 0xe2, 0x46, 0x31, 0x6b, 0xd4, 0xf9, + 0x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c, 0xfd, 0x4d, 0x58, 0x1d, 0x7c, 0x1f, + 0xe1, 0x3d, 0x80, 0x9b, 0xc1, 0xc4, 0x1b, 0xb9, 0x1f, 0xe5, 0xe2, 0x6a, 0x35, 0x1a, 0xb7, 0x51, + 0x3a, 0xfe, 0x33, 0xa8, 0x2f, 0xf4, 0x13, 0xe7, 0x5d, 0x73, 0x93, 0xda, 0x78, 0x7c, 0x2b, 0xa7, + 0xee, 0xe9, 0xf4, 0x61, 0x59, 0x3e, 0xd5, 0x62, 0x04, 0x95, 0x18, 0x9f, 0x43, 0x9d, 0xd0, 0x30, + 0xe6, 0x54, 0xe2, 0x78, 0x5e, 0xfe, 0xe2, 0x8b, 0xde, 0x58, 0x7b, 0x03, 0xd5, 0x2f, 0xbf, 0xb1, + 0xfb, 0xee, 0xe5, 0x3f, 0x4d, 0xe3, 0xf2, 0xaa, 0x89, 0x5e, 0x5f, 0x35, 0xd1, 0xdf, 0x57, 0x4d, + 0xf4, 0xcb, 0x75, 0xd3, 0x78, 0x7d, 0xdd, 0x34, 0xfe, 0xb8, 0x6e, 0x1a, 0xdf, 0x56, 0xe4, 0x53, + 0x97, 0x8c, 0x46, 0x65, 0xf9, 0xb3, 0xf9, 0xf0, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x74, 0xaa, + 0x41, 0xe4, 0xa1, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1368,6 +1385,27 @@ func (m *SeriesResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0x12 return len(dAtA) - i, nil } +func (m *SeriesResponse_Hints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SeriesResponse_Hints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Hints != nil { + { + size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} func (m *LabelNamesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1703,6 +1741,18 @@ func (m *SeriesResponse_Warning) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) return n } +func (m *SeriesResponse_Hints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Hints != nil { + l = m.Hints.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} func (m *LabelNamesRequest) Size() (n int) { if m == nil { return 0 @@ -2662,6 +2712,41 @@ func (m *SeriesResponse) Unmarshal(dAtA []byte) error { } m.Result = &SeriesResponse_Warning{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.Any{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &SeriesResponse_Hints{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) diff --git a/pkg/store/storepb/rpc.proto b/pkg/store/storepb/rpc.proto index 4aba405741..d37492439d 100644 --- a/pkg/store/storepb/rpc.proto +++ b/pkg/store/storepb/rpc.proto @@ -7,6 +7,7 @@ package thanos; import "types.proto"; import "gogoproto/gogo.proto"; import "prompb/types.proto"; +import "google/protobuf/any.proto"; option go_package = "storepb"; @@ -132,6 +133,13 @@ message SeriesResponse { /// warning is considered an information piece in place of series for warning purposes. /// It is used to warn query customer about suspicious cases or partial response (if enabled). string warning = 2; + + /// hints is an opaque data structure that can be used to carry additional information from + /// the store. The content of this field and whether it's supported depends on the + /// implementation of a specific store. It's also implementation specific if it's allowed that + /// multiple SeriesResponse frames contain hints for a single Series() request and how should they + /// be handled in such case (ie. merged vs keep the first/last one). + google.protobuf.Any hints = 3; } } diff --git a/scripts/genproto.sh b/scripts/genproto.sh index c5660502a7..2cf23474d3 100755 --- a/scripts/genproto.sh +++ b/scripts/genproto.sh @@ -29,17 +29,14 @@ DIRS="pkg/store/storepb pkg/store/storepb/prompb" echo "generating code" for dir in ${DIRS}; do pushd ${dir} - ${PROTOC_BIN} --gogofast_out=plugins=grpc:. \ + ${PROTOC_BIN} --gogofast_out=\ +Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\ +Mprompb/types.proto=github.com/thanos-io/thanos/pkg/store/storepb/prompb,\ +plugins=grpc:. \ -I=. \ -I="${GOGOPROTO_PATH}" \ *.proto - sed -i.bak -E 's/import _ \"gogoproto\"//g' *.pb.go - sed -i.bak -E 's/import _ \"google\/protobuf\"//g' *.pb.go - # Hacky hack. - sed -i.bak -E 's/prompb \"prompb\"/prompb \"github.com\/thanos-io\/thanos\/pkg\/store\/storepb\/prompb\"/g' *.pb.go - - rm -f *.bak ${GOIMPORTS_BIN} -w *.pb.go popd done