[JBoss JIRA] (ISPN-3528) CacheLoaderInterceptor.visitEntrySetCommand can hang
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-3528?page=com.atlassian.jira.plugin.... ]
Dan Berindei commented on ISPN-3528:
------------------------------------
On a second thought, I think we need to support non-thread-safe tasks in {{PersistenceManager.processOnAllStores()}} as well, for some users the additional complexity of making the task thread-safe may not be worth the performance benefit.
> CacheLoaderInterceptor.visitEntrySetCommand can hang
> ----------------------------------------------------
>
> Key: ISPN-3528
> URL: https://issues.jboss.org/browse/ISPN-3528
> Project: Infinispan
> Issue Type: Bug
> Components: Locking and Concurrency
> Affects Versions: 6.0.0.Alpha4
> Reporter: Dan Berindei
> Assignee: Mircea Markus
> Priority: Critical
> Fix For: 6.0.0.Beta2
>
>
> {{PersistenceManager.processOnAllStores}} receives a {{CacheLoaderTask}} parameter and calls it on potentially many threads concurrently. So the task object must be thread-safe.
> The {{CacheLoaderTask}}‍s used by {{CacheLoaderInterceptor.visitEntrySetCommand}}/{{visitKeySetCommand}}/{{visitValuesCommand}} are not thread-safe. They use a {{HashSet}} without any synchronization, and when accessed from concurrent threads the map can be corrupted. When this happens, the thread will block in an infinite loop:
> {noformat}
> "testng-LocalModeNoPassivationTest" prio=10 tid=0x00007f19141ac800 nid=0x622c runnable [0x00007f1902a62000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.put(HashMap.java:498)
> at java.util.HashSet.add(HashSet.java:217)
> at java.util.AbstractCollection.addAll(AbstractCollection.java:342)
> at org.infinispan.interceptors.CacheLoaderInterceptor.visitEntrySetCommand(CacheLoaderInterceptor.java:195)
> ...
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (ISPN-604) Re-design CacheStore transactions
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-604?page=com.atlassian.jira.plugin.s... ]
Mircea Markus updated ISPN-604:
-------------------------------
Fix Version/s: 6.0.0.Beta2
(was: 6.0.0.Beta1)
> Re-design CacheStore transactions
> ----------------------------------
>
> Key: ISPN-604
> URL: https://issues.jboss.org/browse/ISPN-604
> Project: Infinispan
> Issue Type: Sub-task
> Components: Loaders and Stores, Transactions
> Affects Versions: 4.0.0.Final, 4.1.0.CR2
> Reporter: Mircea Markus
> Assignee: Mircea Markus
> Labels: as7-ignored, modshape
> Fix For: 6.0.0.Beta2, 6.0.0.CR1
>
>
> Current(4.1.x) transaction implementation in CacheStores is brocken in several ways:
> 1st problem.
> {code}AbstractCacheStore.prepare:
> public void prepare(List<? extends Modification> mods, GlobalTransaction tx, boolean isOnePhase) throws CacheLoaderException {
> if (isOnePhase) {
> applyModifications(mods);
> } else {
> transactions.put(tx, mods);
> }
> }
> {code}
> If this is 1PC we apply the modifications in the prepare phase - we should do it in the commit phase (as JTA does it).
> 2nd problem.
> This currently exhibits during commit/rollback with JdbcXyzCacheStore, but it is rather a more general cache store issue.
> When using a TransactionManager, during TM.commit AbstractCacheStore.commit is being called internally which tries to apply all the modifications that happened during that transaction.
> Within the scope of AbstractCacheStore.commit, JdbcStore obtains a connection from a DataSource and tries to write the modifications on that connection.
> Now if the DataSource is managed (e.g. by an A.S.) on the DS.getConnection call the A.S. would try to enlist the connection with the ongoing transaction by calling Transaction.enlistResource(XAResource xaRes) [1]
> This method fails with an IllegalStateException, because the transaction's status is preparing (see javax.transaction.Transaction.enlistResource).
> Suggested fix:
> - the modifications should be registered to the transaction as they happen(vs. during prepare/commit as it happens now)
> - this requires API changes in CacheStore, e.g.
> void store(InternalCacheEntry entry)
> should become
> void store(InternalCacheEntry entry, GlobalTransaction gtx)
> (gtx would be null if this is not a transactional call).
> [1] This behavior is specified by the JDBC 2.0 Standard Extension API, chapter 7 - distributed transaction
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (ISPN-2034) Add backwards serialization compatibility tests
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-2034?page=com.atlassian.jira.plugin.... ]
Mircea Markus updated ISPN-2034:
--------------------------------
Fix Version/s: 6.0.0.Beta2
(was: 6.0.0.Beta1)
> Add backwards serialization compatibility tests
> -----------------------------------------------
>
> Key: ISPN-2034
> URL: https://issues.jboss.org/browse/ISPN-2034
> Project: Infinispan
> Issue Type: Enhancement
> Components: Marshalling
> Reporter: Galder Zamarreño
> Assignee: Galder Zamarreño
> Labels: compatibility
> Fix For: 6.0.0.Beta2, 6.0.0.CR1
>
>
> Take each existing minor branch, i.e. 4.1.x, 4.0.x,...etc and modify VersionAwareMarshallerTest so that payloads are stored in a data file.
> Then, take data files for each branch and store in git (master and 5.1.x), and try reading them with the existing externalizer/marshalling set up.
> It should work...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months