未验证 提交 88c90678 编写于 作者: G godchen 提交者: GitHub

Add hashvalue warning (#10668)

Signed-off-by: Ngodchen <qingxiang.chen@zilliz.com>
上级 140c5c8b
......@@ -1382,7 +1382,9 @@ func (node *Proxy) Delete(ctx context.Context, request *milvuspb.DeleteRequest)
Condition: NewTaskCondition(ctx),
req: deleteReq,
BaseDeleteTask: BaseDeleteTask{
BaseMsg: msgstream.BaseMsg{},
BaseMsg: msgstream.BaseMsg{
HashValues: request.HashKeys,
},
DeleteRequest: internalpb.DeleteRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_Delete,
......
......@@ -683,17 +683,9 @@ func (it *insertTask) checkFieldAutoIDAndHashPK() error {
},
}
it.HashValues = make([]uint32, 0, len(it.BaseInsertTask.RowIDs))
for _, rowID := range it.BaseInsertTask.RowIDs {
hash, _ := typeutil.Hash32Int64(rowID)
it.HashValues = append(it.HashValues, hash)
}
it.HashPK(it.BaseInsertTask.RowIDs)
} else {
it.HashValues = make([]uint32, 0, len(primaryData))
for _, pk := range primaryData {
hash, _ := typeutil.Hash32Int64(pk)
it.HashValues = append(it.HashValues, hash)
}
it.HashPK(it.BaseInsertTask.RowIDs)
}
sliceIndex := make([]uint32, rowNums)
......@@ -705,6 +697,17 @@ func (it *insertTask) checkFieldAutoIDAndHashPK() error {
return nil
}
func (it *insertTask) HashPK(pks []int64) {
if len(it.HashValues) != 0 {
log.Warn("the hashvalues passed through client is not supported now, and will be overwritten")
}
it.HashValues = make([]uint32, 0, len(pks))
for _, pk := range pks {
hash, _ := typeutil.Hash32Int64(pk)
it.HashValues = append(it.HashValues, hash)
}
}
func (it *insertTask) PreExecute(ctx context.Context) error {
sp, ctx := trace.StartSpanFromContextWithOperationName(it.ctx, "Proxy-Insert-PreExecute")
defer sp.Finish()
......@@ -4694,6 +4697,9 @@ func (dt *deleteTask) PostExecute(ctx context.Context) error {
}
func (dt *deleteTask) HashPK(pks []int64) {
if len(dt.HashValues) != 0 {
log.Warn("the hashvalues passed through client is not supported now, and will be overwritten")
}
dt.HashValues = make([]uint32, 0, len(pks))
for _, pk := range pks {
hash, _ := typeutil.Hash32Int64(pk)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册