You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "colin-si (via GitHub)" <gi...@apache.org> on 2024/01/02 07:59:14 UTC

[I] 是否可以提供实例ID复用的能力 [servicecomb-service-center]

colin-si opened a new issue, #1443:
URL: https://github.com/apache/servicecomb-service-center/issues/1443

   **Is your feature request related to a problem? Please describe.**
   当前微服务进程如果发生重启后,会重新向注册中心注册,注册中心会生成一个新的实例ID。但是在很多业务场景下,不希望每次进程重启实例ID就发生变更,希望有机制可以服务该实例之前注册过的实例ID。比如说:k8s纳管场景,业务的podName不变的情况下(这个定位信息支持业务自定义),向注册中心注册的对应的实例ID可以保持不变。
   
   **Describe the solution you'd like**
   注册中心可以在etcd中添加一个存储,用于标识定位信息(需要包含serviceId和业务自定义的定位信息)和instanceId的映射。这样每次当有一个新的注册请求发送到注册中心的时候(未携带instanceId),SC根据请求体中的定位信息向etcd查询是否有定位信息到instanceID的映射,如果可以查到,则说明之前有注册过,则取其instanceId进行复用;如果etcd里当前没有该映射信息,则说明之前没有人根据该定位进行进行注册,则SC新分配一个instanceID来注册使用,并且同时将定位信息和该instanceId的映射关闭写入etcd,用于下次复用。
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features you've considered.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   


-- 
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: commits-unsubscribe@servicecomb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org