Skip to content

Commit

Permalink
fix stateCode should be updated during backup
Browse files Browse the repository at this point in the history
Signed-off-by: wayblink <[email protected]>
  • Loading branch information
wayblink committed Jul 23, 2024
1 parent 04006f5 commit b2222eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/backup_impl_create_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ func (b *BackupContext) executeCreateBackup(ctx context.Context, request *backup
b.mu.Lock()
defer b.mu.Unlock()

// set backup state
b.meta.UpdateBackup(backupInfo.Id, setStateCode(backuppb.BackupTaskStateCode_BACKUP_EXECUTING))

// pause GC
if request.GetGcPauseEnable() || b.params.BackupCfg.GcPauseEnable {
var pause = 0
Expand Down
2 changes: 1 addition & 1 deletion core/backup_meta_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (meta *MetaManager) GetFullMeta(id string) *backuppb.BackupInfo {
} else {
cloneBackup.Progress = 100
}
log.Info("Get backup progress", zap.Int64("backupedSize", backupedSize), zap.Int64("totalSize", totalSize), zap.Int32("progress", cloneBackup.Progress))
log.Info("Get backup", zap.String("state", cloneBackup.StateCode.String()), zap.Int64("backupedSize", backupedSize), zap.Int64("totalSize", totalSize), zap.Int32("progress", cloneBackup.Progress))
return cloneBackup
}

Expand Down

0 comments on commit b2222eb

Please sign in to comment.