yangpixi commented on PR #3224:
URL: https://github.com/apache/dubbo-go/pull/3224#issuecomment-3952064701

   > > ### Description
   > > Fixes #3223
   > > 目前revision计算机制考虑的参数过少,导致不同服务可能会计算出相同的revision,进而导致冲突
   > > ### Checklist
   > > 
   > > * [x]   I confirm the target branch is `develop`
   > > * [x]   Code has passed local testing
   > > * [x]   I have added tests that prove my fix is effective or that my 
feature works
   > 
   > java部分计算代码:
   > 
   > ```
   > public synchronized String calRevision() {
   >         StringBuilder sb = new StringBuilder();
   >         sb.append(app);
   >         for (Map.Entry<String, ServiceInfo> entry : new 
TreeMap<>(services).entrySet()) {
   >             sb.append(entry.getValue().toDescString());
   >         }
   >         return RevisionResolver.calRevision(sb.toString());
   >     }
   > public String toDescString() {
   >             return this.getMatchKey() + port + path + new 
TreeMap<>(getParams());
   >         }
   > public static String calRevision(String metadata) {
   >         return md5Utils.getMd5(metadata);
   >     }
   > ```
   > 
   > 该代码将字符串拼接起来后再计算md5, golang不方便将url所有参数拼接,所以只选了部分参数
   
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to