You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by wangsan <wq...@gmail.com> on 2018/08/01 16:51:46 UTC

Re: two data region with two nodes

Thank you for your answer,
Maybe I use region config the wrong way.
There are two apps(more apps with different roles) with different ignite
configs, 
first App 
    :set default region with persistence enable
    :set cache a,with nodefilter in first apps,default region
second app 
    :set default region with persistence disable
    :just access cache a with query

start first app instance 1,second app instance 2,and first app instance 3. 
then close 1, 
then restart 1, the deadlock will happes

fyi, I use ignitelock in first apps when process ignite discovery event such
as join event.  when a new node join, apps 1,3 will receive join message by
local event listener, but I just want one node to process the message, so i
use it like this:

        if (globalLock.tryLock()) {
                LOGGER.info("------  hold global lock ");
                try {
                    switch (event.type()) {
                        case EventType.EVT_NODE_JOINED:
                            joinListener.onMessage(clusterNode);
                            break;
                        case EventType.EVT_NODE_FAILED:
                        case EventType.EVT_NODE_LEFT:
                            leftListener.onMessage(clusterNode);
                            break;
                        default:
                            LOGGER.info("ignore discovery event: {}",
event);
                            break;
                    }
                } finally {
                    LOGGER.debug("------  process event done ");
                    // don't unlock until node left
                    // globalLock.unlock();
                }
            }

the node which hold the globalLock will never unlock unless it left, Is it
the right way with lock




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: two data region with two nodes

Posted by wangsan <wq...@gmail.com>.
tks,
I will try the oldest node select method to ensure only one node to process
the event message.

As mentioned earlier, in my project ,I have several modules。eg:
module A , daemon node with cache nodecache,machinecache .all the cache
persistent。
module B,  search node with cache featureCache,all the caches are
persistent。
module C, processor node with cache hotCache, non-persitence
module D, algo node,via C++ ,with cache algoCache ,non-persitence
more...

B,C,D's cache is private, via cahcenodefilter to guarantee isolation。
A’s cache is public,all the moudles(A,B,C,D...) can access the
nodecache,machinecache .but still use node filter to ensure persistent
data(such as wal,archive) only in module A‘s nodes.  nodecahce just like
cluster.nodes .I just wan't to keep them be persistent.

my topology is:
B1 B2  C1 D1
\   |    |    /  access nodeCache which store in node A1,A2
    A1 A2













--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: two data region with two nodes

Posted by Denis Mekhanikov <dm...@gmail.com>.
I don't think, that data region configuration causes these problems.
What makes you think so?

Try removing the event listeners and see, if these steps lead to the same
problem.

What kind of lock do you use? Is it *IgniteCache.lock()*, or
*Ignite.reentrantLock()*?
Anyways, I would get rid of these locks. You can make the oldest node in
the cluster to be in charge of the message processing.
It can be done as follows:

ignite.events().localListen((e) -> {
    IgniteCluster cluster = ignite.cluster();

    ClusterNode crd = cluster.forOldest().node();
    if (cluster.localNode().id().equals(crd.id()))
        System.out.println("Processing NODE_JOINED");

    return true;
}, EVT_NODE_JOINED);

You can also use *forOldest* along with some predicate to consider nodes of
some particular kind only.
More on cluster groups: https://apacheignite.readme.io/docs/cluster-groups

Denis

ср, 1 авг. 2018 г. в 19:51, wangsan <wq...@gmail.com>:

> Thank you for your answer,
> Maybe I use region config the wrong way.
> There are two apps(more apps with different roles) with different ignite
> configs,
> first App
>     :set default region with persistence enable
>     :set cache a,with nodefilter in first apps,default region
> second app
>     :set default region with persistence disable
>     :just access cache a with query
>
> start first app instance 1,second app instance 2,and first app instance 3.
> then close 1,
> then restart 1, the deadlock will happes
>
> fyi, I use ignitelock in first apps when process ignite discovery event
> such
> as join event.  when a new node join, apps 1,3 will receive join message by
> local event listener, but I just want one node to process the message, so i
> use it like this:
>
>         if (globalLock.tryLock()) {
>                 LOGGER.info("------  hold global lock ");
>                 try {
>                     switch (event.type()) {
>                         case EventType.EVT_NODE_JOINED:
>                             joinListener.onMessage(clusterNode);
>                             break;
>                         case EventType.EVT_NODE_FAILED:
>                         case EventType.EVT_NODE_LEFT:
>                             leftListener.onMessage(clusterNode);
>                             break;
>                         default:
>                             LOGGER.info("ignore discovery event: {}",
> event);
>                             break;
>                     }
>                 } finally {
>                     LOGGER.debug("------  process event done ");
>                     // don't unlock until node left
>                     // globalLock.unlock();
>                 }
>             }
>
> the node which hold the globalLock will never unlock unless it left, Is it
> the right way with lock
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: two data region with two nodes

Posted by wangsan <wq...@gmail.com>.
I just want  A module: node a1 a2 make cache cache_a be  persistence and
balance in A module only with persistence region p_region
B module node b1,b2 with cache cache_b be non_persistence and distribute in
B module.B will access cache_a and have same region p_region for persistence
even cache_b in default region(non_persistence)
and a1,a2 b1,b2 in one cluster. but A won't affect B when a1 restart or all
the A module restart 
But after restart, some weird  things happen, such as baselinetoplogy
smaller then one, or hang with partitionexchangemanager with message : Still
waiting for initial partition map exchange 

I'm confused about ignite's multi roles nodes in one cluster. 
And our node size will be 2000+. I'm worried about the  backward
compatibility and availability of clusters.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: two data region with two nodes

Posted by Вячеслав Коптилин <sl...@gmail.com>.
Hello,

> There are two apps(more apps with different roles) with different ignite
configs,
> first App     :set default region with persistence *enable*
> second app     :set default region with persistence *disable  *

By the way, I don't think that it is a good idea to configure the same data
region using different values of the `enablePersistence` flag.
I hope that such a check will be added in the near future.
https://issues.apache.org/jira/browse/IGNITE-8951

Thanks,
S.

ср, 1 авг. 2018 г. в 19:51, wangsan <wq...@gmail.com>:

> Thank you for your answer,
> Maybe I use region config the wrong way.
> There are two apps(more apps with different roles) with different ignite
> configs,
> first App
>     :set default region with persistence enable
>     :set cache a,with nodefilter in first apps,default region
> second app
>     :set default region with persistence disable
>     :just access cache a with query
>
> start first app instance 1,second app instance 2,and first app instance 3.
> then close 1,
> then restart 1, the deadlock will happes
>
> fyi, I use ignitelock in first apps when process ignite discovery event
> such
> as join event.  when a new node join, apps 1,3 will receive join message by
> local event listener, but I just want one node to process the message, so i
> use it like this:
>
>         if (globalLock.tryLock()) {
>                 LOGGER.info("------  hold global lock ");
>                 try {
>                     switch (event.type()) {
>                         case EventType.EVT_NODE_JOINED:
>                             joinListener.onMessage(clusterNode);
>                             break;
>                         case EventType.EVT_NODE_FAILED:
>                         case EventType.EVT_NODE_LEFT:
>                             leftListener.onMessage(clusterNode);
>                             break;
>                         default:
>                             LOGGER.info("ignore discovery event: {}",
> event);
>                             break;
>                     }
>                 } finally {
>                     LOGGER.debug("------  process event done ");
>                     // don't unlock until node left
>                     // globalLock.unlock();
>                 }
>             }
>
> the node which hold the globalLock will never unlock unless it left, Is it
> the right way with lock
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>