You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by da...@apache.org on 2012/07/04 17:38:51 UTC
svn commit: r1357310 - in /db/derby/code/branches/10.9: ./
java/engine/org/apache/derby/impl/db/SlaveDatabase.java
Author: dag
Date: Wed Jul 4 15:38:51 2012
New Revision: 1357310
URL: http://svn.apache.org/viewvc?rev=1357310&view=rev
Log:
DERBY-4269 Failover did not succeed in 2 min.: testReplication_Local_3_p6_autocommit_OK
Backported from trunk as:
svn merge -c 1356766 https://svn.apache.org/repos/asf/db/derby/code/trunk
Patch fix-ignored-runtime-exceptions-b.
Modified:
db/derby/code/branches/10.9/ (props changed)
db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/db/SlaveDatabase.java
Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
Merged /db/derby/code/trunk:r1356766
Modified: db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/db/SlaveDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/db/SlaveDatabase.java?rev=1357310&r1=1357309&r2=1357310&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/db/SlaveDatabase.java (original)
+++ db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/db/SlaveDatabase.java Wed Jul 4 15:38:51 2012
@@ -37,6 +37,8 @@ import org.apache.derby.jdbc.InternalDri
import java.sql.SQLException;
import java.util.Properties;
+import org.apache.derby.iapi.reference.MessageId;
+import org.apache.derby.impl.store.replication.ReplicationLogger;
/**
* SlaveDatabase is an instance of Database, and is booted instead of
@@ -321,11 +323,22 @@ public class SlaveDatabase extends Basic
resetCurrentContextManager(bootThreadCm);
bootThreadCm = null;
}
- } catch (StandardException se) {
- // We get here when SlaveController#stopSlave has been
- // called, or if a fatal exception has been thrown.
- handleShutdown(se);
- }
+ } catch (Exception e) {
+ // We get here when SlaveController#stopSlave has been called,
+ // a fatal Derby exception has been thrown, or if a run-time
+ // error is thrown. Log the error unconditionally to make sure
+ // it can be observed, since if this happens during or after
+ // recovery on a failover, there will be no connection attempt
+ // failing with the error. New connection attempts will just
+ // hang...
+
+ ReplicationLogger rl = new ReplicationLogger(dbname);
+ rl.logError(MessageId.REPLICATION_FATAL_ERROR, e);
+
+ if (e instanceof StandardException) {
+ handleShutdown((StandardException)e);
+ }
+ }
}
}