Skip to content

[Bug] FE metric http_copy_into_query_err_total is registered under the upload error name #68505

Description

@manesioz

Search before asking

  • I had searched in the issues and found no similar issues.

Version

master (573c93c)

What's Wrong?

In MetricRepo, the counter HTTP_COUNTER_COPY_INFO_QUERY_ERR is registered with the name of the upload error counter:

HTTP_COUNTER_COPY_INFO_UPLOAD_ERR = new LongCounterMetric("http_copy_into_upload_err_total",
MetricUnit.REQUESTS, "http copy into upload err request");
DORIS_METRIC_REGISTER.addMetrics(HTTP_COUNTER_COPY_INFO_UPLOAD_ERR);
HTTP_COUNTER_COPY_INFO_QUERY_REQUEST = new LongCounterMetric("http_copy_into_query_request_total",
MetricUnit.REQUESTS, "http copy into total query request");
DORIS_METRIC_REGISTER.addMetrics(HTTP_COUNTER_COPY_INFO_QUERY_REQUEST);
HTTP_COUNTER_COPY_INFO_QUERY_ERR = new LongCounterMetric("http_copy_into_upload_err_total",
MetricUnit.REQUESTS, "http copy into err query request");
DORIS_METRIC_REGISTER.addMetrics(HTTP_COUNTER_COPY_INFO_QUERY_ERR);

HTTP_COUNTER_COPY_INFO_UPLOAD_ERR = new LongCounterMetric("http_copy_into_upload_err_total",
        MetricUnit.REQUESTS, "http copy into upload err request");
...
HTTP_COUNTER_COPY_INFO_QUERY_ERR = new LongCounterMetric("http_copy_into_upload_err_total",
        MetricUnit.REQUESTS, "http copy into err query request");

DorisMetricRegistry keys metrics by name and labels, and MetricList.addMetrics replaces an existing entry with the same key:

public void addMetrics(Metric metric) {
// No metric needs to be added to the Checkpoint thread.
// And if you add a metric in Checkpoint thread, it will cause the metric to be added repeatedly,
// and the Checkpoint Catalog may be saved incorrectly, resulting in FE memory leaks.
if (!Env.isCheckpointThread()) {
String labelId = computeLabelId(metric.getLabels());
metrics.computeIfAbsent(metric.getName(), (k) -> new MetricList())
.addMetrics(labelId, metric);
}
}

The query error counter is registered second, so it replaces the upload error counter. As a result:

  • doris_fe_http_copy_into_upload_err_total reports the query error count.
  • The upload error count is never exported. CopyIntoAction still increments HTTP_COUNTER_COPY_INFO_UPLOAD_ERR, but the registry no longer holds it.
  • doris_fe_http_copy_into_query_err_total does not exist.

CopyIntoAction increments HTTP_COUNTER_COPY_INFO_QUERY_ERR only on the query path, so the counter is correct but its name is wrong.

What You Expected?

The query error counter is exported as doris_fe_http_copy_into_query_err_total, which matches the naming of the other three copy-into counters (http_copy_into_upload_request_total, http_copy_into_upload_err_total, http_copy_into_query_request_total).

How to Reproduce?

  1. Start an FE.
  2. Run curl http://<fe_host>:<http_port>/metrics | grep http_copy_into.
  3. doris_fe_http_copy_into_upload_err_total appears once and counts query errors. doris_fe_http_copy_into_query_err_total does not appear.

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions