Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: Improve the prompt information when checking partition-key errors #249

Merged
merged 6 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
enhance: Add more output for check part key output
Signed-off-by: Congqi.Xia <congqi.xia@zilliz.com>
congqixia committed Feb 28, 2024
commit 38b3195564c1fa55584c16086e394c57bb23ab7f
8 changes: 7 additions & 1 deletion states/check_partition_key.go
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ import (

type CheckPartitionKeyParam struct {
framework.ParamBase `use:"check-partiton-key" desc:"check partition key field file"`
Storage string `name:"storage" `
StopIfErr bool `name:"stopIfErr" default:"true"`
MinioAddress string `name:"minioAddr" default:"" desc:"the minio address to override, leave empty to use milvus.yaml value"`
OutputFormat string `name:"outputFmt" default:"stdout"`
@@ -110,6 +111,8 @@ func (s *InstanceState) CheckPartitionKeyCommand(ctx context.Context, p *CheckPa
return field.FieldID, field
})

fmt.Printf("Start to check collection %s id = %d\n", collection.Schema.Name, collection.ID)

segments, err := common.ListSegmentsVersion(ctx, s.client, s.basePath, etcdversion.GetVersion(), func(segment *models.Segment) bool {
return segment.CollectionID == collection.ID
})
@@ -121,7 +124,9 @@ func (s *InstanceState) CheckPartitionKeyCommand(ctx context.Context, p *CheckPa
var collectionErrs int
var found bool

for _, segment := range segments {
fmt.Printf("Partition numer: %d, Segment number %d\n", len(partitions), len(segments))

for idx, segment := range segments {
if segment.State == models.SegmentStateDropped || segment.State == models.SegmentStateSegmentStateNone {
continue
}
@@ -229,6 +234,7 @@ func (s *InstanceState) CheckPartitionKeyCommand(ctx context.Context, p *CheckPa
fmt.Printf("Segment %d of collection %s find %d partition-key error\n", segment.ID, collection.Schema.Name, errCnt)
collectionErrs += errCnt
}
fmt.Printf("%d of %d processed\n", idx, len(segments))
}
if p.StopIfErr {
if found {