fix: use config snapshot in NacosConfigDataLoader to fix stale config in cluster mode#4333
Conversation
|
I have read the CLA Document and I hereby sign the CLA |
d352f17 to
868ea6a
Compare
|
|
Thanks for the heads up! I have rechecked and signed the CLA. Please let me know if there are any further issues. |
It has been found that you have not signed the CLA. After signing, the CLA will appear green instead of the current yellow. |
|
I have rechecked and signed the CLA. The status should be updated now. Please let me know if there are any other issues. @xuxiaowei-com-cn |
After signing, the CLA will appear green instead of the current yellow.
|
|
I have read the CLA Document and I hereby sign the CLA @xuxiaowei-com-cn I have signed the CLA again. The commit email is correctly set to the noreply format (155432245+EvanYao826@users.noreply.github.com). Could you please check if the CLA status has been updated? If it still shows as not signed, I may need to click the recheck link again. |
After you have completed the signing process, please click recheck. |
|
GitHub Actions run has been approved. |
|
Hi @EvanYao826, thanks for the PR. This overlaps with #4319, which was opened earlier and also fixes #4296, while additionally covering a few related consistency concerns (atomic read-and-remove of the snapshot, distinguishing an empty snapshot from a missing one, namespace-aware key, plus unit tests). We're going to move forward with #4319 to close out the issue, so this PR will be closed in favor of that one. Before submitting future PRs, a quick scan of open PRs and issue comments helps avoid duplicate work — but the effort here is appreciated regardless. |
… in cluster mode Fixes alibaba#4296. The config snapshot mechanism from PR alibaba#3644 was not applied to the Spring Boot 3.x ConfigData API path (NacosConfigDataLoader). In Nacos cluster mode, when a config change notification arrives from one node but the fetch goes to another node that hasn't synced yet, the client gets stale config. Assisted-by: Hermes Agent
868ea6a to
4522b14
Compare
|
Rebased onto latest |
|
I have read the CLA Document and I hereby sign the CLA |
|
Hi @uuuyuqi, thanks for the review! You're right that this overlaps with #4319. After rebasing onto the latest
If these additions are useful, I'm happy to keep this PR open. Otherwise, feel free to close it if the team considers #4319 sufficient. Let me know! |
|
Hi, friendly ping — CLA is signed and all CI checks are passing. Could a maintainer take a look when available? Thanks! |

What does this PR do?
Fixes #4296: the config snapshot mechanism from PR #3644 is not effective in 2025.1.0.0.
Root Cause
In Spring Boot 3.x (2025.x), config loading goes through
NacosConfigDataLoader.pullConfig()instead ofNacosPropertySourceBuilder.loadNacosData(). The snapshot mechanism was only integrated into the old path.Changes
NacosConfigDataLoader.pullConfig(): CheckNacosSnapshotConfigManagerbefore callingconfigService.getConfig()NacosSnapshotConfigManagerAssisted-by: Hermes Agent