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

Nacos持久化数据的Jraft快照加载生成的缓存存在数据不一致 #11571

Closed
CZJCC opened this issue Dec 28, 2023 · 0 comments · Fixed by #11634
Closed

Nacos持久化数据的Jraft快照加载生成的缓存存在数据不一致 #11571

CZJCC opened this issue Dec 28, 2023 · 0 comments · Fixed by #11634
Assignees
Labels
area/Naming kind/bug Category issues or prs related to bug.
Milestone

Comments

@CZJCC
Copy link
Contributor

CZJCC commented Dec 28, 2023

Describe the bug
When the jraft server started, NacosStateMachine will load the jraft snapshot after initialization. If it is persistent data, PersistentClientOperationServiceImpl will start working, and the readSnapshot method will be called.

IpPortBasedClient is initialized one by one, publishes the ClientRegisterServiceEvent event to the downstream, and then adds the client to the clientManager.
image
image

After ClientServiceIndexesManager processes this event and builds the index, it will publish the ServiceChangedEvent event, which will then be processed by NamingSubscriberServiceV2Impl and submit the PushDelayTask delay task. When this task is executed, generatePushData will be called, which will have the logic to obtain the client from the clientManager.
image

There is a problem here. Since the event is processed asynchronously, there may be a situation where the corresponding client cannot be found and needs to be fixed.

Expected behavior

When the jraft snapshot data is loaded, the cache data of ClientServiceIndexesManager should be consistent with the cache data of ClientServiceIndexesManager in ServiceStorage.

Actually behavior
A clear and concise description of what you actually to happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Naming kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants