[fix](clone) fix stale tablet report miss the new cloning replica #38695 (#38839)

cherry pick from #38695
This commit is contained in:
yujun
2024-08-05 18:04:24 +08:00
committed by GitHub
parent 0f69a2a47f
commit bf1c7a1c15
4 changed files with 26 additions and 9 deletions

View File

@ -532,6 +532,11 @@ public class MasterImpl {
private void finishClone(AgentTask task, TFinishTaskRequest request) {
CloneTask cloneTask = (CloneTask) task;
if (cloneTask.getTaskVersion() == CloneTask.VERSION_2) {
if (request.isSetReportVersion()) {
long reportVersion = request.getReportVersion();
Env.getCurrentSystemInfo().updateBackendReportVersion(
task.getBackendId(), reportVersion, task.getDbId(), task.getTableId());
}
Env.getCurrentEnv().getTabletScheduler().finishCloneTask(cloneTask, request);
} else {
LOG.warn("invalid clone task, ignore it. {}", task);