Skip to content

Commit

Permalink
*: set skip_disk_quota_check parameter to true permanently (#511)
Browse files Browse the repository at this point in the history
Signed-off-by: huanghaoyuanhhy <haoyuan.huang@zilliz.com>
  • Loading branch information
huanghaoyuanhhy authored Jan 21, 2025
1 parent cae2549 commit 50f445f
Show file tree
Hide file tree
Showing 9 changed files with 459 additions and 454 deletions.
1 change: 0 additions & 1 deletion core/backup_impl_restore_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ func (b *BackupContext) RestoreBackup(ctx context.Context, request *backuppb.Res
DropExistCollection: request.GetDropExistCollection(),
DropExistIndex: request.GetDropExistIndex(),
SkipCreateCollection: request.GetSkipCreateCollection(),
SkipDiskQuotaCheck: request.GetSkipImportDiskQuotaCheck(),
MaxShardNum: request.GetMaxShardNum(),
SkipParams: request.GetSkipParams(),
UseV2Restore: request.GetUseV2Restore(),
Expand Down
10 changes: 4 additions & 6 deletions core/client/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,9 @@ type GrpcBulkInsertInput struct {
DB string
CollectionName string
PartitionName string
// offset 0 is path to insertLog file, offset 1 is path to deleteLog file
Paths []string
EndTime int64
IsL0 bool
SkipDiskQuotaCheck bool
Paths []string // offset 0 is path to insertLog file, offset 1 is path to deleteLog file
EndTime int64
IsL0 bool
}

func (m *GrpcClient) BulkInsert(ctx context.Context, input GrpcBulkInsertInput) (int64, error) {
Expand All @@ -377,7 +375,7 @@ func (m *GrpcClient) BulkInsert(ctx context.Context, input GrpcBulkInsertInput)
} else {
opts = append(opts, &commonpb.KeyValuePair{Key: "backup", Value: "true"})
}
skipOpt := &commonpb.KeyValuePair{Key: "skip_disk_quota_check", Value: strconv.FormatBool(input.SkipDiskQuotaCheck)}
skipOpt := &commonpb.KeyValuePair{Key: "skip_disk_quota_check", Value: "true"}
opts = append(opts, skipOpt)

in := &milvuspb.ImportRequest{
Expand Down
10 changes: 4 additions & 6 deletions core/client/restful.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ type RestfulBulkInsertInput struct {
DB string
CollectionName string
PartitionName string
// offset 0 is path to insertLog file, offset 1 is path to deleteLog file
Paths [][]string
EndTime int64
IsL0 bool
SkipDiskQuotaCheck bool
Paths [][]string // offset 0 is path to insertLog file, offset 1 is path to deleteLog file
EndTime int64
IsL0 bool
}

type Restful interface {
Expand Down Expand Up @@ -103,7 +101,7 @@ func (r *RestfulClient) BulkInsert(ctx context.Context, input RestfulBulkInsertI
} else {
opts["backup"] = "true"
}
opts["skip_disk_quota_check"] = strconv.FormatBool(input.SkipDiskQuotaCheck)
opts["skip_disk_quota_check"] = "true"

createReq := createImportReq{
DbName: input.DB,
Expand Down
4 changes: 2 additions & 2 deletions core/proto/backup.proto
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ message RestoreBackupRequest {
bool skipCreateCollection = 15;
string id = 16;
// if true, skip the diskQuota in Import
bool skipImportDiskQuotaCheck = 17;
bool skipImportDiskQuotaCheck = 17 [deprecated=true];
// whether restore RBAC
bool rbac = 18;
// target max shard number
Expand Down Expand Up @@ -334,7 +334,7 @@ message RestoreCollectionTask {
bool dropExistIndex = 17;
// if true will skip create collections
bool skipCreateCollection = 18;
bool skipDiskQuotaCheck = 19;
bool skipDiskQuotaCheck = 19 [deprecated=true]; // when restore, skip disk quota check will always be true
// target max shard number
int32 maxShardNum = 20;
SkipParams skipParams = 21;
Expand Down
859 changes: 432 additions & 427 deletions core/proto/backuppb/backup.pb.go

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions core/restore/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (ct *CollectionTask) restoreDataV2(ctx context.Context) error {
ct.logger.Info("start restore partition segment", zap.Int("partition_num", len(ct.task.GetCollBackup().GetPartitionBackups())))
for _, part := range ct.task.GetCollBackup().GetPartitionBackups() {
if err := ct.restorePartitionV2(ctx, part); err != nil {
return fmt.Errorf("restore_collection: restore partition data v1: %w", err)
return fmt.Errorf("restore_collection: restore partition data v2: %w", err)
}
}

Expand Down Expand Up @@ -556,7 +556,7 @@ func (ct *CollectionTask) restoreNotL0SegV2(ctx context.Context, part *backuppb.
}

if err := ct.bulkInsertViaRestful(ctx, part.GetPartitionName(), paths, false); err != nil {
return fmt.Errorf("restore_collection: restore data v1 bulk insert via restful: %w", err)
return fmt.Errorf("restore_collection: bulk insert via restful: %w", err)
}
}

Expand Down Expand Up @@ -691,13 +691,12 @@ func (ct *CollectionTask) notL0Groups(ctx context.Context, part *backuppb.Partit
func (ct *CollectionTask) bulkInsertViaGrpc(ctx context.Context, partition string, paths []string, isL0 bool) error {
ct.logger.Info("start bulk insert via grpc", zap.Strings("paths", paths), zap.String("partition", partition))
in := client.GrpcBulkInsertInput{
DB: ct.task.GetTargetDbName(),
CollectionName: ct.task.GetTargetCollectionName(),
PartitionName: partition,
Paths: paths,
EndTime: ct.task.GetCollBackup().EndTime,
IsL0: isL0,
SkipDiskQuotaCheck: ct.task.GetSkipDiskQuotaCheck(),
DB: ct.task.GetTargetDbName(),
CollectionName: ct.task.GetTargetCollectionName(),
PartitionName: partition,
Paths: paths,
EndTime: ct.task.GetCollBackup().EndTime,
IsL0: isL0,
}
jobID, err := ct.grpcCli.BulkInsert(ctx, in)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ const docTemplate = `{
"type": "boolean"
},
"skipImportDiskQuotaCheck": {
"description": "if true, skip the diskQuota in Import",
"description": "if true, skip the diskQuota in Import\n\nDeprecated: Marked as deprecated in backup.proto.",
"type": "boolean"
},
"skipParams": {
Expand Down Expand Up @@ -1193,6 +1193,7 @@ const docTemplate = `{
"type": "boolean"
},
"skipDiskQuotaCheck": {
"description": "Deprecated: Marked as deprecated in backup.proto.",
"type": "boolean"
},
"skipParams": {
Expand Down
3 changes: 2 additions & 1 deletion docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@
"type": "boolean"
},
"skipImportDiskQuotaCheck": {
"description": "if true, skip the diskQuota in Import",
"description": "if true, skip the diskQuota in Import\n\nDeprecated: Marked as deprecated in backup.proto.",
"type": "boolean"
},
"skipParams": {
Expand Down Expand Up @@ -1186,6 +1186,7 @@
"type": "boolean"
},
"skipDiskQuotaCheck": {
"description": "Deprecated: Marked as deprecated in backup.proto.",
"type": "boolean"
},
"skipParams": {
Expand Down
6 changes: 5 additions & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,10 @@ definitions:
index or data
type: boolean
skipImportDiskQuotaCheck:
description: if true, skip the diskQuota in Import
description: |-
if true, skip the diskQuota in Import
Deprecated: Marked as deprecated in backup.proto.
type: boolean
skipParams:
allOf:
Expand Down Expand Up @@ -659,6 +662,7 @@ definitions:
description: if true will skip create collections
type: boolean
skipDiskQuotaCheck:
description: 'Deprecated: Marked as deprecated in backup.proto.'
type: boolean
skipParams:
$ref: '#/definitions/backuppb.SkipParams'
Expand Down

0 comments on commit 50f445f

Please sign in to comment.