zookeeper:Invalid session id 引起客户端不停地自动重连

场景重现:

场景1:不停止clients,删除datadirs

场景2:不停止clients,删除一些snapshots或者重启quorum

 

2017-07-17 18:19:19,338 [myid:0] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:28421:NIOServerCnxnFactory@197] - Accepted socket connection from /10.204.96.205:33317
2017-07-17 18:19:19,338 [myid:0] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:28421:ZooKeeperServer@841] - Refusing session request for client /10.204.96.205:33317 as it has seen zxid 0x2001597f6 our last zxid is 0x10017c19c client must try another server
2017-07-17 18:19:19,338 [myid:0] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:28421:NIOServerCnxn@1007] - Closed socket connection for client /10.204.96.205:33317 (no session established for client)

 

 

 

 

 

zookeeper相关源代码:

 

 if (connReq.getLastZxidSeen() > zk.getZKDatabase().getDataTreeLastProcessedZxid()) {
            String msg = "Refusing session request for client "
                + sock.socket().getRemoteSocketAddress()
                + " as it has seen zxid 0x"
                + Long.toHexString(connReq.getLastZxidSeen())
                + " our last zxid is 0x"
                + Long.toHexString(zk.getZKDatabase().getDataTreeLastProcessedZxid())
                + " client must try another server";

            LOG.info(msg);
            throw new CloseRequestException(msg);
        }

 

最后欢迎大家访问我的个人网站:1024s

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值