[ 
https://issues.apache.org/jira/browse/IGNITE-3056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15272785#comment-15272785
 ] 

Artem Shutak commented on IGNITE-3056:
--------------------------------------

A simple fix is to create {{LazyServiceConfiguration}} (before putting inside 
{{GridServiceDeployment}}) that has user provided {{Service}} as bytes and has 
{{Service}} field as transient. As a result, it's not required to have service 
class on all nodes and service deserialization happens only on nodes according 
to filter. I've tried the fix and all works as well.

But the simple fix is not backward compatible.

Also we cannot modify old (create new) classes {{GridServiceDeploymentKey}} and 
{{GridServiceDeployment}} (cannot put new keys/values in sys-cache).

Algorithm do the following:
- node that do deploy put to sys-cache {{GridServiceDeploymentKey}} and 
{{GridServiceDeployment}} pair.
- {{DeploymentListener}} listen for updates and if it finds 
{{GridServiceDeploymentKey}} and we are on oldest node then it creates and puts 
at sys-cache {{GridServiceAssignmentsKey}} and {{GridServiceAssignments}} pair.
- {{AssignmentListener}} listen for updates and if it finds 
{{GridServiceAssignmentsKey}} then it deploys service on local node according 
to information at {{GridServiceAssignments}}. Also, if node that initiated the 
deployment see proper assignment, then the node completes future.

The problem is that the oldest node can know nothing about user's Service 
class. As a result {{Ignite.deploy()}} method on user's node hangs forever 
(because the future will be never completed).

To keep backward compatibility, we have to process {{GridServiceDeployment}} on 
oldest node if it has information about service class (as it work now) or 
process on oldest node according to {{nodeFilter}} (that have to know about 
user's service). The problems is how to understand whether the oldest node have 
processed successfully assignment or not.

> Service implementation class is required even if it's not expected to be 
> deployed on current node
> -------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-3056
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3056
>             Project: Ignite
>          Issue Type: Bug
>          Components: managed services
>    Affects Versions: 1.5.0.final
>            Reporter: Valentin Kulichenko
>            Assignee: Artem Shutak
>              Labels: community, customer, important
>             Fix For: 1.6
>
>
> Currently the service instance is deserialized as part of 
> {{GridServiceDeployment}} and {{GridServiceAssignment}} classes. Need to 
> check if it's possible to deserialize only node filter first, and then 
> deserialize the service itself only if needed. This will allow to use cluster 
> groups with services and deploy the classes accordingly.



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

Reply via email to