fix: set report_value default value when extrainfo is not nil for compatibility (#44529)

https://github.com/milvus-io/milvus/issues/44523

Signed-off-by: chasingegg <chao.gao@zilliz.com>
This commit is contained in:
Gao 2025-09-23 22:26:05 +08:00 committed by GitHub
parent 96e1de4e22
commit d5255b5eef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2428,6 +2428,9 @@ func SetStorageCost(status *commonpb.Status, storageCost segcore.StorageCost) {
}
if status.ExtraInfo == nil {
status.ExtraInfo = make(map[string]string)
// set report_value to 0 for compatibility, when extra info is not nil, there are always the default report_value
// see https://github.com/milvus-io/pymilvus/pull/2999, pymilvus didn't check the report_value is set and use the value
status.ExtraInfo["report_value"] = strconv.Itoa(0)
}
status.ExtraInfo["scanned_remote_bytes"] = strconv.FormatInt(storageCost.ScannedRemoteBytes, 10)