-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
The naming module of nacos client have a class service holder.
Service holder have a diskcache feature which is a addition feature for memory cache.
The disk cache feature have some limited , It only take effect when server node changed.
In Production Env, some server nodes is stable and not change for long time.
So I want to improve feature to support diskcache when node is not changed and the file is not exists.
if (diff.hasDifferent()) {
NAMING_LOGGER.info("current ips:({}) service: {} -> {}", serviceInfo.ipCount(), serviceKey,
JacksonUtils.toJson(serviceInfo.getHosts()));
if (!failoverReactor.isFailoverSwitch(serviceKey)) {
NotifyCenter.publishEvent(
new InstancesChangeEvent(notifierEventScope, serviceInfo.getName(), serviceInfo.getGroupName(),
serviceInfo.getClusters(), serviceInfo.getHosts(), diff));
}
DiskCache.write(serviceInfo, cacheDir);
}
Describe the bug
A clear and concise description of what the bug is.
when server node is not change , client disk cache is not enabled
Expected behavior
A clear and concise description of what you expected to happen.
when server node is not change , client disk cache is enabled
Actually behavior
A clear and concise description of what you actually to happen.
when server node is not change , client disk cache is not enabled
How to Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See errors
Desktop (please complete the following information):
- OS: [e.g. Centos]
- Version [e.g. nacos-server 1.3.1, nacos-client 1.3.1]
- Module [e.g. naming/config]
- SDK [e.g. original, spring-cloud-alibaba-nacos, dubbo]
Additional context
Add any other context about the problem here.