]
Radim Vansa updated ISPN-7956:
------------------------------
Fix Version/s: 9.4.0.Final
Investigate removing PartitionHandlingInterceptor
-------------------------------------------------
Key: ISPN-7956
URL:
https://issues.jboss.org/browse/ISPN-7956
Project: Infinispan
Issue Type: Task
Components: Core
Affects Versions: 9.1.0.Beta1
Reporter: Dan Berindei
Assignee: Dan Berindei
Fix For: 9.4.0.Final
When all the owners of a key leave the cluster, the distribution interceptor doesn't
know how to handle that key. Instead, it has to signal that to the
{{PartitionHandlingInterceptor}} somehow, and PHI decides whether to return a {{null}}
value or throw an {{AvailabilityException}}.
Single-key read commands and write commands are handled by throwing an
{{AllOwnersLostException}} (initially an {{RpcException}}) from the distribution
interceptor and catching it in {{PartitionHandlingInterceptor}}. If partitioning handling
is disabled, the {{AllOwnersLostException}} is instead caught by
{{StateTransferInterceptor}}, which returns the {{null}} value (for read commands) or
waits for a new topology and retries (for write commands).
For multi-key read commands the distribution interceptor can't throw an exception,
because that would lose the values that were retrieved successfully. For {{GetAllCommand}}
we could get away with storing the values in the context, but that wouldn't work for
functional commands because they transform the values on the remote node. ISPN-7884
removing the values with missing owners from the result collection, but that means values
that are simply missing have to be treated differently, and {{StateTransferInterceptor}}
has to iterate through the list of results again in order to remove them.
It should be simpler to move all the availability checks to the distribution interceptor,
and remove the {{PartitionHandlingInterceptor}}. DI already calls some
{{PartitionHandlingManager}} methods directly, in order to keep track of partially
committed transactions.