Skip to content

Commit

Permalink
Fix backup slow (#236)
Browse files Browse the repository at this point in the history
Signed-off-by: wayblink <[email protected]>
  • Loading branch information
wayblink authored Nov 8, 2023
1 parent 3ef7fcd commit 84e72fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/backup_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ func (b *BackupContext) Start() error {
b.backupNameIdDict = sync.Map{}
b.restoreTasks = make(map[string]*backuppb.RestoreBackupTask)
b.started = true
log.Info(fmt.Sprintf("%+v", b.params.BackupCfg))
log.Info(fmt.Sprintf("%+v", b.params.HTTPCfg))
return nil
}

Expand Down
4 changes: 3 additions & 1 deletion core/backup_impl_create_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ func (b *BackupContext) backupCollection(ctx context.Context, backupInfo *backup
log.Info("Finished fill segment",
zap.String("collectionName", collectionBackup.GetCollectionName()))

log.Info("reading SegmentInfos from storage, this may cost several minutes if data is large",
zap.String("collectionName", collectionBackup.GetCollectionName()))
segmentBackupInfos := make([]*backuppb.SegmentBackupInfo, 0)
partSegInfoMap := make(map[int64][]*backuppb.SegmentBackupInfo)
mu := sync.Mutex{}
Expand Down Expand Up @@ -727,7 +729,7 @@ func (b *BackupContext) copySegments(ctx context.Context, segments []*backuppb.S
log.Error("Binlog file not exist",
zap.Error(err),
zap.String("file", binlog.GetLogPath()))
return err
return errors.New("Binlog file not exist " + binlog.GetLogPath())
}
err = b.getStorageClient().Copy(ctx, b.milvusBucketName, b.backupBucketName, binlog.GetLogPath(), targetPath)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/paramtable/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (p *BackupConfig) initRestoreParallelism() {
}

func (p *BackupConfig) initBackupCopyDataParallelism() {
size := p.Base.ParseIntWithDefault("backup.copydata.parallelism", 10)
size := p.Base.ParseIntWithDefault("backup.copydata.parallelism", 128)
p.BackupCopyDataParallelism = size
}

Expand Down

0 comments on commit 84e72fc

Please sign in to comment.