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

Ask Your Question
0

Mirroring: loosing objects

Hi ! I'm having some trouble with the mirroring feature. What I want to do is insert the objects in a grid, have them persisted in the mirror and make them disappear from memory after that. So when I write those objects I'm using a lease of 1 millisecond. Of 60.000.000 records I get only 2.500.000 in the database. With less records usually 99% of the records gets in the database. Is this the correct way of using lease ? Does gigaspaces ensure me that even I use a 1 ms lease the objects will get mirrored anyway ? If this is not the problem ... which other thing can cause this behaviour ? Thanks !

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

asked 2009-05-04 16:27:05 -0500

pruggia gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Can you have 10 sec lease and test? I think that 1 millisecond is too small.

Shay

answered 2009-05-04 16:36:03 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Ok, so the lease will delete the object even if it's not mirrored.

Do you know any other way of deleting the objects from memory after mirrored ? I'm trying to be sure that my memory won't fill up of objects waiting to be mirrored. May be use LRU instead of all in memory. Will this still mirror all the objects or same thing will happen (objects sent to disk before mirrored will be lost).

Thanks !

pruggia gravatar imagepruggia ( 2009-05-04 16:43:18 -0500 )edit

I think the cluster-config.groups.group.repl-policy.repl-original-state should help here.

See below how you can set it:

<os-core:space id="space" url="/./space" schema="persistent" mirror="true" external-data-source="hibernateDataSource">
    <os-core:properties>
        <props>
                     ....
            <prop key="cluster-config.groups.group.repl-policy.repl-original-state">true</prop>
        </props>
    </os-core:properties>
</os-core:space>
<bean id="hibernateDataSource" class="org.openspaces.persistency.hibernate.StatelessHibernateExternalDataSource">
    <property name="sessionFactory" ref="sessionFactory"/>
</bean>

To speed up the Mirror activity you should consider using the StatelessHibernateExternalDataSource.
See more here:
http://www.gigaspaces.com/wiki/display/XAP66/AsyncPersistency-Mirror#AsyncPersistency-Mirror-OptimizingtheMirrorActivity

Shay

shay hassidim gravatar imageshay hassidim ( 2009-05-05 09:57:05 -0500 )edit

What if instead of using mirroring, we have a PU that performs a take and persist the entity in a local database. That way the objects are automatically removed from the grid as we want and we have "more control" over the way and time our objects are persisted. We can wrap of course the outputobjects into one big object, instead of having 60.000.000 of objects we are having 60.000 objects of 1.000 for example. Does it make sense to you ? Thanks !

pruggia gravatar imagepruggia ( 2009-05-05 09:59:13 -0500 )edit

Still having the same issue, even with original replication set on true.
What do you think about the change I proposed in the previous post:

> {quote:title=}{quote}
> What if instead of using mirroring, we have a PU that performs a take and persist the entity in a local database.
> That way the objects are automatically removed from the grid as we want and we have "more control" over the way and time our objects are persisted.
> We can wrap of course the outputobjects into one big object, instead of having 60.000.000 of objects we are having 60.000 objects of 1.000 for example.
> Does it make sense to you ?

Thanks !

pruggia gravatar imagepruggia ( 2009-05-05 10:33:04 -0500 )edit

It makes perfect sense. It will provide you better control on the persistency behavior. This means you will not use the Mirror Service but call the Hibernate API yourself to access the database (unless you want to call JDBC API directly). You can take batches of objects from the space and persist these. Packaging multiple objects into one database raw is also good idea. If there is a need this persistency PU could have multiple threads to boost the persistency activity. You could run this PU collocated or remote. Shay

shay hassidim gravatar imageshay hassidim ( 2009-05-05 12:34:24 -0500 )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

Stats

Asked: 2009-05-04 16:27:05 -0500

Seen: 44 times

Last updated: May 04 '09