chore: add debug log for Nacos config snapshot hits#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. |
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! |
|
Hi @EvanYao826, I checked the updated diff after the rebase. The debug log itself is fine, but adding
If an empty snapshot falls back to a Nacos node that has not yet synchronized, the loader may read the previous non-empty configuration again. This reintroduces the stale-config scenario that the snapshot mechanism is intended to prevent. The latest CI run also confirms this regression through the following failing test:
Since #4319 already implements the original fix, please remove the |
|
@uuuyuqi Thanks for the detailed review and explanation! You're absolutely right — the I'll remove the
Working on removing the |
|
Thanks for the quick update. Please go with option 1 and keep this PR focused on the debug log addition only. I checked the latest diff, and it now only adds the snapshot-hit debug log, which is the right direction. Please also clean up the commit history and PR metadata so this PR no longer presents itself as the fix for #4296, since that was already handled by #4319. A single focused commit would be clearer, for example:
Please also update the PR title and description accordingly, and remove the |
Add a debug-level log message when a Nacos config value is loaded from the local snapshot cache instead of being fetched from the remote server. This aids troubleshooting in cluster mode where snapshot cache hits indicate a config change notification arrived before the remote node synced.
ca32971 to
a836ad3
Compare
|
Hi @uuuyuqi, I've cleaned up this PR as requested:
Ready for another look when you have time. Thanks! |

What does this PR do?
Adds a debug-level log message when a Nacos config value is loaded from the local snapshot cache instead of being fetched from the remote server.
This aids troubleshooting in cluster mode where snapshot cache hits indicate a config change notification arrived before the remote node synced.