提交 fa77783a 编写于 作者: X XuanYang-cn 提交者: yefu.chen

Fix print ddl binlog bug

Signed-off-by: NXuanYang-cn <xuan.yang@zilliz.com>
上级 9f339ef8
......@@ -88,7 +88,6 @@ func (it *IndexAddTask) Execute() error {
t.table = it.table
t.indexID = it.indexID
t.kv = it.kv
t.req = it.req
var cancel func()
t.ctx, cancel = context.WithTimeout(it.ctx, reqTimeoutInterval)
defer cancel()
......@@ -122,7 +121,7 @@ type IndexBuildTask struct {
indexID UniqueID
kv kv.Base
savePaths []string
req *indexbuilderpb.BuildIndexRequest
indexMeta *indexbuilderpb.IndexMeta
}
func newIndexBuildTask() *IndexBuildTask {
......@@ -152,7 +151,7 @@ func (it *IndexBuildTask) Execute() error {
}
typeParams := make(map[string]string)
for _, kvPair := range it.req.GetTypeParams() {
for _, kvPair := range it.indexMeta.Req.GetTypeParams() {
key, value := kvPair.GetKey(), kvPair.GetValue()
_, ok := typeParams[key]
if ok {
......@@ -162,7 +161,7 @@ func (it *IndexBuildTask) Execute() error {
}
indexParams := make(map[string]string)
for _, kvPair := range it.req.GetIndexParams() {
for _, kvPair := range it.indexMeta.Req.GetIndexParams() {
key, value := kvPair.GetKey(), kvPair.GetValue()
_, ok := indexParams[key]
if ok {
......@@ -202,7 +201,7 @@ func (it *IndexBuildTask) Execute() error {
return blobs
}
toLoadDataPaths := it.req.GetDataPaths()
toLoadDataPaths := it.indexMeta.Req.GetDataPaths()
keys := make([]string, 0)
blobs := make([]*Blob, 0)
for _, path := range toLoadDataPaths {
......
......@@ -310,32 +310,28 @@ func printDDLPayloadValues(eventType EventTypeCode, colType schemapb.DataType, r
switch eventType {
case CreateCollectionEventType:
var req internalpb.CreateCollectionRequest
if err := proto.Unmarshal(([]byte)(val), &req); err != nil {
if err := proto.UnmarshalText(val, &req); err != nil {
return err
}
msg := proto.MarshalTextString(&req)
fmt.Printf("\t\t%d : create collection: %s\n", i, msg)
fmt.Printf("\t\t%d : create collection: %v\n", i, req)
case DropCollectionEventType:
var req internalpb.DropPartitionRequest
if err := proto.Unmarshal(([]byte)(val), &req); err != nil {
var req internalpb.DropCollectionRequest
if err := proto.UnmarshalText(val, &req); err != nil {
return err
}
msg := proto.MarshalTextString(&req)
fmt.Printf("\t\t%d : drop collection: %s\n", i, msg)
fmt.Printf("\t\t%d : drop collection: %v\n", i, req)
case CreatePartitionEventType:
var req internalpb.CreatePartitionRequest
if err := proto.Unmarshal(([]byte)(val), &req); err != nil {
if err := proto.UnmarshalText(val, &req); err != nil {
return err
}
msg := proto.MarshalTextString(&req)
fmt.Printf("\t\t%d : create partition: %s\n", i, msg)
fmt.Printf("\t\t%d : create partition: %v\n", i, req)
case DropPartitionEventType:
var req internalpb.DropPartitionRequest
if err := proto.Unmarshal(([]byte)(val), &req); err != nil {
if err := proto.UnmarshalText(val, &req); err != nil {
return err
}
msg := proto.MarshalTextString(&req)
fmt.Printf("\t\t%d : drop partition: %s\n", i, msg)
fmt.Printf("\t\t%d : drop partition: %v\n", i, req)
default:
return errors.Errorf("undefined ddl event type %d", eventType)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册