From f00808002b9dc1d1623c756fe97b40d66aaa05f4 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Mon, 18 Dec 2023 16:58:24 +0100 Subject: [PATCH 1/3] Chore: remove unused storepb.Store Signed-off-by: Marco Pracucci --- pkg/storegateway/bucket.go | 5 +- pkg/storegateway/bucket_e2e_test.go | 6 +- pkg/storegateway/bucket_store_server_test.go | 28 -- pkg/storegateway/bucket_stores.go | 3 +- pkg/storegateway/bucket_stores_test.go | 2 +- pkg/storegateway/bucket_test.go | 16 +- pkg/storegateway/storepb/rpc.pb.go | 307 +++---------------- pkg/storegateway/storepb/rpc.proto | 20 -- 8 files changed, 65 insertions(+), 322 deletions(-) diff --git a/pkg/storegateway/bucket.go b/pkg/storegateway/bucket.go index 971db30ea63..d82ad33dfa9 100644 --- a/pkg/storegateway/bucket.go +++ b/pkg/storegateway/bucket.go @@ -49,6 +49,7 @@ import ( "github.com/grafana/mimir/pkg/storegateway/indexcache" "github.com/grafana/mimir/pkg/storegateway/indexheader" streamindex "github.com/grafana/mimir/pkg/storegateway/indexheader/index" + "github.com/grafana/mimir/pkg/storegateway/storegatewaypb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util" "github.com/grafana/mimir/pkg/util/pool" @@ -536,8 +537,8 @@ type seriesChunks struct { chks []storepb.AggrChunk } -// Series implements the storepb.StoreServer interface. -func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_SeriesServer) (err error) { +// Series implements the storegatewaypb.StoreGatewayServer interface. +func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storegatewaypb.StoreGateway_SeriesServer) (err error) { if req.SkipChunks { // We don't do the streaming call if we are not requesting the chunks. req.StreamingChunksBatchSize = 0 diff --git a/pkg/storegateway/bucket_e2e_test.go b/pkg/storegateway/bucket_e2e_test.go index 7c637a3d648..3462f46fabe 100644 --- a/pkg/storegateway/bucket_e2e_test.go +++ b/pkg/storegateway/bucket_e2e_test.go @@ -248,7 +248,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit assert.NoError(t, err) assert.Equal(t, []string{"1", "2"}, vals.Values) - srv := newBucketStoreTestServer(t, s.store) + srv := newStoreGatewayTestServer(t, s.store) // TODO(bwplotka): Add those test cases to TSDB querier_test.go as well, there are no tests for matching. testCases := []testBucketStoreCase{ @@ -656,7 +656,7 @@ func TestBucketStore_Series_ChunksLimiter_e2e(t *testing.T) { StreamingChunksBatchSize: uint64(streamingBatchSize), } - srv := newBucketStoreTestServer(t, s.store) + srv := newStoreGatewayTestServer(t, s.store) _, _, _, _, err := srv.Series(context.Background(), req) if testData.expectedErr == "" { @@ -911,7 +911,7 @@ func TestBucketStore_ValueTypes_e2e(t *testing.T) { StreamingChunksBatchSize: uint64(streamingBatchSize), } - srv := newBucketStoreTestServer(t, s.store) + srv := newStoreGatewayTestServer(t, s.store) seriesSet, _, _, _, err := srv.Series(ctx, req) require.NoError(t, err) diff --git a/pkg/storegateway/bucket_store_server_test.go b/pkg/storegateway/bucket_store_server_test.go index 350b8234f7c..74cf9eec3ca 100644 --- a/pkg/storegateway/bucket_store_server_test.go +++ b/pkg/storegateway/bucket_store_server_test.go @@ -36,34 +36,6 @@ type storeTestServer struct { requestSeries func(ctx context.Context, conn *grpc.ClientConn, req *storepb.SeriesRequest) (storepb.Store_SeriesClient, error) } -func newBucketStoreTestServer(t testing.TB, store storepb.StoreServer) *storeTestServer { - listener, err := net.Listen("tcp", "localhost:0") - require.NoError(t, err) - t.Cleanup(func() { - _ = listener.Close() - }) - - s := &storeTestServer{ - server: grpc.NewServer(), - serverListener: listener, - requestSeries: func(ctx context.Context, conn *grpc.ClientConn, req *storepb.SeriesRequest) (storepb.Store_SeriesClient, error) { - client := storepb.NewStoreClient(conn) - return client.Series(ctx, req) - }, - } - - storepb.RegisterStoreServer(s.server, store) - - go func() { - _ = s.server.Serve(listener) - }() - - // Stop the gRPC server once the test has done. - t.Cleanup(s.server.GracefulStop) - - return s -} - func newStoreGatewayTestServer(t testing.TB, store storegatewaypb.StoreGatewayServer) *storeTestServer { listener, err := net.Listen("tcp", "localhost:0") require.NoError(t, err) diff --git a/pkg/storegateway/bucket_stores.go b/pkg/storegateway/bucket_stores.go index 5c75eec3cf4..3c3566e394c 100644 --- a/pkg/storegateway/bucket_stores.go +++ b/pkg/storegateway/bucket_stores.go @@ -31,6 +31,7 @@ import ( "github.com/grafana/mimir/pkg/storage/tsdb" "github.com/grafana/mimir/pkg/storage/tsdb/block" "github.com/grafana/mimir/pkg/storegateway/indexcache" + "github.com/grafana/mimir/pkg/storegateway/storegatewaypb" "github.com/grafana/mimir/pkg/storegateway/storepb" util_log "github.com/grafana/mimir/pkg/util/log" "github.com/grafana/mimir/pkg/util/spanlogger" @@ -310,7 +311,7 @@ func (u *BucketStores) syncUsersBlocks(ctx context.Context, f func(context.Conte } // Series implements the storepb.StoreServer interface, making a series request to the underlying user bucket store. -func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error { +func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storegatewaypb.StoreGateway_SeriesServer) error { spanLog, spanCtx := spanlogger.NewWithLogger(srv.Context(), u.logger, "BucketStores.Series") defer spanLog.Span.Finish() diff --git a/pkg/storegateway/bucket_stores_test.go b/pkg/storegateway/bucket_stores_test.go index e2573b94734..13e1f87b116 100644 --- a/pkg/storegateway/bucket_stores_test.go +++ b/pkg/storegateway/bucket_stores_test.go @@ -630,7 +630,7 @@ func querySeries(t *testing.T, stores *BucketStores, userID, metricName string, }}, } - srv := newBucketStoreTestServer(t, stores) + srv := newStoreGatewayTestServer(t, stores) seriesSet, warnings, _, _, err := srv.Series(setUserIDToGRPCContext(context.Background(), userID), req) return seriesSet, warnings, err diff --git a/pkg/storegateway/bucket_test.go b/pkg/storegateway/bucket_test.go index ce2e3667a90..12d10a6b2fb 100644 --- a/pkg/storegateway/bucket_test.go +++ b/pkg/storegateway/bucket_test.go @@ -1580,7 +1580,7 @@ func TestBucketStore_Series_Concurrency(t *testing.T) { Hints: marshalledHints, StreamingChunksBatchSize: uint64(streamBatchSize), } - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) seriesSet, warnings, _, _, err := srv.Series(context.Background(), req) require.NoError(t, err) require.Equal(t, 0, len(warnings), "%v", warnings) @@ -1789,7 +1789,7 @@ func TestBucketStore_Series_OneBlock_InMemIndexCacheSegfault(t *testing.T) { maxSeriesPerBatch: 65536, } - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) t.Run("invoke series for one block. Fill the cache on the way.", func(t *testing.T) { seriesSet, warnings, _, _, err := srv.Series(context.Background(), &storepb.SeriesRequest{ @@ -1970,7 +1970,7 @@ func TestBucketStore_Series_ErrorUnmarshallingRequestHints(t *testing.T) { Hints: mustMarshalAny(&hintspb.SeriesResponseHints{}), } - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) _, _, _, _, err = srv.Series(context.Background(), req) assert.Error(t, err) assert.Equal(t, true, regexp.MustCompile(".*unmarshal series request hints.*").MatchString(err.Error())) @@ -2027,7 +2027,7 @@ func TestBucketStore_Series_CanceledRequest(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) cancel() - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) _, _, _, _, err = srv.Series(ctx, req) assert.Error(t, err) s, ok := status.FromError(err) @@ -2090,7 +2090,7 @@ func TestBucketStore_Series_InvalidRequest(t *testing.T) { }, } - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) _, _, _, _, err = srv.Series(context.Background(), req) assert.Error(t, err) s, ok := status.FromError(err) @@ -2209,7 +2209,7 @@ func testBucketStoreSeriesBlockWithMultipleChunks( assert.NoError(t, err) assert.NoError(t, store.SyncBlocks(context.Background())) - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) tests := map[string]struct { reqMinTime int64 @@ -2373,7 +2373,7 @@ func TestBucketStore_Series_Limits(t *testing.T) { assert.NoError(t, err) assert.NoError(t, store.SyncBlocks(ctx)) - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) for _, streamingBatchSize := range []int{0, 1, 5} { t.Run(fmt.Sprintf("streamingBatchSize: %d", streamingBatchSize), func(t *testing.T) { req := &storepb.SeriesRequest{ @@ -2951,7 +2951,7 @@ type seriesCase struct { func runTestServerSeries(t test.TB, store *BucketStore, streamingBatchSize int, cases ...*seriesCase) { for _, c := range cases { t.Run(c.Name, func(t test.TB) { - srv := newBucketStoreTestServer(t, store) + srv := newStoreGatewayTestServer(t, store) c.Req.StreamingChunksBatchSize = uint64(streamingBatchSize) t.ResetTimer() diff --git a/pkg/storegateway/storepb/rpc.pb.go b/pkg/storegateway/storepb/rpc.pb.go index 8baeff29b14..763f925f01d 100644 --- a/pkg/storegateway/storepb/rpc.pb.go +++ b/pkg/storegateway/storepb/rpc.pb.go @@ -4,14 +4,10 @@ package storepb import ( - context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -453,58 +449,54 @@ func init() { func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) } var fileDescriptor_77a6da22d6a3feb1 = []byte{ - // 803 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6f, 0xe2, 0x46, - 0x14, 0xc7, 0x3d, 0x78, 0x6c, 0x86, 0x21, 0xa4, 0xce, 0x24, 0x4d, 0x8d, 0x53, 0x39, 0x08, 0xa9, - 0x12, 0xaa, 0x5a, 0x52, 0xa5, 0x52, 0xab, 0x1e, 0x7a, 0x08, 0x51, 0x2b, 0x62, 0xb5, 0x3d, 0x38, - 0x55, 0x0f, 0x95, 0x2a, 0x64, 0x60, 0x02, 0x56, 0xb0, 0x4d, 0x3d, 0x43, 0x1b, 0x72, 0xea, 0x47, - 0xe8, 0xc7, 0x58, 0xed, 0x7e, 0x82, 0xbd, 0xee, 0x29, 0xb7, 0xcd, 0x31, 0xa7, 0xd5, 0x42, 0x2e, - 0x7b, 0xcc, 0x47, 0x58, 0x79, 0x3c, 0x60, 0xbc, 0x4b, 0x94, 0x8d, 0xb4, 0x37, 0xde, 0xff, 0xff, - 0xfc, 0xe6, 0xcd, 0xef, 0xbd, 0x01, 0x97, 0xe2, 0x71, 0xaf, 0x39, 0x8e, 0x23, 0x1e, 0x11, 0x9d, - 0x0f, 0xbd, 0x30, 0x62, 0x56, 0x99, 0x4f, 0xc7, 0x94, 0xa5, 0xa2, 0xf5, 0xf5, 0xc0, 0xe7, 0xc3, - 0x49, 0xb7, 0xd9, 0x8b, 0x82, 0x83, 0x41, 0x34, 0x88, 0x0e, 0x84, 0xdc, 0x9d, 0x9c, 0x89, 0x48, - 0x04, 0xe2, 0x97, 0x4c, 0xaf, 0x0e, 0xa2, 0x68, 0x30, 0xa2, 0x59, 0x96, 0x17, 0x4e, 0x53, 0xab, - 0xfe, 0xbc, 0x80, 0x2b, 0xa7, 0x34, 0xf6, 0x29, 0x73, 0xe9, 0xdf, 0x13, 0xca, 0x38, 0xa9, 0x62, - 0x14, 0xf8, 0x61, 0x87, 0xfb, 0x01, 0x35, 0x41, 0x0d, 0x34, 0x54, 0xb7, 0x18, 0xf8, 0xe1, 0xef, - 0x7e, 0x40, 0x85, 0xe5, 0x5d, 0xa4, 0x56, 0x41, 0x5a, 0xde, 0x85, 0xb0, 0xbe, 0x4b, 0x2c, 0xde, - 0x1b, 0xd2, 0x98, 0x99, 0x6a, 0x4d, 0x6d, 0x94, 0x0f, 0x77, 0x9a, 0x69, 0xe7, 0xcd, 0x5f, 0xbc, - 0x2e, 0x1d, 0xfd, 0x9a, 0x9a, 0x2d, 0x78, 0xf5, 0x6a, 0x5f, 0x71, 0x97, 0xb9, 0x64, 0x1f, 0x97, - 0xd9, 0xb9, 0x3f, 0xee, 0xf4, 0x86, 0x93, 0xf0, 0x9c, 0x99, 0xa8, 0x06, 0x1a, 0xc8, 0xc5, 0x89, - 0x74, 0x2c, 0x14, 0xf2, 0x25, 0xd6, 0x86, 0x7e, 0xc8, 0x99, 0x59, 0xaa, 0x01, 0x51, 0x35, 0xbd, - 0x4b, 0x73, 0x71, 0x97, 0xe6, 0x51, 0x38, 0x75, 0xd3, 0x14, 0xf2, 0x23, 0xde, 0x63, 0x3c, 0xa6, - 0x5e, 0xe0, 0x87, 0x03, 0x59, 0xb1, 0xd3, 0x4d, 0x4e, 0xea, 0x30, 0xff, 0x92, 0x9a, 0xfd, 0x1a, - 0x68, 0x40, 0xd7, 0x5c, 0xa6, 0xa4, 0x27, 0xb4, 0x92, 0x84, 0x53, 0xff, 0x92, 0x3a, 0x10, 0x41, - 0x43, 0x73, 0x20, 0xd2, 0x0c, 0xdd, 0x81, 0x48, 0x37, 0x8a, 0x0e, 0x44, 0x45, 0x03, 0x39, 0x10, - 0x61, 0xa3, 0xec, 0x40, 0x54, 0x36, 0x36, 0x1c, 0x88, 0x36, 0x8c, 0x8a, 0x03, 0x51, 0xc5, 0xd8, - 0xac, 0x7f, 0x8f, 0xb5, 0x53, 0xee, 0x71, 0x46, 0x9a, 0x78, 0xfb, 0x8c, 0x26, 0x17, 0xea, 0x77, - 0xfc, 0xb0, 0x4f, 0x2f, 0x3a, 0xdd, 0x29, 0xa7, 0x4c, 0xd0, 0x83, 0xee, 0x96, 0xb4, 0x4e, 0x12, - 0xa7, 0x95, 0x18, 0xf5, 0xa7, 0x2a, 0xde, 0x5c, 0x40, 0x67, 0xe3, 0x28, 0x64, 0x94, 0x34, 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xb7, 0x95, 0xbb, 0xb9, 0x0d, 0xfe, - 0xbf, 0xb5, 0x95, 0xeb, 0x5b, 0x5b, 0xb9, 0xb9, 0xb5, 0x95, 0x3f, 0x8b, 0x2c, 0x01, 0x31, 0xee, - 0x76, 0x75, 0x41, 0xea, 0xdb, 0xb7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x50, 0x01, 0x08, 0x1e, 0x07, - 0x07, 0x00, 0x00, + // 740 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xc1, 0x6e, 0x13, 0x3b, + 0x14, 0x86, 0xc7, 0x19, 0xcf, 0xc4, 0x71, 0x9a, 0xde, 0xe9, 0xb4, 0xba, 0x77, 0x9a, 0x7b, 0x35, + 0x8d, 0x22, 0x5d, 0x29, 0x42, 0x90, 0x4a, 0x45, 0x82, 0x15, 0x8b, 0x06, 0x21, 0xa5, 0x23, 0x60, + 0xe1, 0x22, 0x16, 0x48, 0x28, 0x9a, 0x24, 0x6e, 0x62, 0x35, 0xe3, 0x09, 0x63, 0x07, 0x9a, 0xae, + 0x78, 0x04, 0x1e, 0x03, 0xc1, 0x13, 0xb0, 0x65, 0xd5, 0x65, 0x97, 0x5d, 0x21, 0x92, 0x6e, 0x58, + 0xf6, 0x11, 0xd0, 0x78, 0x9c, 0xa4, 0x11, 0xad, 0x4a, 0x25, 0x76, 0x3e, 0xff, 0x7f, 0x7c, 0x7c, + 0xfc, 0xf9, 0x18, 0x17, 0x92, 0x61, 0xa7, 0x3e, 0x4c, 0x62, 0x19, 0xbb, 0xb6, 0xec, 0x87, 0x3c, + 0x16, 0xe5, 0xa2, 0x1c, 0x0f, 0xa9, 0xc8, 0xc4, 0xf2, 0xbd, 0x1e, 0x93, 0xfd, 0x51, 0xbb, 0xde, + 0x89, 0xa3, 0xed, 0x5e, 0xdc, 0x8b, 0xb7, 0x95, 0xdc, 0x1e, 0x1d, 0xa8,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0, 0xe3, 0xd4, 0x07, 0x27, + 0x53, 0x1f, 0x9c, 0x4e, 0x7d, 0xf0, 0x7d, 0xea, 0x83, 0x1f, 0x53, 0xdf, 0xb8, 0x98, 0xfa, 0xe0, + 0xc3, 0xb9, 0x6f, 0x9c, 0x9e, 0xfb, 0xc6, 0xd9, 0xb9, 0x6f, 0xbc, 0xca, 0x0b, 0x19, 0x27, 0x74, + 0xd8, 0x6e, 0xdb, 0xaa, 0xee, 0xfd, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xb6, 0x7d, 0x6f, + 0x35, 0x06, 0x00, 0x00, } func (this *SeriesRequest) Equal(that interface{}) bool { @@ -1112,209 +1104,6 @@ func valueToGoStringRpc(v interface{}, typ string) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// StoreClient is the client API for Store service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type StoreClient interface { - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (Store_SeriesClient, error) - /// LabelNames returns all label names constrained by the given matchers. - LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) - /// LabelValues returns all label values for given label name. - LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) -} - -type storeClient struct { - cc *grpc.ClientConn -} - -func NewStoreClient(cc *grpc.ClientConn) StoreClient { - return &storeClient{cc} -} - -func (c *storeClient) Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (Store_SeriesClient, error) { - stream, err := c.cc.NewStream(ctx, &_Store_serviceDesc.Streams[0], "/thanos.Store/Series", opts...) - if err != nil { - return nil, err - } - x := &storeSeriesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Store_SeriesClient interface { - Recv() (*SeriesResponse, error) - grpc.ClientStream -} - -type storeSeriesClient struct { - grpc.ClientStream -} - -func (x *storeSeriesClient) Recv() (*SeriesResponse, error) { - m := new(SeriesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storeClient) LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) { - out := new(LabelNamesResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/LabelNames", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) { - out := new(LabelValuesResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/LabelValues", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StoreServer is the server API for Store service. -type StoreServer interface { - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - Series(*SeriesRequest, Store_SeriesServer) error - /// LabelNames returns all label names constrained by the given matchers. - LabelNames(context.Context, *LabelNamesRequest) (*LabelNamesResponse, error) - /// LabelValues returns all label values for given label name. - LabelValues(context.Context, *LabelValuesRequest) (*LabelValuesResponse, error) -} - -// UnimplementedStoreServer can be embedded to have forward compatible implementations. -type UnimplementedStoreServer struct { -} - -func (*UnimplementedStoreServer) Series(req *SeriesRequest, srv Store_SeriesServer) error { - return status.Errorf(codes.Unimplemented, "method Series not implemented") -} -func (*UnimplementedStoreServer) LabelNames(ctx context.Context, req *LabelNamesRequest) (*LabelNamesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelNames not implemented") -} -func (*UnimplementedStoreServer) LabelValues(ctx context.Context, req *LabelValuesRequest) (*LabelValuesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelValues not implemented") -} - -func RegisterStoreServer(s *grpc.Server, srv StoreServer) { - s.RegisterService(&_Store_serviceDesc, srv) -} - -func _Store_Series_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SeriesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(StoreServer).Series(m, &storeSeriesServer{stream}) -} - -type Store_SeriesServer interface { - Send(*SeriesResponse) error - grpc.ServerStream -} - -type storeSeriesServer struct { - grpc.ServerStream -} - -func (x *storeSeriesServer) Send(m *SeriesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Store_LabelNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LabelNamesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).LabelNames(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/LabelNames", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).LabelNames(ctx, req.(*LabelNamesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_LabelValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LabelValuesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).LabelValues(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/LabelValues", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).LabelValues(ctx, req.(*LabelValuesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Store_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Store", - HandlerType: (*StoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "LabelNames", - Handler: _Store_LabelNames_Handler, - }, - { - MethodName: "LabelValues", - Handler: _Store_LabelValues_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Series", - Handler: _Store_Series_Handler, - ServerStreams: true, - }, - }, - Metadata: "rpc.proto", -} - func (m *SeriesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) diff --git a/pkg/storegateway/storepb/rpc.proto b/pkg/storegateway/storepb/rpc.proto index 5274aff2244..e8a4404fc7b 100644 --- a/pkg/storegateway/storepb/rpc.proto +++ b/pkg/storegateway/storepb/rpc.proto @@ -23,26 +23,6 @@ option (gogoproto.goproto_unkeyed_all) = false; option (gogoproto.goproto_unrecognized_all) = false; option (gogoproto.goproto_sizecache_all) = false; -/// Store represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). -service Store { - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - rpc Series(SeriesRequest) returns (stream SeriesResponse); - - /// LabelNames returns all label names constrained by the given matchers. - rpc LabelNames(LabelNamesRequest) returns (LabelNamesResponse); - - /// LabelValues returns all label values for given label name. - rpc LabelValues(LabelValuesRequest) returns (LabelValuesResponse); -} - message SeriesRequest { int64 min_time = 1; int64 max_time = 2; From 99a67bab8ba7d4d7eb72e5c2eca405fe6414be85 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Mon, 18 Dec 2023 17:06:45 +0100 Subject: [PATCH 2/3] More fixes Signed-off-by: Marco Pracucci --- pkg/storegateway/bucket.go | 12 ++++++------ pkg/storegateway/bucket_stores.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/storegateway/bucket.go b/pkg/storegateway/bucket.go index d82ad33dfa9..4122dff7ef7 100644 --- a/pkg/storegateway/bucket.go +++ b/pkg/storegateway/bucket.go @@ -711,7 +711,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storegatewaypb.Stor // this function also sends the hints and the stats. func (s *BucketStore) sendStreamingSeriesLabelsAndStats( req *storepb.SeriesRequest, - srv storepb.Store_SeriesServer, + srv storegatewaypb.StoreGateway_SeriesServer, stats *safeQueryStats, seriesSet storepb.SeriesSet, ) (numSeries int, err error) { @@ -768,7 +768,7 @@ func (s *BucketStore) sendStreamingSeriesLabelsAndStats( func (s *BucketStore) sendStreamingChunks( req *storepb.SeriesRequest, - srv storepb.Store_SeriesServer, + srv storegatewaypb.StoreGateway_SeriesServer, it seriesChunksSetIterator, stats *safeQueryStats, totalSeriesCount int, @@ -876,7 +876,7 @@ func (s *BucketStore) sendStreamingChunks( func (s *BucketStore) sendSeriesChunks( req *storepb.SeriesRequest, - srv storepb.Store_SeriesServer, + srv storegatewaypb.StoreGateway_SeriesServer, seriesSet storepb.SeriesSet, stats *safeQueryStats, ) error { @@ -921,7 +921,7 @@ func (s *BucketStore) sendSeriesChunks( return nil } -func (s *BucketStore) sendMessage(typ string, srv storepb.Store_SeriesServer, msg interface{}, encodeDuration, sendDuration *time.Duration) error { +func (s *BucketStore) sendMessage(typ string, srv storegatewaypb.StoreGateway_SeriesServer, msg interface{}, encodeDuration, sendDuration *time.Duration) error { // We encode it ourselves into a PreparedMsg in order to measure the time it takes. encodeBegin := time.Now() pmsg := &grpc.PreparedMsg{} @@ -941,7 +941,7 @@ func (s *BucketStore) sendMessage(typ string, srv storepb.Store_SeriesServer, ms return nil } -func (s *BucketStore) sendHints(srv storepb.Store_SeriesServer, resHints *hintspb.SeriesResponseHints) error { +func (s *BucketStore) sendHints(srv storegatewaypb.StoreGateway_SeriesServer, resHints *hintspb.SeriesResponseHints) error { var anyHints *types.Any var err error if anyHints, err = types.MarshalAny(resHints); err != nil { @@ -955,7 +955,7 @@ func (s *BucketStore) sendHints(srv storepb.Store_SeriesServer, resHints *hintsp return nil } -func (s *BucketStore) sendStats(srv storepb.Store_SeriesServer, stats *safeQueryStats) error { +func (s *BucketStore) sendStats(srv storegatewaypb.StoreGateway_SeriesServer, stats *safeQueryStats) error { var encodeDuration, sendDuration time.Duration defer stats.update(func(stats *queryStats) { stats.streamingSeriesSendResponseDuration += sendDuration diff --git a/pkg/storegateway/bucket_stores.go b/pkg/storegateway/bucket_stores.go index 3c3566e394c..312257c8293 100644 --- a/pkg/storegateway/bucket_stores.go +++ b/pkg/storegateway/bucket_stores.go @@ -326,8 +326,8 @@ func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storegatewaypb.Sto } return store.Series(req, spanSeriesServer{ - Store_SeriesServer: srv, - ctx: spanCtx, + StoreGateway_SeriesServer: srv, + ctx: spanCtx, }) } @@ -597,7 +597,7 @@ func getUserIDFromGRPCContext(ctx context.Context) string { } type spanSeriesServer struct { - storepb.Store_SeriesServer + storegatewaypb.StoreGateway_SeriesServer ctx context.Context } From 9667081ab291e687e45ecb726dd3006558088bf5 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Mon, 18 Dec 2023 17:11:27 +0100 Subject: [PATCH 3/3] More fixes Signed-off-by: Marco Pracucci --- pkg/storegateway/bucket.go | 4 ++-- pkg/storegateway/bucket_store_server_test.go | 6 +++--- pkg/storegateway/bucket_stores.go | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/storegateway/bucket.go b/pkg/storegateway/bucket.go index 4122dff7ef7..f75520faeef 100644 --- a/pkg/storegateway/bucket.go +++ b/pkg/storegateway/bucket.go @@ -1286,7 +1286,7 @@ func (s *BucketStore) openBlocksForReading(ctx context.Context, skipChunks bool, return blocks, indexReaders, chunkReaders } -// LabelNames implements the storepb.StoreServer interface. +// LabelNames implements the storegatewaypb.StoreGatewayServer interface. func (s *BucketStore) LabelNames(ctx context.Context, req *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error) { reqSeriesMatchers, err := storepb.MatchersToPromMatchers(req.Matchers...) if err != nil { @@ -1477,7 +1477,7 @@ func storeCachedLabelNames(ctx context.Context, indexCache indexcache.IndexCache indexCache.StoreLabelNames(userID, blockID, entry.MatchersKey, data) } -// LabelValues implements the storepb.StoreServer interface. +// LabelValues implements the storegatewaypb.StoreGatewayServer interface. func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error) { reqSeriesMatchers, err := storepb.MatchersToPromMatchers(req.Matchers...) if err != nil { diff --git a/pkg/storegateway/bucket_store_server_test.go b/pkg/storegateway/bucket_store_server_test.go index 74cf9eec3ca..15914622a98 100644 --- a/pkg/storegateway/bucket_store_server_test.go +++ b/pkg/storegateway/bucket_store_server_test.go @@ -33,7 +33,7 @@ type storeTestServer struct { // requestSeries is the function to call the Series() API endpoint // via gRPC. The actual implementation depends whether we're calling // the StoreGateway or BucketStore API endpoint. - requestSeries func(ctx context.Context, conn *grpc.ClientConn, req *storepb.SeriesRequest) (storepb.Store_SeriesClient, error) + requestSeries func(ctx context.Context, conn *grpc.ClientConn, req *storepb.SeriesRequest) (storegatewaypb.StoreGateway_SeriesClient, error) } func newStoreGatewayTestServer(t testing.TB, store storegatewaypb.StoreGatewayServer) *storeTestServer { @@ -46,7 +46,7 @@ func newStoreGatewayTestServer(t testing.TB, store storegatewaypb.StoreGatewaySe s := &storeTestServer{ server: grpc.NewServer(), serverListener: listener, - requestSeries: func(ctx context.Context, conn *grpc.ClientConn, req *storepb.SeriesRequest) (storepb.Store_SeriesClient, error) { + requestSeries: func(ctx context.Context, conn *grpc.ClientConn, req *storepb.SeriesRequest) (storegatewaypb.StoreGateway_SeriesClient, error) { client := storegatewaypb.NewCustomStoreGatewayClient(conn) return client.Series(ctx, req) }, @@ -69,7 +69,7 @@ func newStoreGatewayTestServer(t testing.TB, store storegatewaypb.StoreGatewaySe func (s *storeTestServer) Series(ctx context.Context, req *storepb.SeriesRequest) (seriesSet []*storepb.Series, warnings annotations.Annotations, hints hintspb.SeriesResponseHints, estimatedChunks uint64, err error) { var ( conn *grpc.ClientConn - stream storepb.Store_SeriesClient + stream storegatewaypb.StoreGateway_SeriesClient res *storepb.SeriesResponse streamingSeriesSet []*storepb.StreamingSeries ) diff --git a/pkg/storegateway/bucket_stores.go b/pkg/storegateway/bucket_stores.go index 312257c8293..eb53bf7dee3 100644 --- a/pkg/storegateway/bucket_stores.go +++ b/pkg/storegateway/bucket_stores.go @@ -310,7 +310,7 @@ func (u *BucketStores) syncUsersBlocks(ctx context.Context, f func(context.Conte return errs.Err() } -// Series implements the storepb.StoreServer interface, making a series request to the underlying user bucket store. +// Series implements the storegatewaypb.StoreGatewayServer interface, making a series request to the underlying user bucket store. func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storegatewaypb.StoreGateway_SeriesServer) error { spanLog, spanCtx := spanlogger.NewWithLogger(srv.Context(), u.logger, "BucketStores.Series") defer spanLog.Span.Finish() @@ -331,7 +331,7 @@ func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storegatewaypb.Sto }) } -// LabelNames implements the storepb.StoreServer interface. +// LabelNames implements the storegatewaypb.StoreGatewayServer interface. func (u *BucketStores) LabelNames(ctx context.Context, req *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error) { spanLog, spanCtx := spanlogger.NewWithLogger(ctx, u.logger, "BucketStores.LabelNames") defer spanLog.Span.Finish() @@ -349,7 +349,7 @@ func (u *BucketStores) LabelNames(ctx context.Context, req *storepb.LabelNamesRe return store.LabelNames(ctx, req) } -// LabelValues implements the storepb.StoreServer interface. +// LabelValues implements the storegatewaypb.StoreGatewayServer interface. func (u *BucketStores) LabelValues(ctx context.Context, req *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error) { spanLog, spanCtx := spanlogger.NewWithLogger(ctx, u.logger, "BucketStores.LabelValues") defer spanLog.Span.Finish()