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 the issue of case sensitivity when matching keys with cache enabled #4820

Merged
merged 102 commits into from
Apr 5, 2023

Conversation

klboke
Copy link
Contributor

@klboke klboke commented Mar 28, 2023

What's the purpose of this PR

Fix the issue of case sensitivity when matching keys with cache enabled

  • Add a configuration config-service.cache.key.ignore-case to control whether the cache key is case-sensitive.

Which issue(s) this PR fixes:

Fixes #3529

klboke and others added 30 commits May 16, 2019 11:07
@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #4820 (c274197) into master (2800a00) will decrease coverage by 0.07%.
The diff coverage is 83.33%.

@@             Coverage Diff              @@
##             master    #4820      +/-   ##
============================================
- Coverage     48.43%   48.36%   -0.07%     
- Complexity     1721     1722       +1     
============================================
  Files           346      346              
  Lines         10819    10827       +8     
  Branches       1076     1078       +2     
============================================
- Hits           5240     5237       -3     
- Misses         5257     5268      +11     
  Partials        322      322              
Impacted Files Coverage Δ
.../configservice/ConfigServiceAutoConfiguration.java 91.66% <0.00%> (ø)
...service/service/config/ConfigServiceWithCache.java 78.66% <87.50%> (+2.19%) ⬆️
...m/ctrip/framework/apollo/biz/config/BizConfig.java 49.29% <100.00%> (+0.72%) ⬆️

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@klboke klboke requested review from mghio and nobodyiam March 28, 2023 04:22
@nobodyiam
Copy link
Member

This attempt is commendable, but a problem may arise if the database is set to be case-sensitive. In such a scenario, the cache loader would fail to fetch data from the database, since the appid, cluster, and namespace have all been converted to lowercase.

@klboke
Copy link
Contributor Author

klboke commented Apr 3, 2023

but a problem may arise if the database is set to be case-sensitive. In such a scenario, the cache loader would fail to fetch data from the database, since the appid, cluster, and namespace have all been converted to lowercase.

There is indeed such a situation, and this PR also considers it. It is currently not enabled by default, and needs to be enabled through a configuration switch. This has also been prominently explained in the documentation.

klboke and others added 8 commits April 4, 2023 10:08
Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nobodyiam nobodyiam merged commit 0b8d655 into apolloconfig:master Apr 5, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 5, 2023
@nobodyiam nobodyiam added this to the 2.2.0 milestone Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants