Skip to content

Arrow Flight queries fail: query time metric gets one label instead of two #1882

Done

Description

@perfloop-agent

Authenticated Arrow Flight queries that reach the end of do_get fail before returning results. src/handlers/airplane.rs passes one label to QUERY_EXECUTE_TIME.with_label_values, but the histogram requires stream and tenant_id; Prometheus panics and the request fails. The tenant label was added in #1545 without updating this Flight observation.

/about output:
Not collected. Reproduced on source revision 0c88d4e9105a5a184158f93182a061296354c162.

Description:

With a fresh local-store server using username admin, password admin, HTTP port 8000 and Flight port 8002, install pyarrow==22.0.0 and run this self-contained client:

import base64
import json
import os
import urllib.request
import pyarrow.flight as flight

http = os.environ.get("HTTP_URL", "http://127.0.0.1:8000")
auth = b"Basic " + base64.b64encode(b"admin:admin")
for method, body in [("PUT", None), ("POST", b'[{"message":"first"},{"message":"second"}]')]:
    req = urllib.request.Request(http + "/api/v1/logstream/fltest", data=body, method=method,
        headers={"Authorization": auth.decode(), "Content-Type": "application/json"})
    urllib.request.urlopen(req, timeout=20).close()
client = flight.FlightClient(os.environ.get("FLIGHT_URL", "grpc://127.0.0.1:8002"))
ticket = flight.Ticket(json.dumps({"query": "select count(*) as c from fltest",
    "startTime": "2000-01-01T00:00:00Z", "endTime": "2100-01-01T00:00:00Z"}).encode())
print(client.do_get(ticket, options=flight.FlightCallOptions(timeout=20,
    headers=[(b"authorization", auth)])).read_all().to_pylist())

Expected: [{"c": 2}] and a query-time observation with both required labels.

Actual: the client reports Received RST_STREAM with error code 8 and Server never sent a data message. The server logs InconsistentCardinality { expect: 2, got: 1 }. Only the request fails: the same server process remains running and HTTP liveness returns 200.

AI assistance: Perfloop prepared this report.

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