You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Damon Liu (Jira)" <ji...@apache.org> on 2021/03/17 03:47:00 UTC

[jira] [Created] (ZOOKEEPER-4254) Connecting to ZooKeeper at different times allocates the same session

Damon Liu created ZOOKEEPER-4254:
------------------------------------

             Summary: Connecting to ZooKeeper at different times allocates the same session
                 Key: ZOOKEEPER-4254
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4254
             Project: ZooKeeper
          Issue Type: Bug
    Affects Versions: 3.4.13
            Reporter: Damon Liu
         Attachments: AA.log, zookeeper.log

App AA connects to ZooKeeper and creates a temporary path such as /brokers/ids/10. Another APP BB also connects to ZooKeeper. At some point AA BB and ZooKeeper are restarted, and BB allocates AA's old session

before restart:
 AA connect to zookeeper ,and log in zk:
 [2021-03-07 08:47:43,468] INFO [SyncThread:0] Established session {color:#FF0000}0x10000053ef90000{color} with negotiated timeout 8000 for client /{color:#FF0000}22.20.0.45{color}:59966 (org.apache.zookeeper.server.ZooKeeperServer)

 

after restart:

BB connect to zookeeper ,and log in zk:

[2021-03-07 08:58:51,351] INFO [SyncThread:0] Established session {color:#FF0000}0x10000053ef90000{color} with negotiated timeout 30000 for client /{color:#FF0000}22.20.0.47{color}:39360 (org.apache.zookeeper.server.ZooKeeperServer)

 

I understand that after a restart, ZooKeeper loads old transaction logs and snapshot files, and old sessions and temporary paths are loaded. If BB obtains the old session 0x10000053ef90000 at this point, the session will not expire and the temporary path will not be deleted, causing AA to be unable to re-register the temporary path

This is my question. I look forward to your help. Thank you very much!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)