Ignite C# client does not report correct node ID after reconnection

classic Classic list List threaded Threaded
3 messages Options
Raymond Wilson Raymond Wilson
Reply | Threaded
Open this post in threaded view
|

Ignite C# client does not report correct node ID after reconnection

I have discovered a bug in the Ignite 2.8.1 C# client related to the node id reported by IIgnite.GetCluster().GetLocalNode().Id

When a client is started and GetCluster() is called, the client retrieves and stores a copy of the local node returned from GetNodes(). This cached local node contains the node id:

        /** <inheritdoc /> */
        public IClusterNode GetLocalNode()
        {
            return _locNode ?? (_locNode =
                       GetNodes().FirstOrDefault(x => x.IsLocal) ??
                       ForDaemons().GetNodes().FirstOrDefault(x => x.IsLocal));
        }

If the client node needs to reconnect with the grid due to failure or restart of other nodes in the grid then the client establishes a new client ID when it reconnects. This new ID is not reflected in the cached local node. If this ID is later relied on, for example in our case,  to determine a node in the grid topology as a part of a query process, then the result will be an empty topology projection.

As the local client id is never changed once set then the only mitigation at present is to kill client nodes once they enter this state.

There is quite a bit of other state present in that cached local node that may be at risk of being inconsistent if the underlying grid information changes.

Thanks,
Raymond.


--

Raymond Wilson
Solution Architect, Civil Construction Software Systems (CCSS)
11 Birmingham Drive | Christchurch, New Zealand
<a href="tel:+64-21-2013317" style="background-color:transparent;color:rgb(54,53,69)" target="_blank">+64-21-2013317 Mobile
[hidden email]
ptupitsyn ptupitsyn
Reply | Threaded
Open this post in threaded view
|

Re: Ignite C# client does not report correct node ID after reconnection

Raymond, thank you for this bug report.
I've filed a ticket [1].

I'll see if that's possible to squeeze the fix into the 2.9 release, 
otherwise you can expect it in 2.10. Will keep you posted.


On Tue, Aug 18, 2020 at 10:02 AM Raymond Wilson <[hidden email]> wrote:
I have discovered a bug in the Ignite 2.8.1 C# client related to the node id reported by IIgnite.GetCluster().GetLocalNode().Id

When a client is started and GetCluster() is called, the client retrieves and stores a copy of the local node returned from GetNodes(). This cached local node contains the node id:

        /** <inheritdoc /> */
        public IClusterNode GetLocalNode()
        {
            return _locNode ?? (_locNode =
                       GetNodes().FirstOrDefault(x => x.IsLocal) ??
                       ForDaemons().GetNodes().FirstOrDefault(x => x.IsLocal));
        }

If the client node needs to reconnect with the grid due to failure or restart of other nodes in the grid then the client establishes a new client ID when it reconnects. This new ID is not reflected in the cached local node. If this ID is later relied on, for example in our case,  to determine a node in the grid topology as a part of a query process, then the result will be an empty topology projection.

As the local client id is never changed once set then the only mitigation at present is to kill client nodes once they enter this state.

There is quite a bit of other state present in that cached local node that may be at risk of being inconsistent if the underlying grid information changes.

Thanks,
Raymond.


--

Raymond Wilson
Solution Architect, Civil Construction Software Systems (CCSS)
11 Birmingham Drive | Christchurch, New Zealand
<a href="tel:+64-21-2013317" style="background-color:transparent;color:rgb(54,53,69)" target="_blank">+64-21-2013317 Mobile
[hidden email]
Raymond Wilson Raymond Wilson
Reply | Threaded
Open this post in threaded view
|

Re: Ignite C# client does not report correct node ID after reconnection

Thanks Pavel.

Fortunately we may have a work around by defining a separate immutable ID as an attribute and querying that to create the projection so hopefully it is not a blocker for us.

Cheers,
Raymond.


On Tue, Aug 18, 2020 at 9:28 PM Pavel Tupitsyn <[hidden email]> wrote:
Raymond, thank you for this bug report.
I've filed a ticket [1].

I'll see if that's possible to squeeze the fix into the 2.9 release, 
otherwise you can expect it in 2.10. Will keep you posted.


On Tue, Aug 18, 2020 at 10:02 AM Raymond Wilson <[hidden email]> wrote:
I have discovered a bug in the Ignite 2.8.1 C# client related to the node id reported by IIgnite.GetCluster().GetLocalNode().Id

When a client is started and GetCluster() is called, the client retrieves and stores a copy of the local node returned from GetNodes(). This cached local node contains the node id:

        /** <inheritdoc /> */
        public IClusterNode GetLocalNode()
        {
            return _locNode ?? (_locNode =
                       GetNodes().FirstOrDefault(x => x.IsLocal) ??
                       ForDaemons().GetNodes().FirstOrDefault(x => x.IsLocal));
        }

If the client node needs to reconnect with the grid due to failure or restart of other nodes in the grid then the client establishes a new client ID when it reconnects. This new ID is not reflected in the cached local node. If this ID is later relied on, for example in our case,  to determine a node in the grid topology as a part of a query process, then the result will be an empty topology projection.

As the local client id is never changed once set then the only mitigation at present is to kill client nodes once they enter this state.

There is quite a bit of other state present in that cached local node that may be at risk of being inconsistent if the underlying grid information changes.

Thanks,
Raymond.


--

Raymond Wilson
Solution Architect, Civil Construction Software Systems (CCSS)
11 Birmingham Drive | Christchurch, New Zealand
<a href="tel:+64-21-2013317" style="background-color:transparent;color:rgb(54,53,69)" target="_blank">+64-21-2013317 Mobile
[hidden email]


--

Raymond Wilson
Solution Architect, Civil Construction Software Systems (CCSS)
11 Birmingham Drive | Christchurch, New Zealand
<a href="tel:+64-21-2013317" style="background-color:transparent;color:rgb(54,53,69)" target="_blank">+64-21-2013317 Mobile
[hidden email]