You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Michael Han (JIRA)" <ji...@apache.org> on 2017/03/13 16:22:12 UTC

[jira] [Updated] (ZOOKEEPER-2051) Creating ephemeral znodes from within a transaction fail with local sessions

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Han updated ZOOKEEPER-2051:
-----------------------------------
    Fix Version/s:     (was: 3.5.3)
                   3.5.4

> Creating ephemeral znodes from within a transaction fail with local sessions
> ----------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2051
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2051
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.5.0
>            Reporter: Raul Gutierrez Segales
>            Assignee: Raul Gutierrez Segales
>            Priority: Critical
>             Fix For: 3.5.4, 3.6.0
>
>
> With local sessions enabled, the premise is that as soon as you try to create an ephemeral znode your session will be upgraded to global. The problem is that the session upgrade logic doesn't intercept transactions. So creating an ephemeral znode from within a transaction fails with SessionExpired.
> A small example with Kazoo:
> {noformat}
> from kazoo.client import KazooClient
> k = KazooClient("localhost:2181")
> k.start()
> t = k.transaction()
> t.create("/hello_", "", ephemeral=True)
> t.commit()
> [kazoo.exceptions.SessionExpiredError((), {})]
> {noformat}
> A workaround, for now, is to create an ephemeral before your transaction which forces your session to be upgraded.
> Possible solutions could be:
> * extending zookeeper_init() so that you can request global=True
> *  and/or, providing an upgradeSession() API
> Thoughts?
> cc: [~thawan], [~phunt], [~fpj]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)