Code review comment: When retry the export task, does the queryId changed or not?

Code under review:
protected void exec() {
            LOG.info("begin execute sub task, task idx: {}, task query id: {}", taskIdx, getQueryId());

            boolean success = false;
            String failMsg = null;

            for (int i = 0; i < RETRY_NUM; ++i) {
                
                if (job.isExportDone()) {
                    break;
                }

                try {
                    execOneCoord(coord);
                    if (coord.getExecStatus().ok()) {
                        success = true;
                        break;
                    }
                } catch (Exception e) {
                    failMsg = e.getMessage();
                    TUniqueId queryId = coord.getQueryId();
                    LOG.warn("export sub task internal error. task idx: {}, task query id: {}",
                            taskIdx, getQueryId(), e);
                }

                if (i < RETRY_NUM - 1) {
                    TUniqueId queryId = coord.getQueryId();
                    UUID uuid = UUID.randomUUID();
                    if (exportJob.needResetCoord()) {
                        try {
                            Coordinator newCoord = exportJob.resetCoord(taskIdx, uuid);
                            coord = newCoord;
                        } catch (UserException e) {
                            LOG.warn("fail to reset coord for task idx: {}, task query id: {}, reason: {}", taskIdx, 
                                    getQueryId(), e.getMessage());
                            
                            coord.clearExportStatus();
                            coord.setQueryId(new TUniqueId(queryId.hi, uuid.getLeastSignificantBits()));
                        }
                    } else {
                        coord.clearExportStatus();
                        
                        
                        
                        coord.setQueryId(new TUniqueId(queryId.hi, uuid.getLeastSignificantBits()));
                    }
                    LOG.warn(
                            "export sub task fail. err: {}. task idx: {}, task query id: {}. retry: {}, new query id: {}",
                            coord.getExecStatus().getErrorMsg(), taskIdx, DebugUtil.printId(queryId), i,
                            DebugUtil.printId(coord.getQueryId()));
                }
            }

            if (!success) {
                onSubTaskFailed(coord, failMsg);
            }

            coord.getQueryProfile().getCounterTotalTime().setValue(TimeUtils.getEstimatedTime(job.getStartTimeMs()));
            coord.endProfile();
            synchronized (fragmentProfiles) {
                fragmentProfiles.add(coord.getQueryProfile());
            }
        }

Line commented on: DebugUtil.printId(coord.getQueryId()));

Revised code:
protected void exec() {
        if (job.getState() != ExportJob.JobState.EXPORTING) {
            return;
        }
        LOG.info("begin execute export job in exporting state. job: {}", job);

        
        if (getLeftTimeSecond() < 0) {
            job.cancelInternal(ExportFailMsg.CancelType.TIMEOUT, "timeout");
            return;
        }

        synchronized (job) {
            if (job.getDoExportingThread() != null) {
                LOG.warn("export job is already being executed");
                return;
            }
            job.setDoExportingThread(Thread.currentThread());
        }

        if (job.isReplayed()) {
            
            
            String failMsg = "FE restarted or Leader changed during exporting. Job must be cancelled";
            job.cancelInternal(ExportFailMsg.CancelType.RUN_FAIL, failMsg);
            return;
        }

        
        List<Coordinator> coords = job.getCoordList();
        int coordSize = coords.size();
        List<ExportExportingSubTask> subTasks = Lists.newArrayList();
        for (int i = 0; i < coordSize; i++) {
            Coordinator coord = coords.get(i);
            ExportExportingSubTask subTask = new ExportExportingSubTask(coord, i, coordSize, job);
            subTasks.add(subTask);
            subTasksDoneSignal.addMark(i, -1);
        }
        for (ExportExportingSubTask subTask : subTasks) {
            if (!submitSubTask(subTask)) {
                job.cancelInternal(ExportFailMsg.CancelType.RUN_FAIL, "submit exporting task failed");
                return;
            }
            LOG.info("submit export sub task success. task idx: {}, task query id: {}",
                    subTask.getTaskIdx(), subTask.getQueryId());
        }

        boolean success = false;
        try {
            success = subTasksDoneSignal.await(getLeftTimeSecond(), TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            LOG.warn("export sub task signal await error", e);
        }

        Status status = subTasksDoneSignal.getStatus();
        if (!success || !status.ok()) {
            if (!success) {
                job.cancelInternal(ExportFailMsg.CancelType.TIMEOUT, "timeout");
            } else {
                job.cancelInternal(ExportFailMsg.CancelType.RUN_FAIL, status.getErrorMsg());
            }
            registerProfile();
            return;
        }

        
        Status mvStatus = moveTmpFiles();
        if (!mvStatus.ok()) {
            String failMsg = "move tmp file to final destination fail, ";
            failMsg += mvStatus.getErrorMsg();
            job.cancelInternal(ExportFailMsg.CancelType.RUN_FAIL, failMsg);
            LOG.warn("move tmp file to final destination fail. job:{}", job);
            registerProfile();
            return;
        }

        
        job.finish();
        registerProfile();

        synchronized (this) {
            job.setDoExportingThread(null);
        }
    }