Skip to content
3 changes: 2 additions & 1 deletion be/src/agent/task_worker_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1883,9 +1883,10 @@ void CloneTaskPool::_clone_worker_thread_callback() {
LOG_INFO("successfully clone tablet")
.tag("signature", agent_task_req.signature)
.tag("tablet_id", clone_req.tablet_id);
++_s_report_version;
finish_task_request.__set_finish_tablet_infos(tablet_infos);
}

finish_task_request.__set_report_version(_s_report_version);
_finish_task(finish_task_request);
_remove_task_info(agent_task_req.task_type, agent_task_req.signature);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,11 @@ private void finishClone(AgentTask task, TFinishTaskRequest request) {
} else {
LOG.warn("invalid clone task, ignore it. {}", task);
}

if (request.isSetReportVersion()) {
long reportVersion = request.getReportVersion();
Env.getCurrentSystemInfo().updateBackendReportVersion(
task.getBackendId(), reportVersion, task.getDbId(), task.getTableId());
}
AgentTaskQueue.removeTask(task.getBackendId(), TTaskType.CLONE, task.getSignature());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,16 +770,17 @@ private static void deleteFromMeta(ListMultimap<Long, Long> tabletDeleteFromMeta
continue;
}

BinlogConfig binlogConfig = new BinlogConfig(olapTable.getBinlogConfig());

ReplicaState state = replica.getState();

// check report version again
long currentBackendReportVersion = Env.getCurrentSystemInfo()
.getBackendReportVersion(backendId);
if (backendReportVersion < currentBackendReportVersion) {
continue;
}

BinlogConfig binlogConfig = new BinlogConfig(olapTable.getBinlogConfig());

ReplicaState state = replica.getState();
if (state == ReplicaState.NORMAL || state == ReplicaState.SCHEMA_CHANGE) {
// if state is PENDING / ROLLUP / CLONE
// it's normal that the replica is not created in BE but exists in meta.
Expand Down