You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Eduard Shangareev <ed...@gmail.com> on 2018/05/31 14:10:57 UTC
Issues with forceServerMode on clients and unclear contract of
isClient/isClientMode methods
Hi, guys!
I just have found that we widely
misuse org.apache.ignite.cluster.ClusterNode#isClient method.
Now it returns how a node is connected to cluster (as part of the ring or
not).
So, it's not the same as IgniteConfiguration#isClientMode!
But! Actually, we treat as the same thing. At ignite-core we have 57 usages
of ClusterNode#isClient.
And nowhere we care about connection mode.
Well, there is only one case when these methods would return different
values, when forceClientMode=true and clientMode=true.
To fix this I propose next:
1. Deprecate usage of forceClientMode.
2. Create a ticket to remove it in 3.0.
3. Make ClusterNode#isClient what everyone expects.
4. Reconcile other isClient* methods. We should care about way hot client
is connected only in discovery SPI. Otherwise, it should return the same
value as IgniteConfiguration#isClientMode.
Any objections?
Re: Issues with forceServerMode on clients and unclear contract of
isClient/isClientMode methods
Posted by Dmitriy Govorukhin <dm...@gmail.com>.
Eduard,
Sounds reasonable, agree with you.
On Thu, May 31, 2018 at 5:10 PM, Eduard Shangareev <
eduard.shangareev@gmail.com> wrote:
> Hi, guys!
>
> I just have found that we widely
> misuse org.apache.ignite.cluster.ClusterNode#isClient method.
>
> Now it returns how a node is connected to cluster (as part of the ring or
> not).
>
> So, it's not the same as IgniteConfiguration#isClientMode!
>
> But! Actually, we treat as the same thing. At ignite-core we have 57 usages
> of ClusterNode#isClient.
> And nowhere we care about connection mode.
>
> Well, there is only one case when these methods would return different
> values, when forceClientMode=true and clientMode=true.
>
> To fix this I propose next:
> 1. Deprecate usage of forceClientMode.
> 2. Create a ticket to remove it in 3.0.
> 3. Make ClusterNode#isClient what everyone expects.
> 4. Reconcile other isClient* methods. We should care about way hot client
> is connected only in discovery SPI. Otherwise, it should return the same
> value as IgniteConfiguration#isClientMode.
>
>
> Any objections?
>