[
https://issues.apache.org/jira/browse/IGNITE-19059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aleksandr Polovtcev updated IGNITE-19059:
-----------------------------------------
Description:
Current {{VersionedValue}} implementation has the following problem: when
{{get}} and {{complete}} methods are called concurrently, it is possible that
the {{get}} future will never be completed because of a race when updating the
actual token. This can be fixed by introducing a RW lock on {{get}} and
{{complete}} operations.
However, currently this will make the implementation too hard to understand
(there are already locks for the {{update}} method and for history trimming).
Actually, current {{VersionedValue}} implementation encapsulates two
independent concepts: "incremental" updates using the {{update}} method and
publishing the results using the {{complete(long)}} method, and
{{CompletableFuture}}-like approach, when a Versioned Value is complete with
either an explicit value or an exception.
It is proposed to fix all these issues at once:
# Get rid of concurrency issues and introduce more tests.
# Split the Versioned Value implementation in two: one for each concept.
> Fix completion races in Versioned Value
> ---------------------------------------
>
> Key: IGNITE-19059
> URL: https://issues.apache.org/jira/browse/IGNITE-19059
> Project: Ignite
> Issue Type: Task
> Reporter: Aleksandr Polovtcev
> Assignee: Aleksandr Polovtcev
> Priority: Major
> Labels: ignite-3
>
> Current {{VersionedValue}} implementation has the following problem: when
> {{get}} and {{complete}} methods are called concurrently, it is possible that
> the {{get}} future will never be completed because of a race when updating
> the actual token. This can be fixed by introducing a RW lock on {{get}} and
> {{complete}} operations.
> However, currently this will make the implementation too hard to understand
> (there are already locks for the {{update}} method and for history trimming).
> Actually, current {{VersionedValue}} implementation encapsulates two
> independent concepts: "incremental" updates using the {{update}} method and
> publishing the results using the {{complete(long)}} method, and
> {{CompletableFuture}}-like approach, when a Versioned Value is complete with
> either an explicit value or an exception.
> It is proposed to fix all these issues at once:
> # Get rid of concurrency issues and introduce more tests.
> # Split the Versioned Value implementation in two: one for each concept.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)