app/vmstorage/transport: properly handle request to labelValuesOnTimeRange

This commit is contained in:
Aliaksandr Valialkin 2020-11-05 02:07:59 +02:00
parent 72011bcc45
commit 767231f41f

View file

@ -816,17 +816,17 @@ func (s *Server) processVMSelectLabelValuesOnTimeRange(ctx *vmselectRequestCtx)
if err != nil {
return err
}
if err := ctx.readDataBufBytes(maxLabelValueSize); err != nil {
return fmt.Errorf("cannot read labelName: %w", err)
}
labelName := string(ctx.dataBuf)
tr, err := ctx.readTimeRange()
if err != nil {
return err
}
if err := ctx.readDataBufBytes(maxLabelValueSize); err != nil {
return fmt.Errorf("cannot read labelName: %w", err)
}
labelName := ctx.dataBuf
// Search for tag values
labelValues, err := s.storage.SearchTagValuesOnTimeRange(accountID, projectID, labelName, tr, *maxTagValuesPerSearch, ctx.deadline)
labelValues, err := s.storage.SearchTagValuesOnTimeRange(accountID, projectID, []byte(labelName), tr, *maxTagValuesPerSearch, ctx.deadline)
if err != nil {
return ctx.writeErrorMessage(err)
}