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

Chris Nauroth updated ZOOKEEPER-2051:
-------------------------------------
    Fix Version/s:     (was: 3.5.2)
                   3.5.3

> 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.6.0, 3.5.3
>
>
> 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.4#6332)

Reply via email to