You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Joseph Percivall (JIRA)" <ji...@apache.org> on 2016/07/19 16:29:20 UTC

[jira] [Created] (NIFI-2317) Functionality of StateManager.replace() when prior state is -1 varies between state providers

Joseph Percivall created NIFI-2317:
--------------------------------------

             Summary: Functionality of StateManager.replace() when prior state is -1 varies between state providers
                 Key: NIFI-2317
                 URL: https://issues.apache.org/jira/browse/NIFI-2317
             Project: Apache NiFi
          Issue Type: Bug
            Reporter: Joseph Percivall
            Priority: Minor


Currently there is local and clustered state. Local is provided by the WriteAheadLocalStateProvider and cluster is provided by ZooKeeperStateProvider. When WriteAheadLocalStateProvider calls replace() with a prior state version of -1 it always returns false[1]. When ZooKeeperStateProvider it will update the state[2]. The API does not state what should happen[3]. 

Functionality should be consistent and documented in the API. I believe the expected behavior is to replace it only if the prior version matches. This means if state is not set, and a user passed a state map of version -1, it should replace.

[1] https://github.com/apache/nifi/blob/8a668fd344f202060d45f0a506f3ab19943f57ee/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/local/WriteAheadLocalStateProvider.java#L220-L220
[2] https://github.com/apache/nifi/blob/fb7b3fe4b87b8c9f45a43d460a3020947ef55dcc/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/zookeeper/ZooKeeperStateProvider.java#L292-L292
[3] https://github.com/apache/nifi/blob/d1129706e235548daaf4eecf7001b244300761e9/nifi-framework-api/src/main/java/org/apache/nifi/components/state/StateProvider.java#L93-L93



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