You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Raul Gutierrez Segales (JIRA)" <ji...@apache.org> on 2014/09/30 22:09:33 UTC

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

Raul Gutierrez Segales created ZOOKEEPER-2051:
-------------------------------------------------

             Summary: 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.1


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)