IgniteCache.close() deletion behavior

classic Classic list List threaded Threaded
4 messages Options
augustus.thoo augustus.thoo
Reply | Threaded
Open this post in threaded view
|

IgniteCache.close() deletion behavior

Hi,

I have been using Ignite for a week. I observed that calling close() would remove the cache from all of the nodes. Its Javadoc states:

"Completely deletes the cache with all its data from the system on all cluster nodes."

Note: Sourced from "ignite-core-1.0.4-javadoc.jar" under GridGain External Repository.


Referring to javax.cache.Cache javadoc returns this :

"Closing a Cache signals to the CacheManager that produced or owns the Cache that it should no longer be managed."


In my tests, I have configured a cache in XML, supported by 2 server nodes. Calling cache.close() from a client node did removed the cache from the server nodes. The only way to restore the cache as configured is by restarting the affected server nodes.

If this is true, this behavior has far-reaching impact in production environment.

Is there a way for server or admin to ignore or block any deletion calls from client nodes? I would like a way to configure the cache to be sticky in the grid so long as the configuration stays in the XML.

Thanks.

 




Ognen Duzlevski Ognen Duzlevski
Reply | Threaded
Open this post in threaded view
|

Re: IgniteCache.close() deletion behavior

On Wed, May 20, 2015 at 5:31 AM, augustus.thoo <[hidden email]> wrote:
Hi,

I have been using Ignite for a week. I observed that calling close() would
remove the cache from all of the nodes. Its Javadoc states:

Augustus, 

we discussed this on the dev list here:

Regards,
Ognen
 
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|

Re: IgniteCache.close() deletion behavior

In reply to this post by augustus.thoo
This has been a tricky point, as there is also another javadoc for CacheManager.destroyCache() method which states that it is equivalent to calling Cache.clear() and then Cache.close(). In this context, method Cache.close() should destroy the cache.

However, given the ambiguity in the spec, we should take the approach of least surprise and have close() method release all the resources without deleting the whole cache. Looks like Alexey has already filed a ticket for it which should not be hard to fix:

https://issues.apache.org/jira/browse/IGNITE-929

augustus.thoo wrote
If this is true, this behavior has far-reaching impact in production environment.

Is there a way for server or admin to ignore or block any deletion calls from client nodes? I would like a way to configure the cache to be sticky in the grid so long as the configuration stays in the XML.
Well, even in the absence of the "close" method, you still have Cache.remove(...) and Cache.clear(...) methods. Are you trying to disable all cache updates and deletes altogether?

D.
augustus.thoo augustus.thoo
Reply | Threaded
Open this post in threaded view
|

RE: IgniteCache.close() deletion behavior

Hello dsetrakyan,

 

> Are you trying to disable all cache updates and deletes altogether?

 

Short answer: No.

Long answer: Looking that the discussion thread, I share Andrey Komev’s views. My last mail was in a way, to express my surprise at how wide the impact from one client call to ‘cache.close()’, especially in an production environment.

 

In the end, although unexpected, this behaviour can be managed on my end.

 

Thank you.

 

 

N2N DISCLAIMER:

This e-mail (including any attachments) may contain confidential information. If you are not the intended recipient, you are hereby notified that any review, distribution, printing, copying or use of this e-mail is strictly prohibited. If you have received this email in error, please notify the sender or N2N CONNECT BERHAD immediately and delete the original message. Opinions, conclusions and other information in this e-mail that do not relate to the official business of N2N CONNECT BERHAD shall be understood as neither given nor endorsed by N2N CONNECT BERHAD accepts any responsibility for the same. All liability arising from or in connection with computer viruses and/or corrupted e-mail is excluded to the fullest permitted by law.

 

From: dsetrakyan [via Apache Ignite Users] [mailto:ml-node+[hidden email]]
Sent: Thursday, 21 May, 2015 5:47 AM
To: Augustus Thoo
Subject: Re: IgniteCache.close() deletion behavior

 

This has been a tricky point, as there is also another javadoc for CacheManager.destroyCache() method which states that it is equivalent to calling Cache.clear() and then Cache.close(). In this context, method Cache.close() should destroy the cache.

However, given the ambiguity in the spec, we should take the approach of least surprise and have close() method release all the resources without deleting the whole cache. Looks like Alexey has already filed a ticket for it which should not be hard to fix:

https://issues.apache.org/jira/browse/IGNITE-929

augustus.thoo wrote

If this is true, this behavior has far-reaching impact in production environment.

Is there a way for server or admin to ignore or block any deletion calls from client nodes? I would like a way to configure the cache to be sticky in the grid so long as the configuration stays in the XML.

Well, even in the absence of the "close" method, you still have Cache.remove(...) and Cache.clear(...) methods. Are you trying to disable all cache updates and deletes altogether?

D.


If you reply to this email, your message will be added to the discussion below:

http://apache-ignite-users.70518.x6.nabble.com/IgniteCache-close-deletion-behavior-tp338p353.html

To unsubscribe from IgniteCache.close() deletion behavior, click here.
NAML