Skip to content

Commit eae3fc5

Browse files
committed
fix: fall back to regular backend discovery when manager API fails
The /rest/v2/manager/node/backends endpoint may not be supported on older Doris versions. When getManagerBackendsByComputeGroup throws, fall back to the regular /api/backends discovery instead of propagating the error. Also broadened the catch in getManagerBackendsByComputeGroup from ConnectedFailedException to Exception, so that parse errors (e.g. from unexpected response formats on older versions) are also handled gracefully by trying the next FE node.
1 parent f4e767b commit eae3fc5

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

flink-doris-connector/flink-doris-connector-base/src/main/java/org/apache/doris/flink/rest/RestService.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,18 @@ public static List<BackendRowV2> getBackendsV2(
354354
}
355355

356356
if (StringUtils.isNotBlank(computeGroupName)) {
357-
return getManagerBackendsByComputeGroup(
358-
options, readOptions, feNodeList, computeGroupName, logger);
357+
try {
358+
return getManagerBackendsByComputeGroup(
359+
options, readOptions, feNodeList, computeGroupName, logger);
360+
} catch (Exception e) {
361+
logger.warn(
362+
"Failed to get backends via manager API for compute group '{}', "
363+
+ "the endpoint {} may not be supported on older Doris versions. "
364+
+ "Falling back to regular backend discovery: {}",
365+
computeGroupName,
366+
MANAGER_BACKENDS,
367+
e.getMessage());
368+
}
359369
}
360370

361371
for (String feNode : feNodeList) {
@@ -391,8 +401,8 @@ private static List<BackendRowV2> getManagerBackendsByComputeGroup(
391401
String response = send(options, readOptions, httpGet, logger, false);
392402
logger.info("Manager backend info:{}", response);
393403
return parseManagerBackends(response, logger, computeGroupName);
394-
} catch (ConnectedFailedException e) {
395-
logger.info(
404+
} catch (Exception e) {
405+
logger.warn(
396406
"Doris FE node {} is unavailable: {}, Request the next Doris FE node",
397407
feNode,
398408
e.getMessage());

0 commit comments

Comments
 (0)