-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
关于使用k8s configmap作为持久化策略时潜在的压力风险与写一致性问题 #89
Comments
@dyx1234 @shoothzj 对这个问题有啥建议吗? |
我认为在超过200+pod监听同一个配置下使用当前的configmap缓存机制确实不一定是个很好的主意,不过这应该在100左右的pod下运行正常。你觉得海量是多少呢?
|
个人认为核心点是如何从pods中挑选出一个能被所有pod认可的pod进行写操作,本质是一个一致性协调的问题。考虑到场景是本地缓存,不能依靠apollo进行协调,那只能通过k8s进行协调,这边提一个方案,各位老师可以评估下是否可行:
|
@nobodyiam @shoothzj @dyx1234 CC |
这个是类似选主的思路,可以是一种解法 |
这个方案想做的完备比较困难,很难理论上做出CA的效果,大概率做出来是个AP的选主方案。对于配置中心来说,不是一个很好的语义。 |
对于配置中心来说,配置会倾向于CA。但是配置做持久化存储本身,就是一种倾向于AP的解法,所以是不是不必细究CA还是AP?
梳理完需求,控制写节点的数量的方向是能满足需求的,接下来就是实现细节,是一步到位限制仅有一个节点可写(选主)还是每次允许少量节点(例如2-3个)节点写入的实现更好。
btw,请教一下,在
|
@24kpure 下面 |
感谢您的回复。很抱歉我的问题没有描述清楚,原意是想咨询是否存在server端移除某个key,导致finalExistingData含有删除的key,此时如何移除?。 |
如果各位都没有其它补充,我这就在稍后raise a pr , 妥否? |
我觉得可以,不过如 @shoothzj 所言,实现上有些复杂度,届时可以看下 PR |
## What's the purpose of this PR fix #89 ## Which issue(s) this PR fixes: fix #89 ## Brief changelog reduce conflicts when update configmap in k8s Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/apolloconfig/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything. - [x] Update the [`CHANGES` log](https://github.com/apolloconfig/apollo-java/blob/master/CHANGES.md). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a mechanism to reduce conflicts when updating ConfigMap in Kubernetes. - Enhanced access key secret retrieval for applications. - Added pod write permission controls for ConfigMap management. - **Improvements** - Refined configuration utility for better property handling. - Improved Kubernetes resource management logic. - **Testing** - Updated test suite to improve coverage of Kubernetes-related functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
描述bug(不确定)
在
KubernetesManager.java
中updateConfigMap
方法中将配置持久化至configmap,如果存在海量pod订阅相关配置, 即便有先比对配置,也有可能大量节点会同步进行更新请求仍无法确保readNamespacedConfigMap拿到的配置一定是最新的值重试似乎也无法一定确保(概率较低)持久化成功期望
仅有少量节点(甚至1个)处理配置持久化的任务,减低k8s负载与潜在的写一致性问题
The text was updated successfully, but these errors were encountered: