mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
fix: adding blob memory size in binlog serde (#33324)
See: #33280 Signed-off-by: Ted Xu <ted.xu@zilliz.com>
This commit is contained in:
parent
4004e4c545
commit
a8bd9bea39
@ -925,9 +925,10 @@ func (bsw *BinlogStreamWriter) Finalize() (*Blob, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &Blob{
|
return &Blob{
|
||||||
Key: strconv.Itoa(int(bsw.fieldSchema.FieldID)),
|
Key: strconv.Itoa(int(bsw.fieldSchema.FieldID)),
|
||||||
Value: b.Bytes(),
|
Value: b.Bytes(),
|
||||||
RowNum: int64(bsw.rw.numRows),
|
RowNum: int64(bsw.rw.numRows),
|
||||||
|
MemorySize: int64(bsw.memorySize),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1016,6 +1017,7 @@ func NewBinlogSerializeWriter(schema *schemapb.CollectionSchema, partitionID, se
|
|||||||
if !ok {
|
if !ok {
|
||||||
return nil, 0, errors.New(fmt.Sprintf("serialize error on type %s", types[fid]))
|
return nil, 0, errors.New(fmt.Sprintf("serialize error on type %s", types[fid]))
|
||||||
}
|
}
|
||||||
|
writers[fid].memorySize += int(typeEntry.sizeof(e))
|
||||||
memorySize += typeEntry.sizeof(e)
|
memorySize += typeEntry.sizeof(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,7 @@ func TestBinlogSerializeWriter(t *testing.T) {
|
|||||||
blob, err := w.Finalize()
|
blob, err := w.Finalize()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, blob)
|
assert.NotNil(t, blob)
|
||||||
|
assert.True(t, blob.MemorySize > 0)
|
||||||
newblobs[i] = blob
|
newblobs[i] = blob
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user