mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
enhance: prevent panic by adding null pointer check when clearing InsertRecord _pk2offset_ (#45281)
Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
parent
f19fb283c3
commit
a38a0deb43
@ -593,7 +593,10 @@ class InsertRecordSealed {
|
|||||||
clear() {
|
clear() {
|
||||||
timestamps_.clear();
|
timestamps_.clear();
|
||||||
timestamp_index_ = TimestampIndex();
|
timestamp_index_ = TimestampIndex();
|
||||||
pk2offset_->clear();
|
if (pk2offset_) {
|
||||||
|
pk2offset_->clear();
|
||||||
|
}
|
||||||
|
|
||||||
reserved = 0;
|
reserved = 0;
|
||||||
if (estimated_memory_size_ > 0) {
|
if (estimated_memory_size_ > 0) {
|
||||||
cachinglayer::Manager::GetInstance().RefundLoadedResource(
|
cachinglayer::Manager::GetInstance().RefundLoadedResource(
|
||||||
@ -753,7 +756,9 @@ class InsertRecordGrowing {
|
|||||||
clear() {
|
clear() {
|
||||||
timestamps_.clear();
|
timestamps_.clear();
|
||||||
timestamp_index_ = TimestampIndex();
|
timestamp_index_ = TimestampIndex();
|
||||||
pk2offset_->clear();
|
if (pk2offset_) {
|
||||||
|
pk2offset_->clear();
|
||||||
|
}
|
||||||
reserved = 0;
|
reserved = 0;
|
||||||
data_.clear();
|
data_.clear();
|
||||||
ack_responder_.clear();
|
ack_responder_.clear();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user