-
Notifications
You must be signed in to change notification settings - Fork 34
Change the atomicity mode of some caches to transactional to fix issue 682 #683
Conversation
Add document about transactional semantics for Alcor Caches in general and spefically about Ignite Caches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkommoju A few comments.
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | ||
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> | ||
<property name="peerClassLoadingEnabled" value="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this file for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was for reference only but it can go away now.
this.cache = igniteClient.getOrCreateCache(clientCacheConfig); | ||
logger.log(Level.INFO, "Retrieved cache " + this.cache.getConfiguration().getName() + " AtomicityMode is " + this.cache.getConfiguration().getAtomicityMode()); | ||
} catch (ClientException e) { | ||
logger.log(Level.WARNING, "Create cache for client " + cacheConfig.getName() + " failed:" + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty bad exception. Need to raise the logger level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it to ERROR.
this.cache = ignite.getOrCreateCache(cfg); | ||
logger.log(Level.WARNING, "Create cache for client " + cfg + " failed:" + e.getMessage()); | ||
} catch (Exception e) { | ||
logger.log(Level.WARNING, "Unexpected failure:" + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERROR.
NeighborInfo.class, getNeighborCacheName(entry.getKey())); | ||
CacheConfiguration cfg = new CacheConfiguration(); | ||
cfg.setName(getNeighborCacheName(entry.getKey())); | ||
cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not hard code the atomicity mode here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a dynamic cache so it had to be created with hardcoded atomicity mode set to whatever we want but since some other static caches have TRANSACTIONAL mode, this one is hardcoded.
Better alternative is to have the service config set the atomicity mode and in the code, create the cache in that mode. There is not going to be any use case for atomistic caches, so we need to think about alternative mechanisms.
Fix/subnet concurrent delete issue
… error problem (did not fix)
This pull request introduces 1 alert and fixes 1 when merging 5dcec47 into b4a4288 - view on LGTM.com new alerts:
fixed alerts:
|
How about this PR? @pkommoju We are seeing quite a few of conflicting files. |
Yes, this is expected because changes in two branches are getting combined into one. Let me take a look at them and attach a patch/comments about what to keep what to remove. |
Abandon this PR and branch. I didn't realize it quickly enough. PR#685 already brought in all these changes. |
Close this PR as it is duplicated with PR #685. |
Change all caches in Port Manager to transactional atomicity. Mixing caches of different atomicity mode under a transaction does not work in Ignite. This was causing a failure in concurrent deletion of ports.
Linked to Issue #682