Align Postgres slow-query duration schemas with fractional responses
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- openapi, rust
- Área
- api, backend-api-design
Línea de trabajo
Comience en crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json, revisando las operaciones slowQueryPatternsGetList y slowQueryPatternGet y el esquema PostgresSlowQueryPattern. Confirme el contrato numérico agregado con los responsables de Cloud API/OpenAPI y, a continuación, actualice los esquemas confirmados y añada ejemplos fraccionarios de lista y detalle para que las pruebas de los clientes generados cubran las respuestas desplegadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Blocked on upstream — 2026-09-18
The owner confirmed this needs an upstream API/team change or authoritative contract and has raised the group with the team. Apply/retain the blocked label. This is outside the current CLI implementation queue.
Clear next step: Confirm the duration/percentile numeric contract and correct OpenAPI integer/number schemas with representative fractional responses. Client tolerance is already implemented; do not replace it with stricter integer parsing.
Keep this issue open. Add the upstream ticket or owner response when available; neither a ticket ID nor an individual assignee has been supplied in this discussion. After the upstream answer/fix, revalidate and scope any required library/CLI follow-up. Do not treat a local workaround or previous partial fix as completion of the backend issue.
Earlier scope and evidence (preserved)
Focused scope — 2026-09-15
Deferred until the direction below is resolved.
Keep the upstream schema issue; the client already tolerates recorded fractions.
Acceptance criteria
API owners confirm percentile/aggregate numeric types, correct schemas and add representative fractional examples.
Direction needed
Requires upstream numeric-contract confirmation/schema correction.
The focused scope above supersedes implementation suggestions and prior pass-specific deferrals below. Completed work and rejected assumptions remain recorded as history.
Original report and earlier audit history
OpenAPI declares Postgres slow-query aggregate durations as integers but the API returns fractions
Blocked on: Cloud API/OpenAPI owners confirming the aggregate numeric contract and correcting the response schemas. The client tolerance fix in #758 can proceed independently.
Problem
The deployed Postgres slow-query list and detail endpoints return fractional microsecond aggregate values. The current ClickHouse Cloud OpenAPI declares those fields as integers, so strict generated clients can reject successful HTTP 200 responses unless they add out-of-contract tolerance.
This is the upstream schema remainder from ClickHousectl #758. The CLI stack now preserves fractional values, but the public schema captured after that fix remains incompatible with live responses.
Snapshot under review: OpenAPI 3.1.2 retrieved 2026-09-08T19:50:35Z, SHA-256 c4811d18b26701aa61794b1d6ea1fa1b375493776bdac2c2033383849ba047d9. The repository snapshot at commit 4c17bc55d89108a0a73579b0655baf8189d97207 has the same SHA.
Affected operations and schema
GET /v1/organizations/{organizationId}/postgres/{postgresId}/slowQueryPatterns—slowQueryPatternsGetList(operation)GET /v1/organizations/{organizationId}/postgres/{postgresId}/slowQueryPatterns/{queryId}—slowQueryPatternGet(operation); itsaggregatereusesPostgresSlowQueryPattern(schema ref).
The exact observed pointers are:
#/components/schemas/PostgresSlowQueryPattern/properties/avgDurationUs#/components/schemas/PostgresSlowQueryPattern/properties/p95DurationUs#/components/schemas/PostgresSlowQueryPattern/properties/p99DurationUs
All remain type: integer in the latest snapshot (duration fields).
Direct HTTPS evidence
A fresh read-only direct HTTPS capture on 2026-09-08 at approximately 19:53Z returned HTTP 200. Query text and all service, organization, database, user, application, and query identifiers were excluded from the evidence.
The first list result contained:
{
"avgDurationUs": 1210.2717391304348,
"p95DurationUs": 1220.7,
"p99DurationUs": 1859.259999999998
}
The detail result's aggregate contained:
{
"avgDurationUs": 1207.566758747698,
"p99DurationUs": 2439.639999999985
}
In those responses, totalDurationUs, maxDurationUs, and p50DurationUs happened to be integral. That does not prove they are always integral, but this issue should not assert that they are fractional without evidence.
Reproduction
The following read-only list request emits only numeric duration fields with a fractional part; it does not print SQL or identifiers. Use a window known to contain slow-query patterns, with exact-millisecond UTC timestamps accepted by the current endpoint.
export CLICKHOUSE_CLOUD_API='https://api.clickhouse.cloud/v1'
export CLICKHOUSE_CLOUD_API_KEY_ID='...'
export CLICKHOUSE_CLOUD_API_KEY_SECRET='...'
export ORG_ID='...'
export POSTGRES_ID='...'
export FROM_DATE='2026-09-08T16:30:00.000Z'
export TO_DATE='2026-09-08T17:35:00.000Z'
curl --fail-with-body --silent --show-error \
--user "$CLICKHOUSE_CLOUD_API_KEY_ID:$CLICKHOUSE_CLOUD_API_KEY_SECRET" \
--get \
--data-urlencode "from_date=$FROM_DATE" \
--data-urlencode "to_date=$TO_DATE" \
--data-urlencode 'limit=1' \
"$CLICKHOUSE_CLOUD_API/organizations/$ORG_ID/postgres/$POSTGRES_ID/slowQueryPatterns" \
| jq '{status,fractions:[.result[0] | to_entries[] | select(.key|test("DurationUs$")) | select((.value|type)=="number") | select(.value != (.value|floor)) | {field:.key,value:.value}]}'
The detail endpoint can be checked without printing identifying fields by supplying the required lookup values as environment variables and filtering to aggregate:
export QUERY_ID='...'
export DB_NAME='...'
export DB_USER='...'
export DB_OPERATION='SELECT'
curl --fail-with-body --silent --show-error \
--user "$CLICKHOUSE_CLOUD_API_KEY_ID:$CLICKHOUSE_CLOUD_API_KEY_SECRET" \
--get \
--data-urlencode "db_name=$DB_NAME" \
--data-urlencode "db_user=$DB_USER" \
--data-urlencode "db_operation=$DB_OPERATION" \
"$CLICKHOUSE_CLOUD_API/organizations/$ORG_ID/postgres/$POSTGRES_ID/slowQueryPatterns/$QUERY_ID" \
| jq '{status,fractions:[.result.aggregate | to_entries[] | select(.key|test("DurationUs$")) | select((.value|type)=="number") | select(.value != (.value|floor)) | {field:.key,value:.value}]}'
Both requests are read-only; no cleanup is required.
Expected resolution
- Change the confirmed fractional aggregate fields
avgDurationUs,p95DurationUs, andp99DurationUsfromintegertonumber. - Confirm the calculation and serialization contract for
p50DurationUs; update it too if fractional percentiles are possible. - Keep
totalDurationUsandmaxDurationUsintegral if the service guarantees that contract. - Add representative fractional list and detail examples so generated-client tests exercise the deployed values.
- Lenguaje dominante
- Rust
- Estrellas
- 80
- Forks
- 9
- Merge medio
- 4 d 13 h
- PR fusionados (30 d)
- 59
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ClickHouse/clickhousectl
-
openapi-drift
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
ClickHouse/clickhousectl#1144 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Stop resolving the latest clickhousectl version through the GitHub APIPosiblemente ocupada @sdairs la tomó hace 6 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 53/100
ClickHouse/clickhousectl#1142 ·
Los mantenedores suelen responder en 1 día
-
Cloud access request negotiation: role discovery, OAuth org selection and approval flowPosiblemente ocupada @balanza la tomó hace 7 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
ClickHouse/clickhousectl#1131 ·
Los mantenedores suelen responder en 1 día
-
Local Postgres: use the pg_clickhouse image and enable its extensionsPosiblemente ocupada @sdairs la tomó hace 14 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
ClickHouse/clickhousectl#1096 ·
Los mantenedores suelen responder en 1 día
-
bug local
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
ClickHouse/clickhousectl#1077 ·
Los mantenedores suelen responder en 1 día
Todos los issues de ClickHouse/clickhousectl
Issues similares
-
bug dependencies kind:fix priority: P3 ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
shep-pm/shep#1318 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
swc-project/swc-next#1165 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Alive24/shea-symphony#574 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día