app/vmstorage/transport: call vmselectRequestCtx.readSearchQuery() in processVMSelectDeleteMetrics

Previously the processVMSelectDeleteMetrics was calling separate functions from readSearchQuery().
It is better from readability and maintenance PoV to substitute it with readSearchQuery call.
This commit is contained in:
Aliaksandr Valialkin 2022-06-20 14:23:14 +03:00
parent 270ad39359
commit b2cfb8faf7
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -590,21 +590,12 @@ func (s *Server) processVMSelectRegisterMetricNames(ctx *vmselectRequestCtx) err
return nil
}
const maxTagFiltersSize = 64 * 1024
func (s *Server) processVMSelectDeleteMetrics(ctx *vmselectRequestCtx) error {
vmselectDeleteMetricsRequests.Inc()
// Read request
if err := ctx.readDataBufBytes(maxTagFiltersSize); err != nil {
return fmt.Errorf("cannot read labelName: %w", err)
}
tail, err := ctx.sq.Unmarshal(ctx.dataBuf)
if err != nil {
return fmt.Errorf("cannot unmarshal SearchQuery: %w", err)
}
if len(tail) > 0 {
return fmt.Errorf("unexpected non-zero tail left after unmarshaling SearchQuery: (len=%d) %q", len(tail), tail)
if err := ctx.readSearchQuery(); err != nil {
return err
}
// Setup ctx.tfss