Skip to content

Commit

Permalink
[Enhancement] add more info in logging for the cases of exec plan fra…
Browse files Browse the repository at this point in the history
…gment failed and clone (#17194)

Add related BE hostname to err message when query failed;
Add version info in be log when clone finished

Signed-off-by: Binglin Chang <decstery@gmail.com>
(cherry picked from commit 23e5e68)
  • Loading branch information
decster authored and mergify[bot] committed Feb 2, 2023
1 parent 10493d3 commit 5700c1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion be/src/storage/task/engine_clone_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ void EngineCloneTask::_set_tablet_info(Status status, bool is_new_tablet) {
} else {
LOG(INFO) << "clone get tablet info success. tablet_id:" << _clone_req.tablet_id
<< ", schema_hash:" << _clone_req.schema_hash << ", signature:" << _signature
<< ", version:" << tablet_info.version;
<< ", version:" << tablet_info.version
<< ", min_readable_version:" << tablet_info.min_readable_version;
_tablet_infos->push_back(tablet_info);
}
}
Expand Down
11 changes: 7 additions & 4 deletions fe/fe-core/src/main/java/com/starrocks/clone/TabletSchedCtx.java
Original file line number Diff line number Diff line change
Expand Up @@ -946,14 +946,15 @@ public void finishCloneTask(CloneTask cloneTask, TFinishTaskRequest request)
throw new SchedException(Status.UNRECOVERABLE, "tablet does not exist");
}

String finishInfo = "";
if (cloneTask.isLocal()) {
unprotectedFinishLocalMigration(request);
} else {
unprotectedFinishClone(request, db, partition, replicationNum);
finishInfo = unprotectedFinishClone(request, db, partition, replicationNum);
}

state = State.FINISHED;
LOG.info("clone finished: {}", this);
LOG.info("clone finished: {} {}", this, finishInfo);
} catch (SchedException e) {
// if failed to too many times, remove this task
++failedRunningCounter;
Expand Down Expand Up @@ -988,8 +989,8 @@ private void unprotectedFinishLocalMigration(TFinishTaskRequest request) throws
replica.updateVersion(reportedTablet.version);
}

private void unprotectedFinishClone(TFinishTaskRequest request, Database db, Partition partition,
short replicationNum) throws SchedException {
private String unprotectedFinishClone(TFinishTaskRequest request, Database db, Partition partition,
short replicationNum) throws SchedException {
List<Long> aliveBeIdsInCluster = infoService.getBackendIds(true);
Pair<TabletStatus, TabletSchedCtx.Priority> pair = tablet.getHealthStatusWithPriority(
infoService, visibleVersion, replicationNum,
Expand Down Expand Up @@ -1055,6 +1056,8 @@ private void unprotectedFinishClone(TFinishTaskRequest request, Database db, Par
// so we keep it state unchanged, and log update replica
GlobalStateMgr.getCurrentState().getEditLog().logUpdateReplica(info);
}
return String.format("version:%d min_readable_version:%d", reportedTablet.getVersion(),
reportedTablet.getMin_readable_version());
}

/*
Expand Down
2 changes: 1 addition & 1 deletion fe/fe-core/src/main/java/com/starrocks/qe/Coordinator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ private void deliverExecBatchFragmentsRequests(boolean enablePipelineEngine) thr
if (errMsg == null) {
errMsg = "exec rpc error. backend id: " + pair.first.backend.getId();
}
queryStatus.setStatus(errMsg);
queryStatus.setStatus(errMsg + " backend:" + pair.first.address.hostname);
LOG.warn("exec plan fragment failed, errmsg={}, code: {}, fragmentId={}, backend={}:{}",
errMsg, code, pair.first.fragmentId,
pair.first.address.hostname, pair.first.address.port);
Expand Down

0 comments on commit 5700c1b

Please sign in to comment.