ObjectDB ObjectDB

Replicated cluster recovery

#1

If I create a replicated database cluster as per http://www.objectdb.com/java/jpa/tool/replication what is the behaviour of the master database after a failure?

For example, say I have MasterDB and SlaveDB in the cluster. If MasterDB goes offline the application will automatically switch to SlaveDB. When MasterDB comes back online it will have missed any activity that occured during the downtime.

What is the best way to resolve this? Copying SlaveDB would be an option put presumably this would be a manual task and the application would need to be halted during the copy otherwise further updates would be missed.

Ideally the SlaveDB would become the new master when MasterDB goes offline and then MasterDB would become a slave when it comes back online. Or something similar...

Let me know if that doesnt make sense and I'll explain better. Also let me know if I've misunderstood anything and this functionality (or similar) is currently available.

Thanks!

edit
delete
#2

Currently the slave servers are limited to read only (it is indicated at the beginning of the page but probably has to be emphasised).

Your idea of switching the master and slave is good but has some difficulties. For example, in case the master fails before it completes transferring all the committed updates to the slave.

There are solutions that enable full cluster even with the ability to write and read to any node (and maybe such a solution will be included in a future version of ObjectDB) - but they are much slower than a simple master-slave replication.

ObjectDB Support
edit
delete
#3

hi

Is it means that when master goes down application can only reads data? And the second question: on which level switching between  nodes is done, persistent managers could switch to another node or they are bound to one node and after connection problem application must create new PM via PMF?

 

br

Tomasz

edit
delete
#4

> Is it means that when master goes down application can only reads data?

Yes.

> On which level switching between  nodes is done, persistent managers could switch to another node or they are bound to one node and after connection problem application must create new PM via PMF?

Switching is automatic - between a main url and backup urls, which may also reference databases on different nodes.

ObjectDB Support
edit
delete
#5

Hi

I wanted test cluster so I ran 4 threads 2 for writing and two 2 reading data but all hangs up on geting PersistenceManager from the PMF, without cluter it works fine. I had similar situation in JPA API but it was corrected: http://www.objectdb.com/database/support/151

 

hare is the connection url:

javax.jdo.option.ConnectionURL=objectdb://localhost:6000/test.odb;user=admin;password=admin|objectdb://localhost:6001/localhost:6000/test.odb;user=admin;password=admin

 

and thread stack dump:

SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: not available [native method]
SocketInputStream.read(byte[], int, int) line: 129
BufferedInputStream.fill() line: 218
BufferedInputStream.read1(byte[], int, int) line: 258
BufferedInputStream.read(byte[], int, int) line: 317
CST(NTS).z(int, int) line: 314
CST(NTS).y() line: 274
CST(CLS).R() line: 327
CST(CLS).P() line: 274
CST.UA(int) line: 283
TYM.ac(boolean, String, Object) line: 472
TYM.<init>(TSR, ClassLoader, SCM, PersistenceUnitInfo, String, ERR, boolean) line: 232
PMF(OMF).ai(String, String) line: 730
PMF(OMF).ah(String, String) line: 681
PMF.getPersistenceManager() line: 547
ObjectDbTests.testDbProvisioning() line: 290
ObjectDbTests.testAll(int, Properties) line: 46
ObjectDbTests$1.run() line: 117
Thread.run() line: 662

br

Tomasz

edit
delete
#6

Please produce and post stack traces of all the running threads.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.