db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Burlison <Alan.Burli...@sun.com>
Subject Re: Derby replication seems to be mostly useless
Date Tue, 07 Jul 2009 11:02:49 GMT
Knut Anders Hatlen wrote:

> I think it should work, at least it did when I tested it in what I think
> is a similar scenario. See the attached script which creates a database
> with authentication and authorization enabled, starts slave and master
> servers, and performs failover.
> 
> Are you running the network server in a separate process, or is it
> embedded inside another Java process? If the latter, it may be that the
> database has already been booted when the server is started.

The network server is a separate process, started from the command-line.

I *think* I've partially figured out what the problem is.  I'm running 
with two databases on the same machine, set up under two different Derby 
system directories, e.g.

Master in /tmp/auth, containing database 'opensolaris', data files in 
/tmp/auth/opensolaris

Slave in /tmp/auth1, containing database 'opensolaris' data files in 
/tmp/auth1/opensolaris

I'm connecting to the master and the slave to start the replication from 
inside the same JVM, and although I'm setting derby.system.home before 
the connect calls, the derby docs say that derby.system.home is static 
so the first setting before I open a connection wins, and that's to the 
master - and I think that's what is causing the issues with the slave. 
In your test script you are doing the startSlave from a separate JVM, 
which is I guess why you aren't seeing the same problem.

What is puzzling me is that I'm connecting to the slave using the 
network driver to databases running in a separate JVMs, so I would have 
expected the derby.system.home setting to be irrelevant, but it seems not.

To confirm that I've set up the slave on a separate machine, using the 
same derby.system.home as the master.  If I do that the startSlave works 
just fine, which points to the issue being related to having the master 
and slave on the same machine but with different derby.system.home 
settings.  As I said, I'm puzzled as to why derby.system.home should 
have any effect when I'm connecting with the network driver, but the 
evidence does seem to point in that direction.

However even if I run with the slave on a different machine and get past 
the startSlave step, the subsequent startMaster fails with a 
bizarre-looking error message full of control characters:

DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE04, SQLERRMC: 
opensolarisbleaklow4851XRE04.U.1 [XRE04]

So there's obviously something else amiis as well.

-- 
Alan Burlison
--

Mime
View raw message