From 8da47177b0defbc3bd10a3c035c5c136f71e41b0 Mon Sep 17 00:00:00 2001 From: wayblink Date: Mon, 9 Sep 2024 11:36:21 +0800 Subject: [PATCH] fix cross restore path (#422) Signed-off-by: wayblink --- core/backup_impl_restore_backup.go | 8 ++++---- docs/docs.go | 3 +-- docs/swagger.json | 3 +-- docs/swagger.yaml | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/core/backup_impl_restore_backup.go b/core/backup_impl_restore_backup.go index 21064f59..222b6f6a 100644 --- a/core/backup_impl_restore_backup.go +++ b/core/backup_impl_restore_backup.go @@ -586,16 +586,16 @@ func (b *BackupContext) executeRestoreCollectionTask(ctx context.Context, backup if file == "" { realFiles[i] = file } else { - tempFilekey := path.Join(tempDir, strings.Replace(file, b.params.MinioCfg.BackupRootPath, "", 1)) - log.Debug("Copy temporary restore file", zap.String("from", file), zap.String("to", tempFilekey)) + tempFileKey := path.Join(tempDir, strings.Replace(file, b.params.MinioCfg.BackupRootPath, "", 1)) + SEPERATOR + log.Debug("Copy temporary restore file", zap.String("from", file), zap.String("to", tempFileKey)) err := retry.Do(ctx, func() error { - return b.getRestoreCopier().Copy(ctx, file, tempFilekey, backupBucketName, b.milvusBucketName) + return b.getRestoreCopier().Copy(ctx, file, tempFileKey, backupBucketName, b.milvusBucketName) }, retry.Sleep(2*time.Second), retry.Attempts(5)) if err != nil { log.Error("fail to copy backup date from backup bucket to restore target milvus bucket after retry", zap.Error(err)) return err } - realFiles[i] = tempFilekey + realFiles[i] = tempFileKey } } } else { diff --git a/docs/docs.go b/docs/docs.go index 3f345ab0..f467f165 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -196,8 +196,7 @@ const docTemplate = `{ "type": "string", "description": "collection_name", "name": "collection_name", - "in": "query", - "required": true + "in": "query" } ], "responses": { diff --git a/docs/swagger.json b/docs/swagger.json index ef585001..8ab4637d 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -188,8 +188,7 @@ "type": "string", "description": "collection_name", "name": "collection_name", - "in": "query", - "required": true + "in": "query" } ], "responses": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index c9973fd5..b552c395 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -804,7 +804,6 @@ paths: - description: collection_name in: query name: collection_name - required: true type: string produces: - application/json