xiangfu0 commented on code in PR #19142:
URL: https://github.com/apache/pinot/pull/19142#discussion_r3700372829
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableInstances.java:
##########
@@ -158,28 +157,6 @@ public String getTableInstances(
return ret.toString();
}
- @Deprecated
- @GET
- @Path("/tables/{tableName}/livebrokers")
- @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action =
Actions.Table.GET_BROKER)
- @Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "List the brokers serving a table", notes = "List live
brokers of the given table based on EV")
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "Success"),
- @ApiResponse(code = 404, message = "Table not found"),
- @ApiResponse(code = 500, message = "Internal server error")
- })
- public List<String> getLiveBrokersForTable(
- @ApiParam(value = "Table name (with or without type)", required = true)
- @PathParam("tableName") String tableName, @Context HttpHeaders headers) {
- tableName = DatabaseUtils.translateTableName(tableName, headers);
- try {
- return _pinotHelixResourceManager.getLiveBrokersForTable(tableName);
- } catch (TableNotFoundException e) {
- throw new ControllerApplicationException(LOGGER, e.getMessage(),
Response.Status.NOT_FOUND);
- }
- }
-
@GET
@Path("/tables/livebrokers")
@Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
Review Comment:
Good catch — this is a real bug, fixed in #19148.
Checking `getTableToLiveBrokersMapping`, unknown tables are silently
filtered out rather than reported, so nothing it throws is a lookup miss. What
it does throw is `IllegalStateException` when the broker `ExternalView` is
missing (plus whatever Helix/ZK raises) — so a cluster-level misconfiguration
was being reported to clients as "not found", and the documented 500 was
unreachable. Now maps to `INTERNAL_SERVER_ERROR` and passes the cause through
so it gets logged.
Note this is the surviving plural endpoint, independent of the singular one
removed here, so the fix applies cleanly either way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]