ayumiono commented on issue #7369:
URL: https://github.com/apache/skywalking/issues/7369#issuecomment-886482213


   > What do you mean 6 records?
   
   thanks for reply, below is code how the persistence worker load cache from ES
   
    ```
   private void loadFromStorage(List<Metrics> metrics) throws IOException {
           if (!enableDatabaseSession) {
               context.clear();
           }
   
           List<String> notInCacheIds = new ArrayList<>();
           for (Metrics metric : metrics) {
               if (!context.containsKey(metric)) {
                   notInCacheIds.add(metric.id());
               }
           }
   
           if (notInCacheIds.size() > 0) {
               List<Metrics> metricsList = metricsDAO.multiGet(model, 
notInCacheIds);
               for (Metrics metric : metricsList) {
                   context.put(metric, metric);
               }
           }
       }
   ```
   suppose notInCacheIds just has one element -> service_instance_id_xxxx, 
since we got 6 indices(*0721~*0726 like i supposed earlier), metricsDAO will 
return 6 records. However the context will just keep only one instance_traffic. 
If the context hold *0726, it will be just what i expect cause the agent report 
the update just for now, for today, and i want the *0726 indice to be updated,  
but  if the context hold other but *0726, it will be strange, cause the agent 
report udpate right now but a older indice for example *0722 updated, right?  
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to