Skip to content

Commit

Permalink
[improve](load) improve error messages for "no backend available" (ap…
Browse files Browse the repository at this point in the history
…ache#47510)


Improve error messages for `"No backend load available."` and `There is
no scanNode Backend available.`
Suggest users to check backend status when the error occours.
  • Loading branch information
kaijchen authored Feb 10, 2025
1 parent 60a0d8f commit 6dcbd69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,8 @@ private void handleQueryWithRetry(TUniqueId queryId) throws Exception {
boolean isNeedRetry = false;
if (Config.isCloudMode()) {
isNeedRetry = false;
// errCode = 2, detailMessage = There is no scanNode Backend available.[10003: not alive]
// errCode = 2, detailMessage = No backend available as scan node,
// please check the status of your backends. [10003: not alive]
List<String> bes = Env.getCurrentSystemInfo().getAllBackendIds().stream()
.map(id -> Long.toString(id)).collect(Collectors.toList());
String msg = e.getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ public class SystemInfoService {

public static final String DEFAULT_CLUSTER = "default_cluster";

public static final String NO_BACKEND_LOAD_AVAILABLE_MSG = "No backend load available.";
public static final String NO_BACKEND_LOAD_AVAILABLE_MSG =
"No backend available for load, please check the status of your backends.";

public static final String NO_SCAN_NODE_BACKEND_AVAILABLE_MSG = "There is no scanNode Backend available.";
public static final String NO_SCAN_NODE_BACKEND_AVAILABLE_MSG =
"No backend available as scan node, please check the status of your backends.";

public static final String NOT_USING_VALID_CLUSTER_MSG = "Not using valid cloud clusters, "
+ "please use a cluster before issuing any queries";
public static final String NOT_USING_VALID_CLUSTER_MSG =
"Not using valid cloud clusters, please use a cluster before issuing any queries";

protected volatile ImmutableMap<Long, Backend> idToBackendRef = ImmutableMap.of();
protected volatile ImmutableMap<Long, AtomicLong> idToReportVersionRef = ImmutableMap.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ suite("test_resource_tag") {
def code1 = process.waitFor()
def out1 = process.text
log.info("stream load skip_rg_test_table failed test result, ${out1}".toString())
assertTrue("${out1}".toString().contains("No backend load available") || "${out1}".toString().contains("No available backends"))
assertTrue("${out1}".toString().contains("No backend available for load") || "${out1}".toString().contains("No available backends"))

sql "set property for test_rg 'allow_resource_tag_downgrade' = 'true';"

Expand All @@ -89,11 +89,11 @@ suite("test_resource_tag") {
def out2 = process2.text
def jsonRet = parseJson(out2)
log.info("stream load skip_rg_test_table succ test result, ${out2}".toString())
assertFalse("${out2}".toString().contains("No backend load available"))
assertFalse("${out2}".toString().contains("No backend available for load"))
assertTrue(jsonRet['Status'] == 'Success')


// clear
sql "drop user test_rg"
sql "drop table ${context.config.defaultDb}.skip_rg_test_table"
}
}

0 comments on commit 6dcbd69

Please sign in to comment.