Skip to content

Commit

Permalink
fix: Revert reuse deserialize result to fix data overwritten
Browse files Browse the repository at this point in the history
See also milvus-io#34637

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Jul 15, 2024
1 parent 48898ce commit 5783126
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/storage/serde.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ var serdeMap = func() map[schemapb.DataType]serdeEntry {
if v == nil {
return 8
}
return uint64(v.(*schemapb.ScalarField).XXX_Size())
return uint64(proto.Size(v.(*schemapb.ScalarField))) // uint64(v.(*schemapb.ScalarField))
},
}

Expand Down Expand Up @@ -538,9 +538,8 @@ func (deser *DeserializeReader[T]) Next() error {
deser.pos = 0
deser.rec = deser.rr.Record()

if deser.values == nil || len(deser.values) != deser.rec.Len() {
deser.values = make([]T, deser.rec.Len())
}
deser.values = make([]T, deser.rec.Len())

if err := deser.deserializer(deser.rec, deser.values); err != nil {
return err
}
Expand Down

0 comments on commit 5783126

Please sign in to comment.