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


   > This is not a bug. We said it is an update, what you were expecting is 
delete and insert.
   
   > This is not a bug. We said it is an update, what you were expecting is 
delete and insert.
   
   @wu-sheng thanks for you reply, i'm afraid that you may misunderstood what 
id said. what i expect is that when the agent update the instance properties to 
the oap server for now, the oap server should save the update into the latest 
indice which is meaningful rather than some older indice, am i right?  
   
   update is right of cause, it is not a bug. What the bug exactlly is the ES 
return multiple docs when we search instance_traffiic by id, and we chose a 
wrong indice to update 
   
   ```
   @Override
       public void combine(final Metrics metrics) {
           final InstanceTraffic instanceTraffic = (InstanceTraffic) metrics;
           this.lastPingTimestamp = instanceTraffic.getLastPingTimestamp();
           if (instanceTraffic.getProperties() != null && 
instanceTraffic.getProperties().size() > 0) {
               this.properties = instanceTraffic.getProperties();
           }
           if (instanceTraffic.getAgentInfo() != null) {
               this.agentInfo = instanceTraffic.agentInfo;
           }
           /**
            * Keep the time bucket as the same time inserted.
            */
           if (this.getTimeBucket() > metrics.getTimeBucket()) {
               this.setTimeBucket(metrics.getTimeBucket());
           }
       }
   ```
   above is InstanceTraffic.combine code, i just confused that why we keep the 
time bucket as the old timebucket, why can not we just keep the newest 
timebucket (which is the time when agent report a instance update to oap 
server) so that we can chose the right indice to update
   
   my english is poor, i hope i deliver my point clealy above, thx!


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