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


   
   
   
   > Hi, could you get your head clear? If there is no one updates the time 
bucket, there is no chance to insert another new record.
   > 
   > I think this duplicate record is caused by ES is not queryable in the 
short term, then the OAP inserts a new one. This has nothing related to the 
source codes you posted.
   > 
   > Think again because you reply further. Or read your words again, they are 
against each other.
   
   
   
   ```
   indice                                                                       
    id                    
   skywalking-instance_traffic-20210721                        
service_instance_id_xxxx
   skywalking-instance_traffic-20210722                        
service_instance_id_xxxx
   skywalking-instance_traffic-20210723                        
service_instance_id_xxxx
   skywalking-instance_traffic-20210724                        
service_instance_id_xxxx
   skywalking-instance_traffic-20210725                        
service_instance_id_xxxx
   skywalking-instance_traffic-20210726                        
service_instance_id_xxxx
   ```
   indice is above for example, 
   for now,  a instance report a ServiceInstanceUpdate to oap server, 
   ```
   @Override
       public void dispatch(final ServiceInstanceUpdate source) {
           InstanceTraffic traffic = new InstanceTraffic();
           traffic.setTimeBucket(source.getTimeBucket());
           traffic.setName(source.getName());
           traffic.setServiceId(source.getServiceId());
           traffic.setLastPingTimestamp(source.getTimeBucket());
           traffic.setProperties(source.getProperties());
           traffic.setAgentInfo(source.getAgentInfo());
           MetricsStreamProcessor.getInstance().in(traffic);
       }
   ```
   the InstanceTraffic's timebucket is 20210726 right? 
   and when the new InstanceTraffic object received by MetricsPersistentWorker, 
the MetricsPersistentWorker will try to load cache from ES using multiGet(), 
which will use skywalking-instance_traffic/_search and return 6 record right?
   
   if the MetricsPersistentWorker chose the 
skywalking-instance_traffic-20210726 docs to update everything is fine, but 
there is no code to make sure for that now


-- 
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