milvus/pkg
congqixia 62bd51ec6d
fix: [2.4] Compare config value then swap when caching param value (#33785) (#33797)
Cherry-pick from master
pr: #33785
See also #33784

This PR change the behavior of `SetCacheValue` of config manager:

- Use mutex and map instead of concurrent map for `configCache`
- Compare config raw value before set cache value

With this implementation, concurrent caching & eviction shall always
have current output:

|time|caching |eviction|config   |cached   |
|----|--------|------- |---------|---------|
|t0  |get     |        |old value|null     |
|t1  |CAS OK  |        |old value|old value|
|t2  |        |update  |new value|old value|
|t3  |        |eviction|new value|null     |

|time|caching |eviction|config   |cached   |
|----|--------|------- |---------|---------|
|t0  |get     |        |old value|null     |
|t1  |        |update  |new value|null     |
|t2  |CAS fail|        |old value|null     |
|t3  |        |eviction|new value|null     |

|time|caching |eviction|config   |cached   |
|----|--------|------- |---------|---------|
|t0  |        |update  |new value|null     |
|t1  |get     |        |new value|null     |
|t2  |CAS OK  |        |new value|new value|
|t3  |        |eviction|new value|null     |

|time|caching |eviction|config   |cached   |
|----|--------|------- |---------|---------|
|t0  |        |update  |new value|null     |
|t1  |get     |        |new value|null     |
|t2  |        |eviction|new value|null     |
|t3  |CAS OK  |        |new value|new value|

|time|caching |eviction|config   |cached   |
|----|--------|------- |---------|---------|
|t0  |        |update  |new value|null     |
|t1  |        |eviction|new value|null     |
|t2  |get     |        |new value|null     |
|t3  |CAS OK  |        |new value|new value|

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-06-13 17:51:57 +08:00
..
common fix: [2.4] update check for sparse hnsw index (#33714) 2024-06-07 18:36:07 +08:00
config fix: [2.4] Compare config value then swap when caching param value (#33785) (#33797) 2024-06-13 17:51:57 +08:00
eventlog enhance:don't store logPath in meta to reduce memory (#28873) 2024-01-18 22:06:31 +08:00
log fix: log can not reduce level (#28750) 2023-11-28 10:02:27 +08:00
metrics enhance: Execute bloom filter apply in parallel to speed up segment predict (#33793) 2024-06-13 14:14:04 +08:00
mq enhance: Execute bloom filter apply in parallel to speed up segment predict (#33793) 2024-06-13 14:14:04 +08:00
tracer fix:[Cherry-Pick] can't generate traceID when use noop exporter (#33191) (#33208) 2024-05-22 11:13:39 +08:00
util fix: [2.4] Compare config value then swap when caching param value (#33785) (#33797) 2024-06-13 17:51:57 +08:00
go.mod enhance: Bump milvus version to v2.4.2 (#33048) 2024-05-15 13:57:35 +08:00
go.sum enhance: Bump milvus version to v2.4.2 (#33048) 2024-05-15 13:57:35 +08:00
Makefile
rules.go