• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • ehcache-core
  • hsingh
  • Reporter: lorban
  • April 01, 2010
  • 0
  • Watchers: 0
  • January 17, 2013
  • April 06, 2010

Description

In the h2lcperf test when BTM runs background recovery these warnings are sometimes reported:

2010-03-31 02:57:57,680 WARN [Recoverer] - <error running recovery on resource ‘[email protected]ager’, resource marked as failed (background recoverer will retry recovery)> java.lang.NullPointerException at org.terracotta.modules.ehcache.xa.XidClustered.(XidClustered.java:17) at org.terracotta.modules.ehcache.xa.EhcacheXAStoreClusteredImpl.getPreparedContext(EhcacheXAStoreClusteredImpl.java:104) at net.sf.ehcache.transaction.xa.EhcacheXAResourceImpl.markContextForRollback(EhcacheXAResourceImpl.java:568) at net.sf.ehcache.transaction.xa.EhcacheXAResourceImpl.recover(EhcacheXAResourceImpl.java:283) at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:74) at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:39) at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:205) at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174) at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113) at java.lang.Thread.run(Thread.java:619) 2010-03-31 02:57:57,703 INFO [Recoverer] - <recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 9 resource(s) [[email protected]anager, [email protected]ic.cacheManager, [email protected]er, [email protected], [email protected], [email protected]tClinic.cacheManager, [email protected]er, [email protected]ic.cacheManager, mysql] (restricted to serverId 'h2lcperf')>

2010-03-31 02:15:48,867 WARN [Recoverer] - <error running recovery on resource ‘[email protected]er’, resource marked as failed (background recoverer will retry recovery)> java.lang.IllegalStateException: Context was marked as commited already! at org.terracotta.modules.ehcache.xa.PreparedContextClusteredImpl.__tc_wrapped_setRolledBack(PreparedContextClusteredImpl.java:59) at org.terracotta.modules.ehcache.xa.PreparedContextClusteredImpl.setRolledBack(PreparedContextClusteredImpl.java) at net.sf.ehcache.transaction.xa.EhcacheXAResourceImpl.markContextForRollback(EhcacheXAResourceImpl.java:585) at net.sf.ehcache.transaction.xa.EhcacheXAResourceImpl.recover(EhcacheXAResourceImpl.java:283) at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:74) at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:39) at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:205) at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174) at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113) at java.lang.Thread.run(Thread.java:619) 2010-03-31 02:15:48,870 INFO [Recoverer] - <recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 9 resource(s) [[email protected]anager, [email protected]ager, [email protected]ic.cacheManager, [email protected]er, [email protected], [email protected], [email protected]tClinic.cacheManager, [email protected]ic.cacheManager, mysql] (restricted to serverId ‘h2lcperf’)>

This is because in EhcacheXAResourceImpl.recover() there is this snippet of code:

  for (Xid preparedXid : xids) {
      markContextForRollback(preparedXid);
  }

XAResource.recover() isn’t supposed to do anything with in-doubt transactions but merely report them. It’s up to the TM to act on them.

Comments

Ludovic Orban 2010-04-01

Fixed in trunk.

Ludovic Orban 2010-04-06

This method call was there for a good reason, it was just poorly named

Ludovic Orban 2010-04-06

re-enabled method call in recover() + fixed related race conditions

Himadri Singh 2010-04-28

Verified by running h2lcperf test in Ehcache Core version 2.1.0-SNAPSHOT was built on 2010-04-27 11:37:49, at revision 2348, with jdk 1.6.0_15