migrating changes between branches
by Mircea Markus
Hi,
Using svn merge instead of diff-then-apply is better for tracking file revisions, especially when it comes to moving/deleting files etc[1].
I think it important to use svn merge at least when files are renamed/moved/deleted - both for a better revision tracking and for merging correctness. Also helps with conflicts.
Cheers,
Mircea
[1] http://gcc.gnu.org/wiki/SvnMerge
14 years, 3 months
Clarification on ISPN-649
by Galder Zamarreño
Hi,
It seems like there's some confusion about what https://jira.jboss.org/browse/ISPN-649 is trying to fix. Let me explain this in further detail:
Paul found some issues with redeployment of JPA apps and 2nd level cache (see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5563 - currently offline btw). Basically, when SessionFactories are shutdown, all caches are stopped but in an AS environment, the CacheManager keeps running since it's deployed as a shared resource. Upon redeployment and retrieving the caches from the CacheManager, this were in TERMINATED state which meant that no replication happened between them. However, you could, as a client make modifications on those caches if these were local, and you could retrieve data without probs. Obviously, this shouldn't be the case.
Paul's suggestion was that in the 2LC, the code would check the status of the cache and if it was in TERMINATED state, restart it (he actually implemented the condition checking if invocations were allowed, but don't think it's a good idea since other temporary statuses would lead to restarts, i.e. INITIALIZING and that could cause issue).
I disagree with Paul in that such check and restart should be done in DefaultCacheManager. So, DCM, whenever someone calls any of getCache(), it would check whether the cache is TERMINATED, and if it is, it would restart it. After thinking this, I started to consider other possibilities: What happens if the client holds a ref to Cache and someone else stops it? IMO, CacheDelegate should protect against it and if it's TERMINATED, it should restart itself.
Finally, I also considered what would happen if not only Cache was stopped, but DCM was stopped as well. What happens when you call getCache()? When testing this, I discovered that it was returning TERMINATED caches as well. So then I considered whether DCM should attempt to restart itself, but I decided not to do this cos most of the initialisation happens in the ctror, so it's not designed to be restarted. As a result, DCM now throws an IllegalStateException if you call getCache() and it's TERMINATED. Same thing happens with Cache if it discovers that not only it's TERMINATED, but the CacheManager to which it belongs is terminated and this way we cover for cached Cache instances.
So, to sum up:
- Caches can be restarted by either DCM or the Cache instances themselves if they see them as TERMINATED.
- CacheManager's cannot be restarted. Instead a new instance needs to be created.
Hope this clarifies the issue. Please find a patch containing the fix for this. It includes a test case with the possibilities mentioned above:
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
14 years, 3 months
Infinispan on Hudson with IBM JDK
by Sanne Grinovero
Hello,
while my goal is OpenJDK compatibility, as a starter we should fix the
build on IBM JDK, a first step to proof that no com.sun.* packages are
used.
This weekend I reconfigured the build on Hudson to skip the tools
module which is depending on non-standard packages to build the
configuration documentation [1].
I think that for the moment it's not that important to have the
documentation built in a Java standard environment, while it's much
more important to have Infinispan itself work on all Java platforms.
So Hudson is now able to compile and run the tests, but it appears to
hang and then timeout. Could someone look into this?
Regards,
Sanne
1 - http://hudson.infinispan.org/hudson/job/Infinispan-4.1.x-IBM-JDK6-tcp/con...
14 years, 3 months
CassandraCacheStore
by Tristan Tarrant
Dear all,
I am new here and I (would like to) bring gifts :)
First of all thanks for the great work you have been doing on Infinispan. I
was introduced to Infinispan by Sanne, with whom I have collaborated in the
past (hi Sanne!).
Over the last few days I have been writing a CacheStore implementation for
Apache Cassandra, but I have a few unanswered questions I would like to
submit to you before I proceed.
I have written my code by taking inspiration from other CacheStore
providers, namely the JDBM and Hibernate stores.
I hash the key of an entry to produce an appropriate key for Cassandra. I
then store the marshalled value in a Column named "entry" within a
ColumnFamily named "Infinispan". If the entry has an expiration I create
another Column within the "Infinispan" ColumnFamily using the following
pattern: "expiration"+"0paddedtimestamp" containg a placeholder value.
When purgeInternal is invoked I delete all rows which have a column in the
range "Infinispan:expiration0000000000000000" to
"Infinispan:expiration0paddednowtimestamp".
I have noticed that the JDBM CacheStore keeps expiration entries in an
internal LinkedHashMap: is that just for performance reasons ?
Also, Cassandra doesn't support transactional operations, but merely batched
operations: within the applyModifications() method I just send all
operations in one batch invocation. Is this ok ? I guess that Infinispan
manages the transactional side of things.
I am currently developing in my own private Subversion repository and using
my own package name and Junit+mockito in place of testng+easymock. Would
such an object be worthy of potential inclusion within Infinispan itself
(and so should I refactor everything around the org.infinispan package and
integrate nicely with the rest of the tree?). Should I submit a patch to the
current Infinispan trunk ?
Thanks in advance
Tristan
14 years, 3 months
possible bug in TreeCache.put(Fqn fqn, Map<? extends K, ? extends V> data) when passed an empty map
by Scott Marlow
Hi,
I am porting some legacy JBC code (JBoss AS ha-jndi) to Infinispan
(http://anonsvn.jboss.org/repos/jbossas/projects/cluster/ha-server-cache-i...) and ran into a problem that Mircea created ISPN-639 for.
In discussing ISPN-639 on IRC, Mircea said in reference to ISPN-639 "the
condition only happen in very special situations when a put is not
valid. Are you adding e.g. a null key or a null value in this
operation?"
Could someone clarify whether it is legal to pass an empty map to
TreeCache.put(Fqn, Map).
I am currently calling TreeCache.put as follows (in
DistributedTreeManager.createSubcontext(Name name)):
this.cache.put(newf, new HashMap<String, Binding>());
newf is a Fqn (I believe it is a valid one). However, I'm now worried
about passing the empty HashMap as that is probably triggering ISPN-639.
Thanks,
Scott
14 years, 3 months
support for extending Infinispan
by Mircea Markus
Hi,
I've been working on an POC for continuous-query in ISPN. This runs on top of Drools, and is a independent mvn module.
One of the things I needed to do was broadcasting remote commands and make them available in the interceptor chain. As Infinispan does only support a fixed number of Commands and I cannot (and don't want to) add a new command as I am in a different module, I hacked the PutKeyValue: on special key values, my interceptors know that they should handle it. This way, PutKeyValue is not a put per se, but a way to facilitate RPC and an ugly hack :)
I was thinking that a GenericCommand that would contain a Map of parameters would be handy for this scenario. Also a method on the visitor, visitGenericCommand. This would allow integration projects (like cq) to be done nicely. If this sounds appealing I can detail..
Cheers,
Mircea
14 years, 3 months
batching API and DummyTM
by Mircea Markus
Hi,
Thinking some more about batching API(thanks galder!) I think its main benefit it brings is allowing users to use transactions without having to set up/download an TransactionManager.
Very similar to what Brian was describing here: http://community.jboss.org/wiki/BatchModeTransactionManager
"This is all great, but there are uses cases where it's nice to have many of these benefits without the involvement of a JTA Transaction"
I think we should allow people a similar approach, having our own BatchModeTransactionManagerLookup and BatchModeTransactionManager.
Again, this is something to be used when users don't need distributed transactions, and don't want to get their hands dirty with setting up a TM.
Instead of BatchModeTransactionManager we can use Britronix JTA[1] as it is a "a simple but complete implementation of the JTA 1.1 API". Drools is using that and they are happy with it. Actually what about replacing our DummyTM with this one? Less code to maintain and our tests would be run with a more-close-to-spec TM.
Wdyt?
Cheers
[1] http://docs.codehaus.org/display/BTM/Home
14 years, 3 months