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

Cache key normalize #3542

Closed
wants to merge 6 commits into from
Closed

Conversation

Q-RK
Copy link
Contributor

@Q-RK Q-RK commented Feb 6, 2021

What's the purpose of this PR

修复 config-service 开启缓存后对客户端 app.id 配置大小写敏感的问题

Which issue(s) this PR fixes:

Fixes #3529

Brief changelog

  1. 在 ConfigServiceWithCache 中定义 LoadingCache 的装饰者类,负责处理key的大小写问题
  2. ConfigServiceWithCache优先取大小写敏感的结果(兼容目前的逻辑)
  3. 若区分大小的key获取的值为空,则key转为小写获取对应的值

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.

@nobodyiam
Copy link
Member

I think we need to consider the following situation:

  1. The correct appId is hello
  2. Client1 access the config service via appId hello
  3. Client2 access the config service via appId Hello

BTW, I think they can all get the correct configuration without this pull request (as long as the backend mysql is case insensitive).

After the configuration of hello changes, only client1 can get the updated configuration and client2 will always get the old configuration.

@nobodyiam nobodyiam added this to the 1.9.0 milestone May 23, 2021
@JaredTan95
Copy link
Member

as #3747 merged, please update changs log. :-)

@nobodyiam nobodyiam modified the milestones: 1.9.0, 1.10.0 Aug 7, 2021
@nobodyiam nobodyiam removed this from the 2.0.0 milestone Nov 6, 2021
@stale
Copy link

stale bot commented Dec 6, 2021

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Dec 6, 2021
@stale
Copy link

stale bot commented Dec 20, 2021

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this Dec 20, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants