Skip to content

Commit

Permalink
fix review2
Browse files Browse the repository at this point in the history
job instanceof BackupJob
  • Loading branch information
justfortaste committed Dec 8, 2024
1 parent 348b4b7 commit 30c6ec5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.apache.doris.analysis.TableRef;
import org.apache.doris.analysis.TruncateTableStmt;
import org.apache.doris.analysis.TypeDef;
import org.apache.doris.backup.AbstractJob;
import org.apache.doris.backup.BackupJob;
import org.apache.doris.backup.RestoreJob;
import org.apache.doris.catalog.BinlogConfig;
Expand Down Expand Up @@ -890,9 +891,11 @@ public void checkBuckupRunning(Database db, OlapTable olapTable) throws DdlExcep
return;
}

BackupJob backupJob = (BackupJob) Env.getCurrentEnv().getBackupHandler().getJob(db.getId());
if (backupJob != null && !backupJob.isDone()
&& (olapTable == null || backupJob.getBackupMeta().getTable(olapTable.getId()) != null)) {
AbstractJob job = Env.getCurrentEnv().getBackupHandler().getJob(db.getId());
if (job != null job instanceof BackupJob) {
BackupJob backupJob = (BackupJob) job;
if (backupJob.isDone()
&& (olapTable == null || backupJob.getBackupMeta().getTable(olapTable.getId()) != null)) {
LOG.warn("Backup is running on this db {} ", db.getName());
ErrorReport.reportDdlException(ErrorCode.ERR_COMMON_ERROR, "Backup is running on this db: " + db.getName());
}
Expand Down

0 comments on commit 30c6ec5

Please sign in to comment.