milvus/pkg
congqixia b90999b741
fix: Compare config value then swap when caching param value (#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-12 18:51:56 +08:00
..
common enhance: Support analyze data (#33651) 2024-06-06 17:37:51 +08:00
config fix: Compare config value then swap when caching param value (#33785) 2024-06-12 18:51:56 +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 feat: Major compaction (#33620) 2024-06-10 21:34:08 +08:00
mq feat: Major compaction (#33620) 2024-06-10 21:34:08 +08:00
tracer fix: can't generate traceID when use noop exporter (#33191) 2024-05-21 10:39:39 +08:00
util fix: Compare config value then swap when caching param value (#33785) 2024-06-12 18:51:56 +08:00
go.mod enhance: update checker for go version (#33351) 2024-05-24 14:23:40 +08:00
go.sum enhance: sync milvus proto version (#33094) 2024-05-16 18:51:34 +08:00
Makefile Add the mock factory of msg stream (#27834) 2023-10-20 20:14:08 +08:00
rules.go Add back gocritic linter and fix related issues (#27289) 2023-09-22 10:05:26 +08:00