You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2016/11/12 00:05:59 UTC

[jira] [Resolved] (ZOOKEEPER-2384) Support atomic increment / decrement of znode value

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

Ted Yu resolved ZOOKEEPER-2384.
-------------------------------
    Resolution: Later

> Support atomic increment / decrement of znode value
> ---------------------------------------------------
>
>                 Key: ZOOKEEPER-2384
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2384
>             Project: ZooKeeper
>          Issue Type: Improvement
>            Reporter: Ted Yu
>              Labels: atomic
>
> Use case is to store reference count (integer type) in znode.
> It is desirable to provide support for atomic increment / decrement of the znode value.
> Suggestion from Flavio:
> {quote}
> you can read the znode, keep the version of the znode, update the value, write back conditionally. The condition for the setData operation to succeed is that the version is the same that it read
> {quote}
> While the above is feasible, developer has to implement retry logic him/herself. It is not easy to combine increment / decrement with other operations using multi.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)