Ignite as L2 cache in JBoss6

classic Classic list List threaded Threaded
12 messages Options
aosmakoff aosmakoff
Reply | Threaded
Open this post in threaded view
|

Ignite as L2 cache in JBoss6

Hi there.
We are trying to use Ignite/GridGain as L2 cache for our hibernate application(s) running in JBoss 6.x that configured with JTA transaction manager. The program fails to update the cache with a Timeout error.
We narrowed it down to the code in GridCacheJtaManager::checkJta() line containing:

if (!jtaTx.enlistResource(rsrc))

where the Tx updates the resource parameters including the timeout. The problems seems to be that JTA treats the timeout value in seconds than Ignite/GridGain uses mSec, effectively reducing the specified (in the container) value by 1000 times. (In Ignite the class is CacheJtaManager)
 
Please see the error below (we used the default JTA timeout = 300sec)

class org.gridgain.grid.cache.GridCacheTxTimeoutException: Cache transaction timed out: GridLocalTx [fut=null, super=GridCacheTxLocalAdapter [completedBase=null, partLock=false, sndTransformedVals=false, super=GridCacheTxAdapter [xidVer=GridCacheVersion [topVer=46169865, nodeOrderDrId=1, globalTime=1434692163247, order=1434689857213], writeVer=null, implicit=false, implicitSingle=false, loc=true, threadId=362, startTime=1434692163238, nodeId=38301945-ced9-4707-abfe-1ad1de827423, startVer=GridCacheVersion [topVer=46169865, nodeOrderDrId=1, globalTime=1434692163247, order=1434689857213], endVer=null, isolation=READ_COMMITTED, concurrency=PESSIMISTIC, timeout=300, sysInvalidate=false, commitVer=null, finalizing=NONE, preparing=false, state=MARKED_ROLLBACK, timedOut=true, topVer=-1, duration=564ms, grpLock=false, onePhaseCommit=false], size=3]]


Is this a know issue and is there any workaround.

Many thanks,

Regards,

Alex
yakov yakov
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

Alex, I have filed the ticket - https://issues.apache.org/jira/browse/IGNITE-1035


Anyone from community picks it up?

--Yakov

2015-06-19 10:18 GMT+03:00 aosmakoff <[hidden email]>:
Hi there.
We are trying to use Ignite/GridGain as L2 cache for our hibernate
application(s) running in JBoss 6.x that configured with JTA transaction
manager. The program fails to update the cache with a Timeout error.
We narrowed it down to the code in GridCacheJtaManager::checkJta() line
containing:

if (!jtaTx.enlistResource(rsrc))

where the Tx updates the resource parameters including the timeout. The
problems seems to be that JTA treats the timeout value in seconds than
Ignite/GridGain uses mSec, effectively reducing the specified (in the
container) value by 1000 times. (In Ignite the class is CacheJtaManager)

Please see the error below (we used the default JTA timeout = 300sec)

/class org.gridgain.grid.cache.GridCacheTxTimeoutException: Cache
transaction timed out: GridLocalTx [fut=null, super=GridCacheTxLocalAdapter
[completedBase=null, partLock=false, sndTransformedVals=false,
super=GridCacheTxAdapter [xidVer=GridCacheVersion [topVer=46169865,
nodeOrderDrId=1, globalTime=1434692163247, order=1434689857213],
writeVer=null, implicit=false, implicitSingle=false, loc=true, threadId=362,
startTime=1434692163238, nodeId=38301945-ced9-4707-abfe-1ad1de827423,
startVer=GridCacheVersion [topVer=46169865, nodeOrderDrId=1,
globalTime=1434692163247, order=1434689857213], endVer=null,
isolation=READ_COMMITTED, concurrency=PESSIMISTIC,* timeout=300*,
sysInvalidate=false, commitVer=null, finalizing=NONE, preparing=false,
state=MARKED_ROLLBACK, timedOut=true, topVer=-1, duration=564ms,
grpLock=false, onePhaseCommit=false], size=3]]
/

Is this a know issue and is there any workaround.

Many thanks,

Regards,

Alex



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-as-L2-cache-in-JBoss6-tp538.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

yakov yakov
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

Alex, I have fixed this. You will be able to download the build on Mon-Tue. Thanks for the catch!

--Yakov

2015-06-19 11:07 GMT+03:00 Yakov Zhdanov <[hidden email]>:
Alex, I have filed the ticket - https://issues.apache.org/jira/browse/IGNITE-1035


Anyone from community picks it up?

--Yakov

2015-06-19 10:18 GMT+03:00 aosmakoff <[hidden email]>:
Hi there.
We are trying to use Ignite/GridGain as L2 cache for our hibernate
application(s) running in JBoss 6.x that configured with JTA transaction
manager. The program fails to update the cache with a Timeout error.
We narrowed it down to the code in GridCacheJtaManager::checkJta() line
containing:

if (!jtaTx.enlistResource(rsrc))

where the Tx updates the resource parameters including the timeout. The
problems seems to be that JTA treats the timeout value in seconds than
Ignite/GridGain uses mSec, effectively reducing the specified (in the
container) value by 1000 times. (In Ignite the class is CacheJtaManager)

Please see the error below (we used the default JTA timeout = 300sec)

/class org.gridgain.grid.cache.GridCacheTxTimeoutException: Cache
transaction timed out: GridLocalTx [fut=null, super=GridCacheTxLocalAdapter
[completedBase=null, partLock=false, sndTransformedVals=false,
super=GridCacheTxAdapter [xidVer=GridCacheVersion [topVer=46169865,
nodeOrderDrId=1, globalTime=1434692163247, order=1434689857213],
writeVer=null, implicit=false, implicitSingle=false, loc=true, threadId=362,
startTime=1434692163238, nodeId=38301945-ced9-4707-abfe-1ad1de827423,
startVer=GridCacheVersion [topVer=46169865, nodeOrderDrId=1,
globalTime=1434692163247, order=1434689857213], endVer=null,
isolation=READ_COMMITTED, concurrency=PESSIMISTIC,* timeout=300*,
sysInvalidate=false, commitVer=null, finalizing=NONE, preparing=false,
state=MARKED_ROLLBACK, timedOut=true, topVer=-1, duration=564ms,
grpLock=false, onePhaseCommit=false], size=3]]
/

Is this a know issue and is there any workaround.

Many thanks,

Regards,

Alex



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-as-L2-cache-in-JBoss6-tp538.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


aosmakoff aosmakoff
Reply | Threaded
Open this post in threaded view
|

RE: Ignite as L2 cache in JBoss6

Hi Yakov, That was  quick J

Thanks we will check it out.

Cheers,

Alex

 

From: yakov [via Apache Ignite Users] [mailto:ml-node+[hidden email]]
Sent: Saturday, 20 June 2015 4:37 AM
To: Alex Osmakoff
Subject: Re: Ignite as L2 cache in JBoss6

 

Alex, I have fixed this. You will be able to download the build on Mon-Tue. Thanks for the catch!


--Yakov

 

2015-06-19 11:07 GMT+03:00 Yakov Zhdanov <[hidden email]>:

Alex, I have filed the ticket - https://issues.apache.org/jira/browse/IGNITE-1035

 

 

Anyone from community picks it up?


--Yakov

 

2015-06-19 10:18 GMT+03:00 aosmakoff <[hidden email]>:

Hi there.
We are trying to use Ignite/GridGain as L2 cache for our hibernate
application(s) running in JBoss 6.x that configured with JTA transaction
manager. The program fails to update the cache with a Timeout error.
We narrowed it down to the code in GridCacheJtaManager::checkJta() line
containing:

if (!jtaTx.enlistResource(rsrc))

where the Tx updates the resource parameters including the timeout. The
problems seems to be that JTA treats the timeout value in seconds than
Ignite/GridGain uses mSec, effectively reducing the specified (in the
container) value by 1000 times. (In Ignite the class is CacheJtaManager)

Please see the error below (we used the default JTA timeout = 300sec)

/class org.gridgain.grid.cache.GridCacheTxTimeoutException: Cache
transaction timed out: GridLocalTx [fut=null, super=GridCacheTxLocalAdapter
[completedBase=null, partLock=false, sndTransformedVals=false,
super=GridCacheTxAdapter [xidVer=GridCacheVersion [topVer=46169865,
nodeOrderDrId=1, globalTime=1434692163247, order=1434689857213],
writeVer=null, implicit=false, implicitSingle=false, loc=true, threadId=362,
startTime=1434692163238, nodeId=38301945-ced9-4707-abfe-1ad1de827423,
startVer=GridCacheVersion [topVer=46169865, nodeOrderDrId=1,
globalTime=1434692163247, order=1434689857213], endVer=null,
isolation=READ_COMMITTED, concurrency=PESSIMISTIC,* timeout=300*,
sysInvalidate=false, commitVer=null, finalizing=NONE, preparing=false,
state=MARKED_ROLLBACK, timedOut=true, topVer=-1, duration=564ms,
grpLock=false, onePhaseCommit=false], size=3]]
/

Is this a know issue and is there any workaround.

Many thanks,

Regards,

Alex



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-as-L2-cache-in-JBoss6-tp538.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

 

 

 


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

http://apache-ignite-users.70518.x6.nabble.com/Ignite-as-L2-cache-in-JBoss6-tp538p546.html

To unsubscribe from Ignite as L2 cache in JBoss6, click here.
NAML


This email, including any attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute or use the information in this email in any way. If you received this email in error, please notify the sender immediately by return email and delete the message. Unless expressly stated otherwise, the information in this email should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product or service, an official confirmation of any transaction, or as an official statement of the entity sending this message. Neither Macquarie Group Limited, nor any of its subsidiaries, guarantee the integrity of any emails or attached files and are not responsible for any changes made to them by any other person.
shibaevv shibaevv
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by yakov
Tested fix 1.1.4 from http://www.gridgainsystems.com/nexus/content/repositories/external
More fixes required.

As usual start from top.
// Here we start in jtaTx.enlistResource:
org.apache.ignite.internal.processors.cache.jta.CacheJtaManager::checkJta() throws IgniteCheckedException {
..
    if (!jtaTx.enlistResource(rsrc))
        throw new IgniteCheckedException("Failed to enlist XA resource to JTA user transaction.");

// M2_REPO/org/jboss/jbossts/jbossjta/4.16.6.Final/jbossjta-4.16.6.Final-sources.jar
// continue to JBoss implementation:
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple::enlistResource(XAResource xaRes, Object[] params) {
..
    xaRes.setTransactionTimeout(timeout);

// step back to Ignite setter code FIXED (*1000):
org.apache.ignite.internal.processors.cache.jta.GridCacheXAResource::setTransactionTimeout(int i) {
        cacheTx.timeout(i * 1000);
        ..

// and get Ignite code error as txn already started:
org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter::timeout(long timeout) {
        if (isStarted())
            throw new IllegalStateException("Cannot change timeout after transaction has started: " + this);
..

org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter::isStarted() {
    return txMap != null;
}

// Ignite error will be hidden by JBoss implementation:
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple::enlistResource(XAResource xaRes, Object[] params) {
..
        }
        catch (Exception e)
        {
                e.printStackTrace();

                /*
                 * Some exceptional condition arose and we probably could not enlist
                 * the resouce. So, for safety mark the transaction as rollback
                 * only.
                 */

                markRollbackOnly();

                return false;
        }
}

// hidden Ignite error
java.lang.IllegalStateException: Cannot change timeout after transaction has started: GridNearTxLocal [nearLocallyMapped=false, colocatedLocallyMapped=false, hasRemoteLocks=false, mappings=[], super=GridDhtTxLocalAdapter [dhtThreadId=300, needsCompletedVers=false, nearNodes=[], dhtNodes=[], explicitLock=false, super=IgniteTxLocalAdapter [txMap={IgniteTxKey [key=KeyCacheObjectImpl [..], val=null, startVer=1435120562349, ver=GridCacheVersion [topVer=46600564, nodeOrderDrId=1, globalTime=1435120723215, order=1435120562349], hash=1310396480, extras=GridCacheMvccEntryExtras [mvcc=GridCacheMvcc [locs=[GridCacheMvccCandidate [nodeId=1f14b4a2-73a8-4284-a8f3-1148de9a0471, ver=GridCacheVersion [topVer=46600564, nodeOrderDrId=1, globalTime=1435120611411, order=1435120562324], timeout=188198, ts=1435120723219, threadId=300, id=1, topVer=AffinityTopologyVersion [topVer=-1, minorTopVer=0], reentry=null, otherNodeId=null, otherVer=null, mappedDhtNodes=null, mappedNearNodes=null, ownerVer=null, key=KeyCacheObjectImpl [..], masks=local=1|owner=1|ready=1|reentry=0|used=0|tx=1|single_implicit=0|dht_local=0|near_local=0|removed=0, prevVer=null, nextVer=null]], rmts=null]], flags=0], prepared=false, locked=false, nodeId=null, locMapped=false, expiryPlc=null, transferExpiryPlc=false, flags=0, xidVer=GridCacheVersion [topVer=46600564, nodeOrderDrId=1, globalTime=1435120611411, order=1435120562324]]}, completedBase=null, sndTransformedVals=false, super=IgniteTxAdapter [xidVer=GridCacheVersion [topVer=46600564, nodeOrderDrId=1, globalTime=1435120611411, order=1435120562324], writeVer=null, implicit=false, implicitSingle=false, loc=true, threadId=300, startTime=1435120611407, nodeId=1f14b4a2-73a8-4284-a8f3-1148de9a0471, startVer=GridCacheVersion [topVer=46600564, nodeOrderDrId=1, globalTime=1435120611411, order=1435120562324], endVer=null, isolation=REPEATABLE_READ, concurrency=PESSIMISTIC, timeout=300000, sysInvalidate=false, sys=false, plc=SYSTEM_POOL, commitVer=null, finalizing=NONE, preparing=false, state=ACTIVE, timedOut=false, duration=224163ms, onePhaseCommit=false], size=1]]]

// re-thrown Ignite error due to failed condition above [if (!jtaTx.enlistResource(rsrc))]
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to enlist XA resource to JTA user transaction.
        at org.apache.ignite.internal.processors.cache.jta.CacheJtaManager.checkJta(CacheJtaManager.java:95) [ignite-jta-1.1.4.jar:1.1.4]
        at org.apache.ignite.internal.processors.cache.GridCacheAdapter.checkJta(GridCacheAdapter.java:3285) [ignite-core-1.1.4.jar:1.1.4]
        at org.apache.ignite.internal.processors.cache.GridCacheAdapter.syncOp(GridCacheAdapter.java:3924) [ignite-core-1.1.4.jar:1.1.4]
        at org.apache.ignite.internal.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:2019) [ignite-core-1.1.4.jar:1.1.4]
        at org.apache.ignite.internal.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:1994) [ignite-core-1.1.4.jar:1.1.4]
        at org.apache.ignite.internal.processors.cache.GridCacheProxyImpl.put(GridCacheProxyImpl.java:470) [ignite-core-1.1.4.jar:1.1.4]
        at org.apache.ignite.cache.hibernate.HibernateTransactionalAccessStrategy.putFromLoad(HibernateTransactionalAccessStrategy.java:79) [ignite-hibernate-1.1.4.jar:1.1.4]
        ... 78 more
sevdokimov sevdokimov
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

shibaevv, I've fixed this problem. Fix will be available in the next release on Friday or early next week.
shibaevv shibaevv
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

.. still waiting for next build 1.1.5 with JTA fix..
yakov yakov
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

We are in the end of QA cycle and will make community edition available in a day which should contain JTA fix.

You can also give a try to RC available here: https://dist.apache.org/repos/dist/dev/incubator/ignite/1.3.0-rc2/

--Yakov

2015-07-15 6:47 GMT+03:00 shibaevv <[hidden email]>:
.. still waiting for next build 1.1.5 with JTA fix..



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-as-L2-cache-in-JBoss6-tp538p652.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

shibaevv shibaevv
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

This fix with JTA is working if I keep ignite config outside of my war file (e.g. $JBOSS_HOME/config).
But if I want to keep it inside my war file ignite 1.3.1 failing as it does not consider jboss vfs:/ as valid schema (looking for file:/)

uri = vfs:/C:/Users/vchibaev/Documents/dev/jboss/jboss-as-7.2.0.Final/bin/content/gmer-ear.ear/mro.war/WEB-INF/lib/ignite-core-1.3.1.jar

org.apache.ignite.internal.util.IgniteUtils::resolveProjectHome() {
..
        return findProjectHome(new File(uri));
}

File ctor:
        if ((scheme == null) || !scheme.equalsIgnoreCase("file"))
            throw new IllegalArgumentException("URI scheme is not \"file\"")
yakov yakov
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

Cross-posting to dev. Sergey E., can you take a look and finish with this?

Valery, thanks for pointing out.

--Yakov

2015-07-17 9:24 GMT+03:00 shibaevv <[hidden email]>:
This fix with JTA is working if I keep ignite config outside of my war file
(e.g. $JBOSS_HOME/config).
But if I want to keep it inside my war file ignite 1.3.1 failing as it does
not consider jboss vfs:/ as valid schema (looking for file:/)

uri =
vfs:/C:/Users/vchibaev/Documents/dev/jboss/jboss-as-7.2.0.Final/bin/content/gmer-ear.ear/mro.war/WEB-INF/lib/ignite-core-1.3.1.jar

org.apache.ignite.internal.util.IgniteUtils::resolveProjectHome() {
..
        return findProjectHome(new File(uri));
}

File ctor:
        if ((scheme == null) || !scheme.equalsIgnoreCase("file"))
            throw new IllegalArgumentException("URI scheme is not \"file\"")



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-as-L2-cache-in-JBoss6-tp538p664.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

shibaevv shibaevv
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

In reply to this post by sevdokimov
Hey, just follow up from Yakov cross-post from 17-July to you..
When do you think I can expect this "vfs:" protocol handling in your catch block (for jboss 6 deployment)?
Thanks
Valera
yakov yakov
Reply | Threaded
Open this post in threaded view
|

Re: Ignite as L2 cache in JBoss6

This will be available with the next release that is expected at the end of this week.