Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Takes of the same POJO from two different applications

We are using the the 6.5 GA version of GS. We have a simple two-host, replicated, clustered, 2 space deployment.

I have narrowed this down to a simple test application which I can send. I have two applications that simply sit in a loop and take on a simple object, send a response and go back to the loop and take again. I have a sender application which sends one object and waits for the response.

Space Objects: PingRequest and PingResponse Applications: PingReceiver (2, one on each of the cluster hosts), PingTest (located on a separate host)

When the PingReceiver apps first start I can see that they each have their takes on the space using equivalent templates, an empty PingRequest object. As I execute the PingTest app I see one or the other PingReceiver get the object from the space and put the PingResponse on the space which the PingTest receives and exits.

The Issue

When I stop one of the PingRecievers and the restart it and then rerun the test I see that both PingRecievers will receive the same object from the space. Sometimes it may take the restart of the other PingReceiver before it happens but I can always get this to happen.

If the applications are both shutdown and restarted right away, the problem may go away it seems to depend on how long the applications have been active and connected to the space. Because if I stop both and restart and the problem goes away, I can immediately stop and restart and the problem comes back. Same thing if I see the problem and stop both apps for some period of time and the restart the issue goes away. But it always comes back after a restart of one or both of the applications.

Please let me know if this is already a known issue, possible clustering configuration issue or if you would like me to upload the sample code and my cluster deployment xml file.

Mike h4. Attachments


{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2580]{quote}

asked 2008-09-08 13:46:02 -0600

mcnoche gravatar image

updated 2013-08-08 09:52:00 -0600

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Which cluster topology are you using? Is it sync-replicated (active-active - each client might pick different primary when connects) or Partition With backups (One primary)?
Are you trying to measure request-response latency? If so we have dedicated benchmark for such.


  1. RequestResponseLatencyBenchmark.zip

answered 2008-09-08 13:56:31 -0600

shay hassidim gravatar image
edit flag offensive delete link more


We are using the sync-replicated topology with the slightly modified template from $JSHOMEDIR/deploy/templates/datagrid/META-INF/spring/pu.xml.

http://www.springframework.org/schema... http://www.openspaces.org/schema/corehttp://www.openspaces.org/schema/core...http://www.openspaces.org/schema/eventshttp://www.openspaces.org/schema/even...http://www.openspaces.org/schema/remo...http://www.openspaces.org/schema/remo...http://www.openspaces.org/schema/slahttp://www.openspaces.org/schema/sla/...>

    The SLA bean used when deploying this processing unit to the Service Grid.

    The SLA uses a synchronous replicated schema with 2 instances. 

    The SLA bean also mandates that a neither instance will run under the same
    GSC by setting the maxInstancesPerVM to 1. This ensures that if one host or GSC goes down
    this PU will reploy to that GSC when it comes back online.

<os-sla:sla cluster-schema="sync_replicated" number-of-instances="2" max-instances-per-vm="1" max-instances-per-machine="1"/>

    Spring property configurer which allows us to use system properties (such as user.name).

    DEFAULT space name will be production unless overriden.
<bean id="propertiesConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="properties">
            <prop key="dataGridName">production</prop>
            <prop key="security.encrypted">false</prop>
            <prop key="scripting.asyncConcurrentConsumers">5</prop>

    A bean representing a space (an IJSpace implementation).

    No need to register for space mode notifications since no other beans are exists within this
    context. Allows to use secured Space without setting username and password.
<os-core:space id="space" url="/./${dataGridName}">
    <os-core:filter-provider ref="serviceExporter"/>
    <os-core:security username="${security.username}" password="${security.password}" encrypted="${security.encrypted}" />

<!-- A GigaSpace instance (that can be used within scripts) that works only against this cluster member -->
<os-core:giga-space id="gigaSpace" space="space" clustered="false" />

<!-- A GigaSpace instance (that can be used within scripts) that works only against the whole cluster -->
<os-core:giga-space id="clusteredGigaSpace" space="space" clustered="true" />

<!-- The scripting executor remoting support -->
<bean id="scriptingExecutorImpl" class="org.openspaces.remoting.scripting.DefaultScriptingExecutor" />

<os-remoting:service-exporter id="serviceExporter" template-lookup-name="org.openspaces.remoting.scripting.ScriptingExecutor">
    <os-remoting:service ref="scriptingExecutorImpl"/>

<os-events:polling-container id="remotingContainer" giga-space="gigaSpace" concurrent-consumers="${scripting.asyncConcurrentConsumers}">
    <os-events:listener ref="serviceExporter"/>

</beans> h4. Attachments


mcnoche gravatar image mcnoche  ( 2008-09-08 14:56:54 -0600 )edit

If you need to construct a cluster with one primary and one backup you should use the following instead the one you got right now:

<os-sla:sla cluster-schema="partitioned-sync2backup" number-of-instances="1" number-of-backups="1" max-instances-per-vm="1" max-instances-per-machine="1"/>

This will make sure you will not have 2 active primaries that might cause the problems you are having.

See attached Request Response Latency Benchmark. To install : Extract into \gigaspaces-xap-6.5.1-ga\examples\advanced\data-grid Follow the instructions at \gigaspaces-xap-6.5.1-ga\examples\advanced\data-grid\RequestResponseLatencyBenchmark\readme.txt

Shay h4. Attachments


shay hassidim gravatar image shay hassidim  ( 2008-09-08 16:41:52 -0600 )edit

Thanks Shay...

This particular cluster will not work for our situation as we do not have the @SpaceRouting defined for all of our space objects. We are going to move to a partitioned space but for now we are stuck with our current primary/replicated scheme. Do you have another suggested cluster configuration which does not use the partitioned routing?


mcnoche gravatar image mcnoche  ( 2008-09-09 10:25:23 -0600 )edit


With one primary and one backup you do not need the @SpaceRouting defined.


shay hassidim gravatar image shay hassidim  ( 2008-09-09 10:28:45 -0600 )edit


This is the exception I received when I setup the cluster config using the partitioned-sync2backup and ran my application...I was executing a IJSpace.clear() method.

com.gigaspaces.cluster.loadbalance.exception.LoadBalanceException: Broadcast is not supported for operations with local transaction. Operation description: class='com.fm.space.entries.ComponentConfigEntry', operation=clear, transaction=local Operation requires broadcast to all partitions based on: configuration: <broadcast-condition>routing-index-is-null</broadcast-condition> and operation data: <routing index="" field="" is="" not="" defined="" in="" class="" 'com.fm.space.entries.componentconfigentry="" '="" ><="" p="">

    at com.gigaspaces.cluster.loadbalance.LoadBalanceImpl.getPOJOHashValue(SourceFile:2572)
    at com.gigaspaces.cluster.loadbalance.LoadBalanceImpl.selectMemberHashBased_pos(SourceFile:1367)
    at com.gigaspaces.cluster.loadbalance.LoadBalanceImpl.selectMemberHashBased(SourceFile:1286)
    at com.gigaspaces.cluster.loadbalance.LoadBalanceImpl.getNextFromPolicy(SourceFile:974)
    at com.gigaspaces.cluster.loadbalance.LoadBalanceImpl.selectMemberForOperationMain(SourceFile:377)
    at com.gigaspaces.cluster.loadbalance.LoadBalanceImpl.selectMemberForOperation(SourceFile:209)
    at com.j_spaces.core.cluster.JSpaceClusteredProxy.selectMember(SourceFile:1338)
    at com.j_spaces.core.cluster.JSpaceClusteredProxy.getLBRemoteJSpace(SourceFile:1240)
    at com.j_spaces.core.cluster.JSpaceClusteredProxy.prepareForMethodCall(SourceFile:962)
    at com.j_spaces.core.cluster.JSpaceClusteredProxy.clearBasic(SourceFile:2090)
    at com.j_spaces.core.cluster.action.ClusterSpaceClearActionListener.clear(SourceFile:66)
    at com.j_spaces.core.cluster.action.ClusterSpaceClearActionListener.onAction(SourceFile:32)
    at com.j_spaces.core.cluster.action.ClusterSpaceClearActionListener.onAction(SourceFile:19)
    at com.j_spaces.core.client.AbstractSpaceProxy.clear(SourceFile:779)
    at com.j_spaces.core.client.AbstractSpaceProxy.clear(SourceFile:769)
    at com.fm.space.Space.clear(Space.java:241)
    at com.fm.mr.server.ConfigLoaderTask.run(ConfigLoaderTask.java:90)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
mcnoche gravatar image mcnoche  ( 2008-09-09 10:50:57 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-09-08 13:46:02 -0600

Seen: 41 times

Last updated: Sep 08 '08