296 Commits

Author SHA1 Message Date
yihao.dai
fee1f77d4e
fix: [10kcp] Fix incorrect memory estimation for small segments (#38814)
Skip estimation index memory logic for segments without index file.

issue: https://github.com/milvus-io/milvus/issues/37630

pr: https://github.com/milvus-io/milvus/pull/38813

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-12-27 16:07:29 +08:00
yihao.dai
1969ab3da7
enhance: Optimize GetLocalDiskSize and segment loader mutex (#38683)
fix of: https://github.com/milvus-io/milvus/pull/38599

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-12-24 11:19:58 +08:00
yihao.dai
bf27f70c32
enhance: [10kcp] Optimize GetLocalDiskSize and segment loader mutex (#38601)
fix of pr: https://github.com/milvus-io/milvus/pull/38599

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-12-19 21:29:13 +08:00
yihao.dai
ecd55596cf
enhance: [10kcp] Optimize GetLocalDiskSize and segment loader mutex (#38600)
1. Make the segment loader lock protect only the resource.
2. Optimize GetDiskUsage to avoid excessive overhead.

issue: https://github.com/milvus-io/milvus/issues/37630

pr: https://github.com/milvus-io/milvus/pull/38599

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-12-19 21:14:26 +08:00
congqixia
5521091dcd
enhance: [10kcp] Refine querynode collection number metrics (#38352)
Related to #37630

Previously the loaded collection metrics was calculated via scanning all
loaded segment in segment manager, which is slow and buggy
implementation.

This PR:

- Move collection num metrics to collection manager
- Remove deprecated loaded partition metrics update logic

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-12-10 21:06:42 +08:00
congqixia
24a055996b
enhance: [10kcp] Add secondary index for querynode segment manager (#38312)
Cherry pick from pr
#38311
Related to #37630

Add secondary index with vchannel to reduce `GetBy` rlock holding time
when segment number is large.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-12-09 19:56:16 +08:00
yihao.dai
338ccc9ff9
enhance: [10kcp] Reduce memory usage of BF in DataNode and QueryNode (#38133)
1. DataNode: Skip generating BF during the insert phase (BF will be
regenerated during the sync phase).
2. QueryNode: Skip generating or maintaining BF for growing segments;
deletion checks will be handled in the segcore.

issue: https://github.com/milvus-io/milvus/issues/37630

pr: https://github.com/milvus-io/milvus/pull/38129

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-12-02 14:41:19 +08:00
congqixia
d073f322a4
enhance: [2.4] Add cgo call metrics for load/write API (#37405) (#37627)
Cherry-pick from master
pr: #37405

Cgo API cost is not observerable since not metrics is related to them.
This PR add metrics for some sync cgo call related to load & write

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-11-13 13:58:30 +08:00
congqixia
a2a51c489e
fix: [2.4] Check resource when loading deltalogs (#37195) (#37263)
Cherry pick from master
pr: #37195
Related to #36887

`LoadDeltaLogs` API did not check memory usage. When system is under
high delete load pressure, this could result into OOM quit.

This PR add resource check for `LoadDeltaLogs` actions and separate
internal deltalog loading function with public one.

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-10-30 11:54:41 +08:00
aoiasd
8370caa4a6
enhance: [Cherry-pick]Add collection name label for some metric (#36951) (#37159)
pr: https://github.com/milvus-io/milvus/pull/36951

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
2024-10-29 17:38:22 +08:00
congqixia
3d1e81fb31
fix: [2.4] Use singleton delete pool and avoid goroutine leakage (#37225)
Cherry-pick from master
pr: #37220
Related to #36887

Previously using newly create pool per request shall cause goroutine
leakage. This PR change this behavior by using singleton delete pool.
This change could also provide better concurrency control over delete
memory usage.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-10-29 14:44:23 +08:00
yihao.dai
da897e41f4
fix: Fix collection leak in querynode (#37061) (#37079)
Unref the removed L0 segment count.

issue: https://github.com/milvus-io/milvus/issues/36918

pr: https://github.com/milvus-io/milvus/pull/37061

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-10-25 18:19:39 +08:00
congqixia
6bc8aba17f
enhance: [2.4] Batch forward delete when using DirectForward (#37076) (#37107)
Cherry pick from master
pr: #37076
Related #36887

DirectFoward streaming delete will cause memory usage explode if the
segments number was large. This PR add batching delete API and using it
for direct forward implementation.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-10-25 11:53:29 +08:00
congqixia
7eba3aa67e
fix: [2.4] Pass full field list when partial load enabled (#37053) (#37063)
Cherry-pick from master
pr: #37053

Related to #37038

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-10-23 11:03:28 +08:00
congqixia
7acf1d53c1
enhance: [2.4] Preallocate delete data slice to avoid growslice (#37044)
Rewritten based on master pr
pr: #37043

Related to #36887

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-10-22 14:15:28 +08:00
yihao.dai
8923936c9a
enhance: Support memory mode chunk cache (#35347) (#35836)
Chunk cache supports loading raw vectors into memory.

issue: https://github.com/milvus-io/milvus/issues/35273

pr: https://github.com/milvus-io/milvus/pull/35347

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-10-18 17:03:25 +08:00
cqy123456
6934e8da3a
enhance: [2.4]use growingMmapEnabled to control the behavior of interim index, not vectorField (#36391)
issue: https://github.com/milvus-io/milvus/issues/36392
related pr: https://github.com/milvus-io/milvus/pull/36500

Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
2024-10-17 20:23:25 +08:00
yihao.dai
604e346585
enhance: Enhance segment log (#36848) (#36849)
/kind improvement

pr: https://github.com/milvus-io/milvus/pull/36848

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2024-10-15 20:43:30 +08:00
SimFG
548f8e80c3
enhance: [2.4] the estimate method when loading the collection (#36728)
- pr: #36307
- issue: #36530

Signed-off-by: SimFG <bang.fu@zilliz.com>
Signed-off-by: xianliang.li <xianliang.li@zilliz.com>
2024-10-11 10:20:45 +08:00
congqixia
9073f6281e
fix: [2.4] Add defer Unpin when error happens (#36620) (#36665)
Cherry-pick from master
pr: #36620
Resolves: #36619

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-10-08 18:29:20 +08:00
SimFG
a00523f0fd
fix: metric type error when the collection has two vec field (#36473)
- issue: #36395

Signed-off-by: SimFG <bang.fu@zilliz.com>
2024-09-24 20:03:14 +08:00
congqixia
fa6354f6df
enhance: [skip e2e][2.4] Add unittest for reducing duplicated pk from multi segments (#36433) (#36460)
Cherry-pick from master
pr: #36433
Related to #35505 #36362

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-09-24 18:09:14 +08:00
SimFG
95e47bfcf8
fix: force to set the metric type in the search request (#36279)
- issue: #35960
- pr: #35962

Signed-off-by: SimFG <bang.fu@zilliz.com>
2024-09-18 19:21:11 +08:00
congqixia
f7e4db943c
fix: [2.4] overwrite correct selection when pk duplicated (#35826) (#36274)
Cherry-pick from master
pr: #35826
Related to #35505

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-09-14 14:27:07 +08:00
XuanYang-cn
64e109d155
fix: [cp]Change deltalog memory estimation factor to one (#36035)
See also: #36031
pr: #36033

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2024-09-06 18:09:05 +08:00
Zhen Ye
a4533f1b8a
enhance: optimize milvus core building (#35660)
issue: #35549,#35611,#35633
pr: #35610

- remove milvus_segcore milvus_indexbuilder..., add libmilvus_core
- core building only link once
- move opendal compilation into cmake
- fix odr

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2024-08-27 18:55:00 +08:00
congqixia
ab261d0f8b
feat: [2.4] Support field partial load collection (#35416) (#35696)
Cherry-pick from master
pr: #35416
Related to #35415

---------

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-08-27 14:07:00 +08:00
wei liu
35d2f9b210
fix: Fix index memory estimation (#35225) (#35670)
issue: https://github.com/milvus-io/milvus/issues/35229
pr: #32525

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
Co-authored-by: Bingyi Sun <sunbingyi1992@gmail.com>
2024-08-24 10:28:57 +08:00
SimFG
5b5119a51f
feat: [2.4] provide more general configuration to control mmap behavior (#35609)
- issue: #35273
- pr: #35359

Signed-off-by: SimFG <bang.fu@zilliz.com>
2024-08-23 12:35:02 +08:00
wei liu
e2542a1bf5
enhance: Update protobuf-go to protobuf-go v2 (#34394) (#35555)
issue: #34252
pr: #34394 #35072 #35084

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
Co-authored-by: Congqi Xia <congqi.xia@zilliz.com>
2024-08-21 18:50:58 +08:00
congqixia
824b26c209
enhance: [2.4] Pre-allocate space for reduce data structure (#35118) (#35137)
Cherry-pick from master
pr: #35118 
Grow slice & map.growWork may cause a lot when segment number is large
for big K query. This PR pre-allocate space for reduce methods to avoid
this cost.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-08-01 09:59:50 +08:00
zhagnlu
866055527b
enhance: revert remove duplicated pk function (#35102)
pr: #35103

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
2024-07-30 20:03:50 +08:00
zhagnlu
4e02e57044
enhance: mark duplicated pk as deleted (#34619)
pr: #34586

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
2024-07-12 10:27:37 +08:00
wei liu
d3e94f9861
enhance: Use Blocked Bloom Filter instead of basic bloom fitler impl (#34377)
issue: #32995
pr: #33405
To speed up the construction and querying of Bloom filters, we chose a
blocked Bloom filter instead of a basic Bloom filter implementation.

WARN: This PR is compatible with old version bf impl, but if fall back
to old milvus version, it may causes bloom filter deserialize failed.

In single Bloom filter test cases with a capacity of 1,000,000 and a
false positive rate (FPR) of 0.001, the blocked Bloom filter is 5 times
faster than the basic Bloom filter in both querying and construction, at
the cost of a 30% increase in memory usage.

Block BF construct time {"time": "54.128131ms"}
Block BF size {"size": 3021578}
Block BF Test cost {"time": "55.407352ms"}
Basic BF construct time {"time": "210.262183ms"}
Basic BF size {"size": 2396308}
Basic BF Test cost {"time": "192.596229ms"}
In multi Bloom filter test cases with a capacity of 100,000, an FPR of
0.001, and 100 Bloom filters, we reuse the primary key locations for all
Bloom filters to avoid repeated hash computations. As a result, the
blocked Bloom filter is also 5 times faster than the basic Bloom filter
in querying.

Block BF TestLocation cost {"time": "529.97183ms"}
Basic BF TestLocation cost {"time": "3.197430181s"}

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2024-07-05 17:04:10 +08:00
chyezh
a1a0a56f86
enhance: async search and retrieve in cgo (#34200)
issue: #33132
pr: #33133
other pr: #33228, #34084, #33946

- implement future-based cgo utility
- async search and retrieve in cgo
- modify gc configuration document

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2024-07-04 13:02:09 +08:00
wayblink
99586066f5
feat: [cherry-pick] Major compaction (#34326)
This PR cherry-picks the following commits:
fix: speed up segment lookup via channel name in datacoord (#33530)
needed by the next commit
  feat: Major compaction (#33620)

issue: #30633
pr: #33620

---------

Signed-off-by: yiwangdr <yiwangdr@gmail.com>
Signed-off-by: wayblink <anyang.wang@zilliz.com>
Co-authored-by: yiwangdr <80064917+yiwangdr@users.noreply.github.com>
Co-authored-by: MrPresent-Han <chun.han@zilliz.com>
2024-07-02 18:29:01 +08:00
wei liu
c344083f22
enhance: Optimize grow slice cost during query (#34254)
issue: #32252
pr: #34253

This PR try to pre-allocate FieldData for Reduce operations in the Query
chain using typeutil.PrepareResultFieldData to avoid the overhead of
dynamically growing the slice during appendFieldData process.

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2024-07-01 15:18:11 +08:00
jaime
b37d6fa0f9
enhance: decrease cpu overhead during filter segments on datacoord (#34231)
issue: https://github.com/milvus-io/milvus/issues/33129
pr: #33130 
pr: #33373

---------

Signed-off-by: jaime <yun.zhang@zilliz.com>
2024-07-01 10:20:08 +08:00
Bingyi Sun
460815ceab
fix: fix partition loaded num metric (#33316) (#34195)
issue: https://github.com/milvus-io/milvus/issues/32108
related pr: #33316

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2024-06-28 14:58:05 +08:00
cqy123456
f5344abdaf
enhance: [cherry-pick]growing segment support mmap (#34110)
issue: issue: https://github.com/milvus-io/milvus/issues/32984
related pr: https://github.com/milvus-io/milvus/pull/32633,
https://github.com/milvus-io/milvus/pull/33951,
https://github.com/milvus-io/milvus/pull/33993

Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
2024-06-25 14:52:07 +08:00
Jiquan Long
22e6807e9a
feat: support inverted index for array (#33452) (#34053)
pr: https://github.com/milvus-io/milvus/pull/33184
pr: https://github.com/milvus-io/milvus/pull/33452
pr: https://github.com/milvus-io/milvus/pull/33633
issue: https://github.com/milvus-io/milvus/issues/27704
Co-authored-by: xiaocai2333 <cai.zhang@zilliz.com>

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
Co-authored-by: cai.zhang <cai.zhang@zilliz.com>
2024-06-24 10:50:03 +08:00
congqixia
e02a95e3c2
fix: [2.4] Return record with largest timestamp for entires with same PK (#33936) (#34024)
Cherry-pick from master
pr: #33936
See also #33883

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-06-21 14:14:01 +08:00
chyezh
dd6c982bdb
fix: load operation when segment is on releasing (#33699)
issue: #30857
pr: #31340

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2024-06-14 11:47:57 +08:00
wei liu
25d8b74f71
enhance: Execute bloom filter apply in parallel to speed up segment predict (#33793)
issue: #33610
pr: #33792

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2024-06-13 14:14:04 +08:00
wei liu
54feef30e7
enhance: Use BatchPkExist to reduce bloom filter func call cost (#33752)
issue: #33610
pr: #33611

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2024-06-12 17:45:58 +08:00
chyezh
93348af5c0
fix: async warmup will be blocked by state lock (#33687)
issue: #33685
pr: #33686

Signed-off-by: chyezh <chyezh@outlook.com>
2024-06-07 14:23:54 +08:00
Chun Han
627b787aed
fix: query iterator lack results(#33137) (#33422) (#33506)
related: #33137 
pr: https://github.com/milvus-io/milvus/pull/33422

Signed-off-by: MrPresent-Han <chun.han@zilliz.com>
2024-06-05 18:51:52 +08:00
yihao.dai
7384bfe3f8
fix: use seperate warmup pool and disable warmup by default (#33348) (#33349)
1. use a small warmup pool to reduce the impact of warmup
2. change the warmup pool to nonblocking mode
3. disable warmup by default
4. remove the maximum size limit of 16 for the load pool

issue: https://github.com/milvus-io/milvus/issues/32772

pr: https://github.com/milvus-io/milvus/pull/33348

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Co-authored-by: xiaofanluan <xiaofan.luan@zilliz.com>
2024-05-28 19:27:43 +08:00
jaime
8990b8b051
fix: correct error of metrics stats (#33305)
issue: #32980
cherry pick from master
pr:  #33075 #33255

---------

Signed-off-by: jaime <yun.zhang@zilliz.com>
2024-05-24 09:15:41 +08:00
Bingyi Sun
d4a146ef1a
enhance: mmap load raw data if scalar index does not have raw data (#… (#33317)
pr: #33175

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2024-05-24 09:09:42 +08:00