Skip to content

Commit 79a8cea

Browse files
authored
[FIX]: Empty b.params.MinioCfg.RootPath handler (S3/Ceph) (zilliztech#177)
* [FIX]: Empty b.params.MinioCfg.RootPath hadler Signed-off-by: Gleb Vazhenin <gleb.vazhenin@team.bumble.com>
1 parent f276c61 commit 79a8cea

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

core/backup_impl_create_backup.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,15 @@ func (b *BackupContext) readSegmentInfo(ctx context.Context, collecitonID int64,
726726
NumOfRows: numOfRows,
727727
}
728728
var size int64 = 0
729+
var rootPath string
729730

730-
insertPath := fmt.Sprintf("%s/%s/%v/%v/%v/", b.params.MinioCfg.RootPath, "insert_log", collecitonID, partitionID, segmentID)
731+
if b.params.MinioCfg.RootPath != "" {
732+
rootPath = fmt.Sprintf("%s/", b.params.MinioCfg.RootPath)
733+
} else {
734+
rootPath = ""
735+
}
736+
737+
insertPath := fmt.Sprintf("%s%s/%v/%v/%v/", rootPath, "insert_log", collecitonID, partitionID, segmentID)
731738
log.Debug("insertPath", zap.String("insertPath", insertPath))
732739
fieldsLogDir, _, err := b.getStorageClient().ListWithPrefix(ctx, b.milvusBucketName, insertPath, false)
733740
if err != nil {
@@ -754,7 +761,7 @@ func (b *BackupContext) readSegmentInfo(ctx context.Context, collecitonID int64,
754761
})
755762
}
756763

757-
deltaLogPath := fmt.Sprintf("%s/%s/%v/%v/%v/", b.params.MinioCfg.RootPath, "delta_log", collecitonID, partitionID, segmentID)
764+
deltaLogPath := fmt.Sprintf("%s%s/%v/%v/%v/", rootPath, "delta_log", collecitonID, partitionID, segmentID)
758765
deltaFieldsLogDir, _, _ := b.getStorageClient().ListWithPrefix(ctx, b.milvusBucketName, deltaLogPath, false)
759766
deltaLogs := make([]*backuppb.FieldBinlog, 0)
760767
for _, deltaFieldLogDir := range deltaFieldsLogDir {

0 commit comments

Comments
 (0)