sofastack / sofa-registry

SOFARegistry is a production-level, low-latency, high-availability service registry powered by Ant Financial.
https://www.sofastack.tech/sofa-registry/docs/Home
Apache License 2.0
653 stars 247 forks source link

Session Server 异常状态下的实例状态维护 #263

Open shuangchengsun opened 2 years ago

shuangchengsun commented 2 years ago
image (1)

上述图展示了实例(client)的上下线过程, 假设这么一个场景,client1处于下线过程中,此时它已经和session Server断链,但是session Server在发出同步通知前因为某种原因挂了,此时client1在路由表中的状态是如何维护的?

dzdx commented 2 years ago

data上有一个定时器去维护每个session相关数据的,如果session挂了,data大约30s后把挂掉的session的数据清理掉,同时链接挂掉的session上的client(除了要下线的那个)会自动重连到其他session上,然后会把数据增长一个version重新注册到session上,session会再次发到那台data上 @shuangchengsun

dzdx commented 2 years ago

@shuangchengsun com.alipay.sofa.registry.server.data.lease.SessionLeaseManager

shuangchengsun commented 2 years ago

感谢大佬,我去啃一啃代码。 @dzdx