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

David Handermann updated NIFI-11595:
------------------------------------
    Fix Version/s: 2.0.0
                   1.24.0
                       (was: 1.latest)
                       (was: 2.latest)
       Resolution: Fixed
           Status: Resolved  (was: Patch Available)

> StateProvider.replace() cannot create the initial state
> -------------------------------------------------------
>
>                 Key: NIFI-11595
>                 URL: https://issues.apache.org/jira/browse/NIFI-11595
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Peter Turcsanyi
>            Assignee: Peter Turcsanyi
>            Priority: Major
>             Fix For: 2.0.0, 1.24.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {{StateProvider.replace()}} method properly works when the state already 
> exists and persisted in the storage. However, it cannot create the state at 
> first run.
> As a workaround, {{setState()}} needs to be used but it does not provide the 
> same compare-and-swap mechanism as {{replace()}} so it is the caller 
> responsibility to handle concurrency.
> To lift this responsibility from the clients and also to provide a more 
> consistent API, {{replace()}} should support creating the initial state. It 
> should be able to move the state "from nothing to X" not only "from X1 to X2" 
> and also providing the same compare-and-swap logic.
> Affected {{StateProvider}} implementations:
> - {{ZooKeeperStateProvider}}
> - {{RedisStateProvider}}
> - {{KubernetesConfigMapStateProvider}}
> - {{WriteAheadLocalStateProvider}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to