Skip to content

Commit

Permalink
[chore](prompt) Optimize tablet and replica prompt by pointing out wh…
Browse files Browse the repository at this point in the history
…at the numbers mean (#28925)
  • Loading branch information
gavinchou authored Dec 24, 2023
1 parent bade50d commit d8cb4da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,8 @@ private void addScanRangeLocations(Partition partition,
if (backend == null || !backend.isAlive()) {
LOG.debug("backend {} not exists or is not alive for replica {}", replica.getBackendId(),
replica.getId());
errs.add(replica.getId() + "'s backend " + replica.getBackendId() + " does not exist or not alive");
errs.add("replica " + replica.getId() + "'s backend " + replica.getBackendId()
+ " does not exist or not alive");
continue;
}
if (!backend.isMixNode()) {
Expand Down Expand Up @@ -875,7 +876,7 @@ private void addScanRangeLocations(Partition partition,
}
}
if (tabletIsNull) {
throw new UserException(tabletId + " have no queryable replicas. err: "
throw new UserException("tablet " + tabletId + " has no queryable replicas. err: "
+ Joiner.on(", ").join(errs));
}
TScanRange scanRange = new TScanRange();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void test() throws Exception {
Assert.assertTrue(connectContext.isResourceTagsSet());
queryStr = "explain select * from test.tbl1";
String error = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, queryStr);
Assert.assertTrue(error.contains("have no queryable replicas"));
Assert.assertTrue(error.contains("no queryable replicas"));

// set [0, 1, 2] backends' tag to zone1, so that at least 1 replica can be queried.
// set tag for all backends. 0-2 to zone1, 4 and 5 to zone2
Expand Down Expand Up @@ -320,7 +320,7 @@ public void test() throws Exception {
queryStr = "explain select * from test_prop.tbl2";
explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, queryStr);
System.out.println(explainString);
Assert.assertTrue(explainString.contains("have no queryable replicas"));
Assert.assertTrue(explainString.contains("no queryable replicas"));

// The priority of table is higher than db,should same with table
String createTableStr3 = "create table test_prop.tbl3\n"
Expand Down

0 comments on commit d8cb4da

Please sign in to comment.