[Bug] PD task REST: balanceLeaders throws a bare HTTP 500 during the balance-shard window, and task responses cannot be told apart from a no-op or a follower answer
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
Línea de trabajo
El error está en TaskAPI.java líneas 92-95, donde balanceLeaders lanza PDException sin un manejador. Compara con endpoints hermanos como patrolPartitions que capturan y devuelven toJSON(e). También examina TaskScheduleService.java:478 para el mensaje de error. Después de corregir, prueba los endpoints REST /v1/task/balanceLeaders y /v1/task/patrolPartitions para asegurar que devuelvan JSON adecuado en lugar de un 500 desnudo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug Type (问题类型)
rest-api (结果不合预期)
Before submit
- I have confirmed and searched that there are no similar problems in the historical issue and documents
Environment (环境信息)
- Server Version: master
83ef9f3(pd imagesha256:69dc1d4e8625) - Backend: HStore, 3 PD + 3 Store, 12 shard groups
- OS: kind v0.33 (Kubernetes 1.37.0)
Expected & Actual behavior (期望与实际表现)
Measured 2026-09-22 while executing the documented recovery sequence (patrolPartitions, balanceLeaders, balancePartitions) on the PD leader with a follower as control:
GET /v1/task/balanceLeaderswithin 180 s of abalancePartitionscall (which sets the balance-shard key even when it moves nothing) answers{"timestamp":...,"status":500,"error":"Internal Server Error","path":"/v1/task/balanceLeaders"}with no reason. The reason (PDException: balance shard is processing, please try later!, TaskScheduleService.java:478) appears only in the PD log. Cause:TaskAPI.balanceLeaders(TaskAPI.java:92-95) declaresthrows PDExceptionwith no handler, while its siblings catch and returntoJSON(e). One-line fix.GET /v1/task/patrolPartitionsreturns the byte-identical body{"status": 0,"partitions": [ ]}on the leader and on a follower, whether or not it repaired anything; a follower does no work and reports success.balancePartitionsdiffers by two bytes ({}from the leader, empty body from a follower). Operators driving recovery over REST cannot tell "ran and repaired", "ran, nothing to do" and "hit a follower, did nothing" apart without reading PD logs.
Ask: catch the PDException in balanceLeaders like the sibling endpoints; and have the task endpoints either redirect to the leader (as the read APIs do via getMembers) or answer an explicit error naming the leader, plus include what was done (groups reallocated, leaders moved, partitions moved) in the body.
- Lenguaje dominante
- Java
- Estrellas
- 3.2k
- Forks
- 637
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 21
Preparar el entorno
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 apache/hugegraph
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
apache/hugegraph#3142 · 7 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
apache/hugegraph#3238 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/hugegraph
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
component/zeebe kind/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
UniversalMediaServer/UniversalMediaServer#6356 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
refinedmods/refinedstorage2#1414 · 1 comentario ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
yegor256/rultor-image#76 · 1 comentario ·