You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Maxim Muzafarov (Jira)" <ji...@apache.org> on 2019/10/21 13:20:00 UTC

[jira] [Updated] (IGNITE-8629) There is no documentation about on which nodes Ignite Predicate will be executed during service/cache deploying with NodeFilter

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

Maxim Muzafarov updated IGNITE-8629:
------------------------------------
    Fix Version/s:     (was: 2.8)

> There is no documentation about on which nodes Ignite Predicate will be executed during service/cache deploying with NodeFilter
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-8629
>                 URL: https://issues.apache.org/jira/browse/IGNITE-8629
>             Project: Ignite
>          Issue Type: Task
>          Components: documentation
>    Affects Versions: 2.4
>            Reporter: Andrey Aleksandrov
>            Assignee: Prachi Garg
>            Priority: Major
>
> In documentation we could see that:
> [https://apacheignite.readme.io/docs/service-grid#section-node-filter-based-deployment]
> This approach is based on a filtering predicate that gets called on every node at the time Ignite Service engine determines a set of possible candidates for the Ignite Service deployment. 
> Looks like it's not correct because in Ignite 2.4 next code:
> {code:java}
> Ignite ignite = IgnitionEx.start("examples/config/example-ignite.xml", "ignite-1");
> Ignite ignite2 = IgnitionEx.start("examples/config/example-ignite.xml", "ignite-2");
> // Deploy services only on server nodes.
> ignite2.services().deploy(new ServiceConfiguration()
>     .setMaxPerNodeCount(1)
>     .setNodeFilter(new IgnitePredicate<ClusterNode>() {
>         @IgniteInstanceResource Ignite filterIgnite;
>         @Override public boolean apply(ClusterNode node) {
>             System.out.println("Is local node: " + node.isLocal());
>             System.out.println("ignite: " + (isNull(filterIgnite) ? null : filterIgnite.name()));
>             return true;
>         }
>     })
>     .setName("my-service")
>     .setService(new SimpleMapServiceImpl<>())
> );
> {code}
> Will be executed only on "ignite-1"
> {code:java}
> Is local node: true
> ignite: ignite-1
> Is local node: false
> ignite: ignite-1
> Service was initialized: my-service
> Is local node: true
> ignite: ignite-1
> Is local node: false
> ignite: ignite-1
> Service was initialized: my-service
> Executing distributed service: my-service
> Executing distributed service: my-service
> Is local node: true
> ignite: ignite-1
> Is local node: false
> ignite: ignite-1
> {code}
> Looks like ignite-1 is the coordinator node in this case. But this behavior is different from described in the documentation.
> Also, this should be described in case of the cache deployment:
> {code:java}
> Ignite ignite = IgnitionEx.start("examples/config/example-ignite.xml", "ignite-1");
> Ignite ignite2 = IgnitionEx.start("examples/config/example-ignite.xml", "ignite-2");
> // Deploy services only on server nodes.
> ignite2.services().deploy(new ServiceConfiguration()
>     .setMaxPerNodeCount(1)
>     .setNodeFilter(new IgnitePredicate<ClusterNode>() {
>         Ignite filterIgnite;
>         @Override public boolean apply(ClusterNode node) {
>             System.out.println("Is local node: " + node.isLocal());
>             System.out.println("ignite: " + (isNull(filterIgnite) ? null : filterIgnite.name()));
>             return true;
>         }
>         @IgniteInstanceResource
>         void setFilterIgnite(Ignite filterIgnite) {
>             this.filterIgnite = filterIgnite;
>         }
>     })
>     .setName("my-service")
>     .setService(new SimpleMapServiceImpl<>())
> );
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)