diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index e034a874370f..e98f33f4e21a 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -569,6 +569,27 @@ func (i *Ingester) GetOrCreateInstance(instanceID string) *instance { //nolint:r return inst } +func (i *Ingester) Ack(ctx context.Context, req *logproto.AckRequest) (*logproto.AckResponse, error) { + instanceID, err := tenant.TenantID(ctx) + if err != nil { + return &logproto.AckResponse{}, err + } + + instance := i.GetOrCreateInstance(instanceID) + if err != nil { + return &logproto.AckResponse{}, err + } + + instance.queryMtx.Lock() + queryIngester := instance.queries[req.Id] + instance.queryMtx.Unlock() + if queryIngester != nil { + queryIngester.ReleaseAck() + } + + return &logproto.AckResponse{}, nil +} + // Query the ingests for log streams matching a set of matchers. func (i *Ingester) Query(req *logproto.QueryRequest, queryServer logproto.Querier_QueryServer) error { // initialize stats collection for ingester queries. @@ -621,28 +642,7 @@ func (i *Ingester) Query(req *logproto.QueryRequest, queryServer logproto.Querie instance.queries[queryID] = queryIngester instance.queryMtx.Unlock() - return sendBatches(ctx, it, queryServer, queryIngester, batchLimit) -} - -func (i *Ingester) Ack(ctx context.Context, req *logproto.AckRequest) (*logproto.AckResponse, error) { - instanceID, err := tenant.TenantID(ctx) - if err != nil { - return &logproto.AckResponse{}, err - } - - instance := i.GetOrCreateInstance(instanceID) - if err != nil { - return &logproto.AckResponse{}, err - } - - instance.queryMtx.Lock() - queryIngester := instance.queries[req.Id] - instance.queryMtx.Unlock() - if queryIngester != nil { - queryIngester.ReleaseAck() - } - - return &logproto.AckResponse{}, nil + return queryIngester.SendBatches(ctx, it, queryServer, batchLimit) } // QuerySample the ingesters for series from logs matching a set of matchers. @@ -680,7 +680,17 @@ func (i *Ingester) QuerySample(req *logproto.SampleQueryRequest, queryServer log defer errUtil.LogErrorWithContext(ctx, "closing iterator", it.Close) - return sendSampleBatches(ctx, it, queryServer) + instance.queryMtx.Lock() + queryID := uint32(0) + for instance.queries[queryID] != nil { + queryID++ + } + queryIngester := NewIngesterQuery(queryID, instance) + + instance.queries[queryID] = queryIngester + instance.queryMtx.Unlock() + + return queryIngester.SendSampleBatches(ctx, it, queryServer) } // asyncStoreMaxLookBack returns a max look back period only if active index type is one of async index stores like `boltdb-shipper` and `tsdb`. diff --git a/pkg/ingester/ingester_query.go b/pkg/ingester/ingester_query.go index 9644dfc98c5b..b48fe8f06548 100644 --- a/pkg/ingester/ingester_query.go +++ b/pkg/ingester/ingester_query.go @@ -1,6 +1,13 @@ package ingester -import "context" +import ( + "context" + + "github.com/grafana/loki/pkg/iter" + "github.com/grafana/loki/pkg/logproto" + "github.com/grafana/loki/pkg/logqlmodel/stats" + "github.com/grafana/loki/pkg/util/math" +) type IngesterQuery struct { Id uint32 @@ -43,3 +50,81 @@ func (q *IngesterQuery) BackpressureWait(ctx context.Context) { func (q *IngesterQuery) ReleaseAck() { q.loopAck <- struct{}{} } + +// QuerierQueryServer is the GRPC server stream we use to send batch of entries. +type QuerierQueryServer interface { + Context() context.Context + Send(res *logproto.QueryResponse) error +} + +func (q *IngesterQuery) SendBatches(ctx context.Context, i iter.EntryIterator, queryServer QuerierQueryServer, limit int32) error { + stats := stats.FromContext(ctx) + + // send until the limit is reached. + for limit != 0 && !isDone(ctx) { + q.BackpressureWait(ctx) + + fetchSize := uint32(queryBatchSize) + if limit > 0 { + fetchSize = math.MinUint32(queryBatchSize, uint32(limit)) + } + batch, batchSize, err := iter.ReadBatch(i, fetchSize) + if err != nil { + q.End() + return err + } + + if limit > 0 { + limit -= int32(batchSize) + } + + if len(batch.Streams) == 0 { + q.End() + return nil + } + + stats.AddIngesterBatch(int64(batchSize)) + batch.Stats = stats.Ingester() + batch.Id = q.Id + + if err := queryServer.Send(batch); err != nil { + q.End() + return err + } + stats.Reset() + } + + q.End() + return nil +} + +func (q *IngesterQuery) SendSampleBatches(ctx context.Context, it iter.SampleIterator, queryServer logproto.Querier_QuerySampleServer) error { + stats := stats.FromContext(ctx) + for !isDone(ctx) { + q.BackpressureWait(ctx) + + batch, size, err := iter.ReadSampleBatch(it, queryBatchSampleSize) + if err != nil { + q.End() + return err + } + if len(batch.Series) == 0 { + q.End() + return nil + } + + stats.AddIngesterBatch(int64(size)) + batch.Stats = stats.Ingester() + batch.Id = q.Id + + if err := queryServer.Send(batch); err != nil { + q.End() + return err + } + + stats.Reset() + + } + q.End() + return nil +} diff --git a/pkg/ingester/ingester_test.go b/pkg/ingester/ingester_test.go index aedb74bc6e1c..e15e04387634 100644 --- a/pkg/ingester/ingester_test.go +++ b/pkg/ingester/ingester_test.go @@ -703,7 +703,7 @@ func Test_DedupeIngester(t *testing.T) { End: time.Unix(0, requests+1), }) require.NoError(t, err) - iterators = append(iterators, iter.NewSampleQueryClientIterator(stream)) + iterators = append(iterators, iter.NewSampleQueryClientIterator(stream, client)) } it := iter.NewMergeSampleIterator(ctx, iterators) var expectedLabels []string @@ -738,7 +738,7 @@ func Test_DedupeIngester(t *testing.T) { End: time.Unix(0, requests+1), }) require.NoError(t, err) - iterators = append(iterators, iter.NewSampleQueryClientIterator(stream)) + iterators = append(iterators, iter.NewSampleQueryClientIterator(stream, client)) } it := iter.NewMergeSampleIterator(ctx, iterators) for i := int64(0); i < requests; i++ { @@ -849,7 +849,7 @@ func Test_DedupeIngesterParser(t *testing.T) { End: time.Unix(0, int64(requests+1)), }) require.NoError(t, err) - iterators = append(iterators, iter.NewSampleQueryClientIterator(stream)) + iterators = append(iterators, iter.NewSampleQueryClientIterator(stream, client)) } it := iter.NewMergeSampleIterator(ctx, iterators) @@ -874,7 +874,7 @@ func Test_DedupeIngesterParser(t *testing.T) { End: time.Unix(0, int64(requests+1)), }) require.NoError(t, err) - iterators = append(iterators, iter.NewSampleQueryClientIterator(stream)) + iterators = append(iterators, iter.NewSampleQueryClientIterator(stream, client)) } it := iter.NewMergeSampleIterator(ctx, iterators) diff --git a/pkg/ingester/instance.go b/pkg/ingester/instance.go index 0e2c25284900..f0cab56867bc 100644 --- a/pkg/ingester/instance.go +++ b/pkg/ingester/instance.go @@ -31,7 +31,6 @@ import ( "github.com/grafana/loki/pkg/util" "github.com/grafana/loki/pkg/util/deletion" util_log "github.com/grafana/loki/pkg/util/log" - "github.com/grafana/loki/pkg/util/math" "github.com/grafana/loki/pkg/validation" ) @@ -693,77 +692,6 @@ func isDone(ctx context.Context) bool { } } -// QuerierQueryServer is the GRPC server stream we use to send batch of entries. -type QuerierQueryServer interface { - Context() context.Context - Send(res *logproto.QueryResponse) error -} - -func sendBatches(ctx context.Context, i iter.EntryIterator, queryServer QuerierQueryServer, q *IngesterQuery, limit int32) error { - stats := stats.FromContext(ctx) - - // send until the limit is reached. - for limit != 0 && !isDone(ctx) { - q.BackpressureWait(ctx) - - fetchSize := uint32(queryBatchSize) - if limit > 0 { - fetchSize = math.MinUint32(queryBatchSize, uint32(limit)) - } - batch, batchSize, err := iter.ReadBatch(i, fetchSize) - if err != nil { - q.End() - return err - } - - if limit > 0 { - limit -= int32(batchSize) - } - - if len(batch.Streams) == 0 { - q.End() - return nil - } - - stats.AddIngesterBatch(int64(batchSize)) - batch.Stats = stats.Ingester() - batch.Id = q.Id - - if err := queryServer.Send(batch); err != nil { - q.End() - return err - } - stats.Reset() - } - - q.End() - return nil -} - -func sendSampleBatches(ctx context.Context, it iter.SampleIterator, queryServer logproto.Querier_QuerySampleServer) error { - stats := stats.FromContext(ctx) - for !isDone(ctx) { - batch, size, err := iter.ReadSampleBatch(it, queryBatchSampleSize) - if err != nil { - return err - } - if len(batch.Series) == 0 { - return nil - } - - stats.AddIngesterBatch(int64(size)) - batch.Stats = stats.Ingester() - - if err := queryServer.Send(batch); err != nil { - return err - } - - stats.Reset() - - } - return nil -} - func shouldConsiderStream(stream *stream, req *logproto.SeriesRequest) bool { from, to := stream.Bounds() diff --git a/pkg/ingester/instance_test.go b/pkg/ingester/instance_test.go index 791d11015956..2340f61e9fed 100644 --- a/pkg/ingester/instance_test.go +++ b/pkg/ingester/instance_test.go @@ -486,7 +486,7 @@ func Test_Iterator(t *testing.T) { // assert the order is preserved. var res *logproto.QueryResponse require.NoError(t, - sendBatches(context.TODO(), it, + q.SendBatches(context.TODO(), it, fakeQueryServer( func(qr *logproto.QueryResponse) error { res = qr @@ -494,7 +494,6 @@ func Test_Iterator(t *testing.T) { return nil }, ), - q, int32(2)), ) require.Equal(t, 2, len(res.Streams)) diff --git a/pkg/iter/sample_iterator.go b/pkg/iter/sample_iterator.go index d84bd7f3d2c8..95a8cbc34bd9 100644 --- a/pkg/iter/sample_iterator.go +++ b/pkg/iter/sample_iterator.go @@ -460,9 +460,10 @@ func (i *sortSampleIterator) Close() error { } type sampleQueryClientIterator struct { - client QuerySampleClient - err error - curr SampleIterator + client QuerySampleClient + ingester logproto.QuerierClient + err error + curr SampleIterator } // QuerySampleClient is GRPC stream client with only method used by the SampleQueryClientIterator @@ -473,9 +474,10 @@ type QuerySampleClient interface { } // NewQueryClientIterator returns an iterator over a QueryClient. -func NewSampleQueryClientIterator(client QuerySampleClient) SampleIterator { +func NewSampleQueryClientIterator(client QuerySampleClient, ingester logproto.QuerierClient) SampleIterator { return &sampleQueryClientIterator{ - client: client, + client: client, + ingester: ingester, } } @@ -491,6 +493,15 @@ func (i *sampleQueryClientIterator) Next() bool { } stats.JoinIngesters(ctx, batch.Stats) i.curr = NewSampleQueryResponseIterator(batch) + if i.ingester != nil { + _, err = i.ingester.Ack(ctx, &logproto.AckRequest{ + Id: batch.Id, + }) + if err != nil { + i.err = err + return false + } + } } return true } diff --git a/pkg/iter/sample_iterator_test.go b/pkg/iter/sample_iterator_test.go index ec739e4d5a29..3ae249918c91 100644 --- a/pkg/iter/sample_iterator_test.go +++ b/pkg/iter/sample_iterator_test.go @@ -204,7 +204,7 @@ func TestNewSampleQueryClientIterator(t *testing.T) { {varSeries}, {carSeries}, }, - }) + }, nil) for i := 1; i < 4; i++ { require.True(t, it.Next(), i) require.Equal(t, `{foo="var"}`, it.Labels(), i) diff --git a/pkg/logproto/logproto.pb.go b/pkg/logproto/logproto.pb.go index d371bf6bb58a..4ad41a20ec29 100644 --- a/pkg/logproto/logproto.pb.go +++ b/pkg/logproto/logproto.pb.go @@ -489,6 +489,7 @@ func (m *QueryResponse) GetId() uint32 { type SampleQueryResponse struct { Series []Series `protobuf:"bytes,1,rep,name=series,proto3,customtype=Series" json:"series,omitempty"` Stats stats.Ingester `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats"` + Id uint32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` } func (m *SampleQueryResponse) Reset() { *m = SampleQueryResponse{} } @@ -530,6 +531,13 @@ func (m *SampleQueryResponse) GetStats() stats.Ingester { return stats.Ingester{} } +func (m *SampleQueryResponse) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + type LabelRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Values bool `protobuf:"varint,2,opt,name=values,proto3" json:"values,omitempty"` @@ -1779,114 +1787,114 @@ func init() { func init() { proto.RegisterFile("pkg/logproto/logproto.proto", fileDescriptor_c28a5f14f1f4c79a) } var fileDescriptor_c28a5f14f1f4c79a = []byte{ - // 1699 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, + // 1698 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, 0x15, 0xe7, 0x90, 0xcb, 0x25, 0xf9, 0x48, 0x51, 0xc4, 0x88, 0x92, 0x18, 0xc6, 0xe1, 0x2a, 0x8b, - 0x20, 0x16, 0x12, 0x9b, 0xac, 0xd5, 0xb4, 0x71, 0xe4, 0xfe, 0x81, 0x68, 0x35, 0xb1, 0x1c, 0xb5, - 0x49, 0x56, 0x2a, 0x02, 0x18, 0x28, 0x8c, 0x15, 0x39, 0x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, 0xfd, 0x95, - 0x40, 0x25, 0xce, 0x31, 0xa0, 0x0a, 0xca, 0x39, 0xfb, 0x77, 0x08, 0x56, 0xe6, 0xde, 0x0f, 0xdb, - 0x60, 0x0e, 0x98, 0x2a, 0x15, 0x97, 0x6b, 0xc3, 0x6c, 0x62, 0x49, 0x8e, 0x23, 0x7f, 0x59, 0x34, - 0x90, 0x61, 0xc4, 0x71, 0x4f, 0x73, 0xdc, 0x37, 0x12, 0xdc, 0x7f, 0x32, 0x8c, 0xc2, 0x73, 0x15, - 0x0c, 0xab, 0x0c, 0x45, 0x56, 0x38, 0xa5, 0xb8, 0xa3, 0x16, 0xf8, 0x1d, 0x30, 0xfa, 0x2e, 0xed, - 0x73, 0x50, 0x8c, 0x76, 0x76, 0x36, 0xb1, 0xd0, 0x75, 0x87, 0xb3, 0xec, 0x87, 0x50, 0xd2, 0x8d, - 0xe0, 0x3b, 0x50, 0x88, 0x2b, 0x3e, 0x77, 0xea, 0x7f, 0x43, 0x51, 0x96, 0x67, 0xa6, 0x23, 0xca, - 0x01, 0x49, 0x94, 0xf1, 0x15, 0x30, 0x06, 0xde, 0x90, 0xf0, 0x07, 0x2a, 0xb4, 0xf3, 0xb3, 0x89, - 0xc5, 0x69, 0x87, 0xff, 0xb5, 0x7d, 0x30, 0x45, 0x8c, 0xe1, 0x0f, 0x16, 0x4f, 0xcc, 0xb4, 0x4d, - 0x61, 0x51, 0xb7, 0x66, 0x41, 0x96, 0xa3, 0xc8, 0xcd, 0xa1, 0x76, 0x61, 0x36, 0xb1, 0x04, 0xc3, - 0x11, 0x3f, 0xec, 0x38, 0xed, 0x8e, 0xfc, 0x38, 0x46, 0xcb, 0x6b, 0x7e, 0x01, 0xa5, 0x43, 0xd2, - 0x73, 0x3b, 0xe7, 0xf2, 0xd0, 0xaa, 0x32, 0xc7, 0x0e, 0x44, 0xca, 0xc6, 0xfb, 0x50, 0x8a, 0x4f, - 0xbc, 0xef, 0x53, 0x99, 0xb9, 0xc5, 0x98, 0xf7, 0x53, 0x6a, 0xff, 0x01, 0x81, 0x8c, 0xee, 0x37, - 0x7a, 0xbc, 0x5b, 0x90, 0xa3, 0xfc, 0x44, 0xf5, 0x78, 0x7a, 0xd2, 0xf0, 0x8d, 0xe4, 0xd9, 0xa4, - 0xa0, 0xa3, 0x16, 0xb8, 0x09, 0x20, 0xf2, 0xf9, 0x4e, 0x72, 0xb1, 0xf2, 0x6c, 0x62, 0x69, 0x5c, - 0x47, 0x5b, 0xdb, 0xbf, 0x47, 0x50, 0x3c, 0x76, 0xbd, 0x38, 0x71, 0xaa, 0x90, 0x7d, 0xc0, 0x32, - 0x58, 0x66, 0x8e, 0x20, 0x58, 0xcd, 0xea, 0x92, 0x81, 0x7b, 0xfe, 0x79, 0x10, 0xca, 0x9c, 0x8f, - 0xe9, 0xa4, 0xef, 0x19, 0x17, 0xf6, 0xbd, 0xec, 0xd2, 0xd5, 0xfb, 0xae, 0x91, 0x4f, 0x57, 0x32, - 0xf6, 0xaf, 0x11, 0x94, 0x84, 0x67, 0x32, 0x45, 0x6e, 0x81, 0x29, 0x1c, 0x97, 0x31, 0x76, 0x69, - 0x85, 0x03, 0xad, 0xba, 0x49, 0x15, 0xfc, 0x63, 0x28, 0x77, 0xc3, 0x60, 0x34, 0x22, 0xdd, 0x23, - 0x59, 0x26, 0xd3, 0x8b, 0x65, 0x72, 0x5f, 0xdf, 0x77, 0x16, 0xc4, 0xed, 0x7f, 0xb0, 0x44, 0x14, - 0x25, 0x4a, 0x42, 0x15, 0x5f, 0x11, 0xbd, 0x75, 0x83, 0x4a, 0x2f, 0xdb, 0xa0, 0x36, 0xc0, 0xec, - 0x85, 0xc1, 0x78, 0x44, 0x6b, 0x19, 0x51, 0x26, 0x04, 0xb5, 0x5c, 0xe3, 0xb2, 0xef, 0x42, 0x59, - 0x5d, 0xe5, 0x92, 0x3a, 0x5d, 0x5f, 0xac, 0xd3, 0x07, 0x5d, 0x32, 0x8c, 0xbc, 0x53, 0x2f, 0xae, -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e8, 0x0e, 0xc6, 0x44, 0x98, 0xc8, 0x3b, 0x92, + 0x5a, 0x36, 0x67, 0xd1, 0x5b, 0xe7, 0x2c, 0x8a, 0x23, 0xcf, 0xbe, 0x0a, 0x2b, 0xd2, 0x5f, 0x09, + 0x5c, 0xe2, 0x1c, 0x03, 0xae, 0xa0, 0x9c, 0xb3, 0x7f, 0x8b, 0x60, 0x65, 0xee, 0x41, 0xb1, 0x0d, + 0xe6, 0x80, 0x89, 0x52, 0x71, 0xb9, 0x36, 0xcc, 0x26, 0x96, 0xe4, 0x38, 0xf2, 0x97, 0x85, 0x07, + 0x19, 0x46, 0xfc, 0x1d, 0xd2, 0xfc, 0x1d, 0x36, 0x92, 0x77, 0xf8, 0xc9, 0x30, 0x0a, 0xcf, 0x55, + 0x74, 0xac, 0x32, 0x54, 0x59, 0x25, 0x95, 0xc7, 0x1d, 0xb5, 0xc0, 0xef, 0x80, 0xd1, 0x77, 0x69, + 0x9f, 0x83, 0x62, 0xb4, 0xb3, 0xb3, 0x89, 0x85, 0xae, 0x3b, 0x9c, 0x65, 0x3f, 0x84, 0x92, 0xae, + 0x04, 0xdf, 0x81, 0x42, 0xdc, 0x02, 0xb8, 0x53, 0xff, 0x1d, 0x8a, 0xb2, 0xb4, 0x99, 0x8e, 0x28, + 0x07, 0x24, 0x11, 0xc6, 0x57, 0xc0, 0x18, 0x78, 0x43, 0xc2, 0x1f, 0xa8, 0xd0, 0xce, 0xcf, 0x26, + 0x16, 0xa7, 0x1d, 0xfe, 0xd7, 0xf6, 0xc1, 0x14, 0x31, 0x87, 0x3f, 0x58, 0xb4, 0x98, 0x69, 0x9b, + 0x42, 0xa3, 0xae, 0xcd, 0x82, 0x2c, 0x47, 0x91, 0xab, 0x43, 0xed, 0xc2, 0x6c, 0x62, 0x09, 0x86, + 0x23, 0x7e, 0x98, 0x39, 0xed, 0x8e, 0xdc, 0x1c, 0xa3, 0xe5, 0x35, 0xbf, 0x80, 0xd2, 0x21, 0xe9, + 0xb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 0x89, + 0xc9, 0x7f, 0xbe, 0xfb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x39, 0x69, 0xc2, 0x8d, 0x12, + 0x00, 0x00, } func (x Direction) String() string { @@ -2184,6 +2192,9 @@ func (this *SampleQueryResponse) Equal(that interface{}) bool { if !this.Stats.Equal(&that1.Stats) { return false } + if this.Id != that1.Id { + return false + } return true } func (this *LabelRequest) Equal(that interface{}) bool { @@ -2992,10 +3003,11 @@ func (this *SampleQueryResponse) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 6) + s := make([]string, 0, 7) s = append(s, "&logproto.SampleQueryResponse{") s = append(s, "Series: "+fmt.Sprintf("%#v", this.Series)+",\n") s = append(s, "Stats: "+strings.Replace(this.Stats.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -4266,6 +4278,11 @@ func (m *SampleQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Id != 0 { + i = encodeVarintLogproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } { size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -5417,6 +5434,9 @@ func (m *SampleQueryResponse) Size() (n int) { } l = m.Stats.Size() n += 1 + l + sovLogproto(uint64(l)) + if m.Id != 0 { + n += 1 + sovLogproto(uint64(m.Id)) + } return n } @@ -5943,6 +5963,7 @@ func (this *SampleQueryResponse) String() string { s := strings.Join([]string{`&SampleQueryResponse{`, `Series:` + fmt.Sprintf("%v", this.Series) + `,`, `Stats:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Stats), "Ingester", "stats.Ingester", 1), `&`, ``, 1) + `,`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `}`, }, "") return s @@ -7349,6 +7370,25 @@ func (m *SampleQueryResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipLogproto(dAtA[iNdEx:]) diff --git a/pkg/logproto/logproto.proto b/pkg/logproto/logproto.proto index f52000ee4988..c5d159e044fa 100644 --- a/pkg/logproto/logproto.proto +++ b/pkg/logproto/logproto.proto @@ -99,6 +99,7 @@ message SampleQueryResponse { (gogoproto.nullable) = true ]; stats.Ingester stats = 2 [(gogoproto.nullable) = false]; + uint32 id = 3; } enum Direction { diff --git a/pkg/querier/ingester_querier.go b/pkg/querier/ingester_querier.go index 2dd668d02966..b2c88b7edfc2 100644 --- a/pkg/querier/ingester_querier.go +++ b/pkg/querier/ingester_querier.go @@ -118,8 +118,10 @@ func (q *IngesterQuerier) SelectLogs(ctx context.Context, params logql.SelectLog } func (q *IngesterQuerier) SelectSample(ctx context.Context, params logql.SelectSampleParams) ([]iter.SampleIterator, error) { + var ingesters []logproto.QuerierClient resps, err := q.forAllIngesters(ctx, func(client logproto.QuerierClient) (interface{}, error) { stats.FromContext(ctx).AddIngesterReached(1) + ingesters = append(ingesters, client) return client.QuerySample(ctx, params.SampleQueryRequest) }) if err != nil { @@ -128,7 +130,7 @@ func (q *IngesterQuerier) SelectSample(ctx context.Context, params logql.SelectS iterators := make([]iter.SampleIterator, len(resps)) for i := range resps { - iterators[i] = iter.NewSampleQueryClientIterator(resps[i].response.(logproto.Querier_QuerySampleClient)) + iterators[i] = iter.NewSampleQueryClientIterator(resps[i].response.(logproto.Querier_QuerySampleClient), ingesters[i]) } return iterators, nil } diff --git a/pkg/querier/querier_mock_test.go b/pkg/querier/querier_mock_test.go index 06f2c063368c..fd0a8c6dae07 100644 --- a/pkg/querier/querier_mock_test.go +++ b/pkg/querier/querier_mock_test.go @@ -428,8 +428,8 @@ func mockStreamIterator(from int, quantity int) iter.EntryIterator { // mockSampleIterator returns an iterator with 1 stream and quantity entries, // where entries timestamp and line string are constructed as sequential numbers // starting at from -func mockSampleIterator(client iter.QuerySampleClient) iter.SampleIterator { - return iter.NewSampleQueryClientIterator(client) +func mockSampleIterator(client iter.QuerySampleClient, ingester logproto.QuerierClient) iter.SampleIterator { + return iter.NewSampleQueryClientIterator(client, ingester) } // mockStream return a stream with quantity entries, where entries timestamp and diff --git a/pkg/querier/querier_test.go b/pkg/querier/querier_test.go index 6ad3c6a6e976..eaad1f3b8e4c 100644 --- a/pkg/querier/querier_test.go +++ b/pkg/querier/querier_test.go @@ -986,7 +986,7 @@ func setupIngesterQuerierMocks(conf Config, limits *validation.Overrides) (*quer store := newStoreMock() store.On("SelectLogs", mock.Anything, mock.Anything).Return(mockStreamIterator(0, 1), nil) - store.On("SelectSamples", mock.Anything, mock.Anything).Return(mockSampleIterator(querySampleClient), nil) + store.On("SelectSamples", mock.Anything, mock.Anything).Return(mockSampleIterator(querySampleClient, ingesterClient), nil) store.On("LabelValuesForMetricName", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return([]string{"1", "2", "3"}, nil) store.On("LabelNamesForMetricName", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return([]string{"foo"}, nil) store.On("Series", mock.Anything, mock.Anything).Return([]logproto.SeriesIdentifier{ @@ -1113,10 +1113,11 @@ func TestQuerier_SelectSamplesWithDeletes(t *testing.T) { queryClient := newQuerySampleClientMock() queryClient.On("Recv").Return(mockQueryResponse([]logproto.Stream{mockStream(1, 2)}), nil) + ingesterClient := newQuerierClientMock() + store := newStoreMock() - store.On("SelectSamples", mock.Anything, mock.Anything).Return(mockSampleIterator(queryClient), nil) + store.On("SelectSamples", mock.Anything, mock.Anything).Return(mockSampleIterator(queryClient, ingesterClient), nil) - ingesterClient := newQuerierClientMock() ingesterClient.On("QuerySample", mock.Anything, mock.Anything, mock.Anything).Return(queryClient, nil) limits, err := validation.NewOverrides(defaultLimitsTestConfig(), nil)