Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Compare config value then swap when caching param value #33785

Merged
merged 1 commit into from
Jun 12, 2024

Commits on Jun 12, 2024

  1. fix: Compare config value then swap when caching param value

    See also milvus-io#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>
    congqixia committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    4a41749 View commit details
    Browse the repository at this point in the history