Skip to content

Commit

Permalink
[chore](backup) log backup/restore job during replay (#35234)
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter authored May 23, 2024
1 parent 4fc61a9 commit 176e719
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,8 @@ public boolean handleDirMoveTask(DirMoveTask task, TFinishTaskRequest request) {
}

public void replayAddJob(AbstractJob job) {
LOG.info("replay backup/restore job: {}", job);

if (job.isCancelled()) {
AbstractJob existingJob = getCurrentJob(job.getDbId());
if (existingJob == null || existingJob.isDone()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,15 @@ class Syncer {
}
String checkSQL = "SHOW BACKUP FROM ${dbName}"
def records = suite.sql(checkSQL)
def allDone = true
for (row in records) {
logger.info("BACKUP row is ${row}")
String state = (row[3] as String);
if (state != "FINISHED" && state != "CANCELLED") {
return false
allDone = false
}
}
true
allDone
}

void waitSnapshotFinish(String dbName = null) {
Expand Down Expand Up @@ -404,14 +405,15 @@ class Syncer {
}
String checkSQL = "SHOW RESTORE FROM ${dbName}"
def records = suite.sql(checkSQL)
def allDone = true
for (row in records) {
logger.info("Restore row is ${row}")
String state = row[4]
if (state != "FINISHED" && state != "CANCELLED") {
return false
allDone = false
}
}
true
allDone
}

void waitAllRestoreFinish(String dbName = null) {
Expand Down

0 comments on commit 176e719

Please sign in to comment.