9 Replies Latest reply on Jan 21, 2010 10:05 AM by Galder Zamarreño

    SingletonStoreCacheLoader: unable to complete in memory state push to cache loader

    Nicolas Filotto Novice

      Hi all,

       

      We try to use the SingletonStoreCacheLoader with JBC 3.2.0 GA but we meet some issues when the cluster topology changes. The scenario to reproduce the problem is very simple, just launch 2 JVM with a JBC configured as below:

       

      {code:xml}
      <?xml version="1.0" encoding="UTF-8"?>
      <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns="urn:jboss:jbosscache-core:config:3.1">

           <!-- Configure the TransactionManager -->
           <transaction
                transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />


         <clustering mode="replication">
            
            <!-- JGroups protocol stack properties. -->
            <jgroupsConfig>
               <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
                    loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
                    mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
                    oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
                    oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
                    oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
                    thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
                    thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
                    tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
                    use_incoming_packet_handler="true"/>
               <PING num_initial_members="3" timeout="2000"/>
               <MERGE2 max_interval="30000" min_interval="10000"/>
               <FD_SOCK/>
               <FD max_tries="5" shun="true" timeout="10000"/>
               <VERIFY_SUSPECT timeout="1500"/>
               <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
                              use_mcast_xmit="false"/>
               <UNICAST timeout="300,600,1200,2400,3600"/>
               <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
               <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
                           view_bundling="true"/>
               <FRAG2 frag_size="60000"/>
               <pbcast.STREAMING_STATE_TRANSFER/>
               <pbcast.FLUSH timeout="0"/>

            </jgroupsConfig>

            <sync />

         </clustering>
        
           <loaders passivation="false" shared="false">

                <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false"
                     fetchPersistentState="false" ignoreModifications="false"
                     purgeOnStartup="false">
                     <properties>
                       cache.jdbc.table.name=jbosscache
                      cache.jdbc.table.create=true
                      cache.jdbc.table.drop=true
                      cache.jdbc.table.primarykey=jbosscache_pk
                      cache.jdbc.fqn.column=fqn
                      cache.jdbc.fqn.type=VARCHAR(255)
                      cache.jdbc.node.column=node
                      cache.jdbc.node.type=LONGVARBINARY
                      cache.jdbc.parent.column=parent
                      cache.jdbc.driver=org.hsqldb.jdbcDriver
                      cache.jdbc.url=jdbc:hsqldb:file:/tmp/test-jboss-cache/proxy
                      cache.jdbc.user=sa
                      cache.jdbc.password=
                  </properties>
                     <singletonStore enabled="true"
                                         class="org.jboss.cache.loader.SingletonStoreCacheLoader">
                          <properties>
                               pushStateWhenCoordinator=true
                               pushStateWhenCoordinatorTimeout=20000
                          </properties>
                     </singletonStore>          
                </loader>
                
           </loaders>
           
      </jbosscache>
      {code}

      Once the 2 JBC instances are started, kill the coordinator (the first JVM that you launched).
      You should get the following error:
      {code}
      17 déc. 2009 16:08:54 org.jboss.cache.RPCManagerImpl$MembershipListenerAdaptor viewAccepted
      INFO: Received new cluster view: [192.168.0.13:50662|2] [192.168.0.13:50662]
      17 déc. 2009 16:08:54 org.jboss.cache.loader.SingletonStoreCacheLoader$SingletonStoreListener viewChange
      GRAVE: exception reported changing nodes active status
      org.jboss.cache.loader.SingletonStoreCacheLoader$PushStateException: unable to complete in memory state push to cache loader
           at org.jboss.cache.loader.SingletonStoreCacheLoader.doPushState(SingletonStoreCacheLoader.java:315)
           at org.jboss.cache.loader.SingletonStoreCacheLoader.activeStatusChanged(SingletonStoreCacheLoader.java:208)
           at org.jboss.cache.loader.SingletonStoreCacheLoader$SingletonStoreListener.viewChange(SingletonStoreCacheLoader.java:560)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:592)
           at org.jboss.cache.notifications.NotifierImpl$ListenerInvocation$1.run(NotifierImpl.java:720)
           at org.jboss.cache.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:49)
           at org.jboss.cache.notifications.NotifierImpl$ListenerInvocation.invoke(NotifierImpl.java:739)
           at org.jboss.cache.notifications.NotifierImpl.notifyViewChange(NotifierImpl.java:569)
           at org.jboss.cache.RPCManagerImpl$MembershipListenerAdaptor.viewAccepted(RPCManagerImpl.java:1029)
           at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUpEvent(MessageDispatcher.java:733)
           at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:776)
           at org.jgroups.JChannel.up(JChannel.java:1338)
           at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:462)
           at org.jgroups.protocols.pbcast.FLUSH.up(FLUSH.java:435)
           at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.up(STREAMING_STATE_TRANSFER.java:319)
           at org.jgroups.protocols.FRAG2.up(FRAG2.java:188)
           at org.jgroups.protocols.pbcast.GMS.installView(GMS.java:544)
           at org.jgroups.protocols.pbcast.CoordGmsImpl.handleViewChange(CoordGmsImpl.java:464)
           at org.jgroups.protocols.pbcast.GMS.up(GMS.java:750)
           at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:233)
           at org.jgroups.protocols.UNICAST.up(UNICAST.java:299)
           at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:884)
           at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:716)
           at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:167)
           at org.jgroups.protocols.FD.up(FD.java:284)
           at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:309)
           at org.jgroups.protocols.MERGE2.up(MERGE2.java:144)
           at org.jgroups.protocols.Discovery.up(Discovery.java:264)
           at org.jgroups.protocols.PING.up(PING.java:273)
           at org.jgroups.protocols.TP.passMessageUp(TP.java:1285)
           at org.jgroups.protocols.TP.access$100(TP.java:49)
           at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1838)
           at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1817)
           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
           at java.lang.Thread.run(Thread.java:613)
      Caused by: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException: Not supported in UnversionedNode
           at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:215)
           at java.util.concurrent.FutureTask.get(FutureTask.java:85)
           at org.jboss.cache.loader.SingletonStoreCacheLoader.waitForTaskToFinish(SingletonStoreCacheLoader.java:338)
           at org.jboss.cache.loader.SingletonStoreCacheLoader.doPushState(SingletonStoreCacheLoader.java:311)
           ... 38 more
      Caused by: java.lang.UnsupportedOperationException: Not supported in UnversionedNode
           at org.jboss.cache.AbstractNode.getChildrenDirect(AbstractNode.java:270)
           at org.jboss.cache.invocation.NodeInvocationDelegate.getChildrenDirect(NodeInvocationDelegate.java:163)
           at org.jboss.cache.loader.SingletonStoreCacheLoader.pushState(SingletonStoreCacheLoader.java:256)
           at org.jboss.cache.loader.SingletonStoreCacheLoader$2.call(SingletonStoreCacheLoader.java:227)
           at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
           at java.util.concurrent.FutureTask.run(FutureTask.java:123)
           ... 3 more
      {code}

      Is it a bug or a misuse?

      Thank you for your answer,
      BR,
      Nicolas