-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Instance metadata will be lost after Nacos restart #11890
Comments
|
The Nacos node that establishes a long-lived gRPC connection with the client does not require restarting the entire Nacos cluster. |
A quick fix might be checking if the instance still exists before setting its metadata expired in private void updateExpiredInfo(boolean expired, ExpiredMetadataInfo expiredMetadataInfo) {
Instance instance = queryInstance(...); // new added code
if (expired && instance == null) {
expiredMetadataInfos.add(expiredMetadataInfo);
} else {
expiredMetadataInfos.remove(expiredMetadataInfo);
}
} But for long term, I think this part should be re-designed. The instance metadata should be bound to an abstracted session (similar to lease in ETCD), instead of to a connection. @KomachiSion Any thoughts on this? |
|
I don't know a better solution, I would do |
It should be fix first by this way, performance problem can be enhanced in future, but if we can get a better way in now. Prefer to use the better performance way.
|
Okay, let me create a PR |
Describe the bug
Instance metadata will be lost after Nacos restart
Expected behavior
Instance metadata is not affected after Nacos restart
Actually behavior
Instance metadata is lost after Nacos restart
How to Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
Additional context
There was an issue #10975 reported a similar problem. The fix to that issue did solve the metadata loss after client reconnection.
But for Nacos restart, the metadata loss issue still persists.
The reason of this bug is that Nacos has a ExpiredClientCleaner that would remove all expired clients.
Consider the three Nacos servers are Nacos1, Nacos2 and Nacos3:
The text was updated successfully, but these errors were encountered: