db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benrahman <mdzar...@gmail.com>
Subject Replication Master stop, but Slave still alive
Date Tue, 11 Jun 2013 08:50:23 GMT
Hi All,

I have setup replication following the steps as shown in  here
<http://wiki.apache.org/db-derby/ReplicationWriteup>  
(http://wiki.apache.org/db-derby/ReplicationWriteup).

After start the replication, I checked derby.log on both side. It shows that
replication has successfully started.

/Master derby.log/

Wed Jun 05 10:17:10 SGT 2013 : Apache Derby Network Server - 10.8.2.2 -
(1181258) started and ready to accept connections on port 1527
----------------------------------------------------------------
Wed Jun 05 10:18:15 SGT 2013:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.8.2.2 - (1181258): instance a816c00e-013f-121f-a03d-ffff87382be3 
on database directory E:\Derby\databases\house  with class loader
sun.misc.Launcher$AppClassLoader@11b86e7 
Loaded from file:/E:/Derby/javadb/lib/derby.jar
java.vendor=Sun Microsystems Inc.
java.runtime.version=1.6.0_25-b06
user.dir=E:\user\Derby\Replication Testing Kit
derby.system.home=E:\Derby\databases
Database Class Loader started - derby.database.classpath=''
*Replication master role started for database 'house'.*

/Slave derby.log/

Wed Jun 05 10:17:12 SGT 2013 : Apache Derby Network Server - 10.8.2.2 -
(1181258) started and ready to accept connections on port 1528
----------------------------------------------------------------
Wed Jun 05 10:18:03 SGT 2013:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.8.2.2 - (1181258): instance a816c00e-013f-133d-bfb3-00007314807e 
on database directory E:\Derby\databases\Slave\house  with class loader
sun.misc.Launcher$AppClassLoader@11b86e7 
Loaded from file:/E:/Derby/javadb/lib/derby.jar
java.vendor=Sun Microsystems Inc.
java.runtime.version=1.6.0_25-b06
user.dir=E:\user\Derby\Replication Testing Kit
derby.system.home=E:\Derby\databases\Slave
Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
Wed Jun 05 10:18:04 SGT 2013:
Shutting down instance a816c00e-013f-133d-bfb3-00007314807e on database
directory E:\Derby\databases\Slave\house with class loader
sun.misc.Launcher$AppClassLoader@11b86e7 
----------------------------------------------------------------
Wed Jun 05 10:18:04 SGT 2013:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.8.2.2 - (1181258): instance 601a400f-013f-133d-bfb3-00007314807e 
on database directory E:\Derby\databases\Slave\house  with class loader
sun.misc.Launcher$AppClassLoader@11b86e7 
Loaded from file:/E:/Derby/javadb/lib/derby.jar
java.vendor=Sun Microsystems Inc.
java.runtime.version=1.6.0_25-b06
user.dir=E:\user\Derby\Replication Testing Kit
derby.system.home=E:\Derby\databases\Slave
Replication slave database 'house' listens for connections from master on
'localhost:8001'.
Replication slave role started for database 'house'.
Wed Jun 05 10:18:16 SGT 2013 Thread[DRDAConnThread_3,5,main] Cleanup action
starting
ERROR XRE08: Replication slave mode started successfully for database
'house'. Connection refused because the database is in replication slave
mode. 
	at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
	at org.apache.derby.impl.drda.Database.makeConnection(Unknown Source)
	at
org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
	at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
Cleanup action completed
Wed Jun 05 10:18:16 SGT 2013 Thread[DRDAConnThread_3,5,main] Cleanup action
starting
ERROR XRE08: Replication slave mode started successfully for database
'house'. Connection refused because the database is in replication slave
mode. 
	at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
	at org.apache.derby.impl.drda.Database.makeConnection(Unknown Source)
	at
org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
	at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
Cleanup action completed
Wed Jun 05 10:18:16 SGT 2013 Thread[DRDAConnThread_3,5,main] (DATABASE =
house), (DRDAID = {1}), *Replication slave mode started successfully for
database 'house'. Connection refused because the database is in replication
slave mode. *

Then after a while, I noticed that master already down and try to reconnect
to slave.

/Master derby.log/

----  BEGIN REPLICATION ERROR MESSAGE (6/5/13 3:35 PM) ----
Exception occurred during log shipping.
java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	at
java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847)
	at
java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1756)
	at java.io.ObjectOutputStream.reset(ObjectOutputStream.java:483)
	at
org.apache.derby.impl.store.replication.net.SocketConnection.writeMessage(Unknown
Source)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit.sendMessage(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.shipALogChunk(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.run(Unknown
Source)

--------------------  END REPLICATION ERROR MESSAGE ---------------------
*Replication master trying to reconnect to slave for database 'house'.*

I checked in Slave derby.log, it still show the slave mode message.
Replication Master eventually down few hours later.

/Master derby.log/

----  BEGIN REPLICATION ERROR MESSAGE (6/6/13 5:46 PM) ----
Exception occurred during log shipping.
org.apache.derby.impl.store.replication.buffer.LogBufferFullException
	at
org.apache.derby.impl.store.replication.buffer.ReplicationLogBuffer.switchDirtyBuffer(Unknown
Source)
	at
org.apache.derby.impl.store.replication.buffer.ReplicationLogBuffer.appendLog(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.appendLog(Unknown
Source)
	at org.apache.derby.impl.store.raw.log.LogAccessFile.writeToLog(Unknown
Source)
	at
org.apache.derby.impl.store.raw.log.LogAccessFile.flushDirtyBuffers(Unknown
Source)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.FileLogger.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.prepareCommit(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.xa_prepare(Unknown Source)
	at org.apache.derby.impl.store.access.RAMTransaction.xa_prepare(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.xa_prepare(Unknown Source)
	at org.apache.derby.jdbc.XATransactionState.xa_prepare(Unknown Source)
	at org.apache.derby.jdbc.EmbedXAResource.prepare(Unknown Source)
	at org.apache.derby.impl.drda.DRDAXAProtocol.prepareXATransaction(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAXAProtocol.parseSYNCCTL(Unknown Source)
	at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)

--------------------  END REPLICATION ERROR MESSAGE ---------------------
----  BEGIN REPLICATION ERROR MESSAGE (6/6/13 5:46 PM) ----
Exception occurred during log shipping.
java.net.SocketException: Software caused connection abort: socket write
error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	at
java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847)
	at
java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1756)
	at java.io.ObjectOutputStream.reset(ObjectOutputStream.java:483)
	at
org.apache.derby.impl.store.replication.net.SocketConnection.writeMessage(Unknown
Source)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit.sendMessage(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.shipALogChunk(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.flushBuffer(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.stopMaster(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.printStackAndStopMaster(Unknown
Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.appendLog(Unknown
Source)
	at org.apache.derby.impl.store.raw.log.LogAccessFile.writeToLog(Unknown
Source)
	at
org.apache.derby.impl.store.raw.log.LogAccessFile.flushDirtyBuffers(Unknown
Source)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.FileLogger.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.prepareCommit(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.xa_prepare(Unknown Source)
	at org.apache.derby.impl.store.access.RAMTransaction.xa_prepare(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.xa_prepare(Unknown Source)
	at org.apache.derby.jdbc.XATransactionState.xa_prepare(Unknown Source)
	at org.apache.derby.jdbc.EmbedXAResource.prepare(Unknown Source)
	at org.apache.derby.impl.drda.DRDAXAProtocol.prepareXATransaction(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAXAProtocol.parseSYNCCTL(Unknown Source)
	at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
	at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)

--------------------  END REPLICATION ERROR MESSAGE ---------------------
*Replication master role stopped for database 'house'.*

I try to connect to slave database, but the database is still in slave mode.
I need to do StopSlave in order to access the database. 

Anyone encounter this situation before? What has caused the master to go
down?

Will appreciate any explanations from you guys. Thanks!



--
View this message in context: http://apache-database.10148.n7.nabble.com/Replication-Master-stop-but-Slave-still-alive-tp131072.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Mime
View raw message