|
Uploading patch derby-4246a, which factors out the stopSlave code for
both cases: a) the master server is running b) the master server is no longer running and replaced all occurences of stop slave with a new method, ReplicationRun.stopSlave (the old one of the same name, which was unused, I removed). Case b) was inlined in the fix for for ReplicationRun_Local_StateTest_part1_1 . The same fix applies here for ReplicationRun_Local_3_p5, so I decided to factor it out. I did the same thing for case a), sinc ethere were several instances of this code as well. Replication suite had no errors with the patch. This looks like a useful refactoring/cleanup. +1
While you're at it, I noticed this diff in the patch (not code added by you, just restructured): + } catch (SQLException se) { + int ec = se.getErrorCode(); + String ss = se.getSQLState(); + String msg = ec + " " + ss + " " + se.getMessage(); + util.DEBUG("4. Unexpectedly failed to connect: " + + connectionURL + " " + msg); + assertTrue("Unexpectedly failed to connect: " + + connectionURL + " " + msg, false); Couldn't this catch block be removed? That would simplify the code even more and also preserve the stack trace of the unexpected exception. Thank for looking at this, Knut.
Yes, that catch could go, but I chose to stay faithful to the way the rest of the code is written for now (this pattern is used throughout); it does give the additional info on the connectionURL, which one would otherwise need to infer from the code, but I agree simplifying would be better. Committed on trunk as svn 785131, resolving.
Not seen since commit, so closing.
Re-opening to backport to 10.5 branch.
Backported to 10.5 as svn 799099, closing.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DERBY-4175. In that case also,after killing the master, it takes a while for the slave to react and
close down. XRE42 is actually not the expected end state here, but the
test expects it. This will *mostly* work if the slave shutdown takes
some time, but not always, as seen in this issue. XRE42 is an
intermediate state before the slave shuts down.
What is seen in the stack trace for this issue is that the connect
attempt receives XRE11 (REPLICATION_DB_NOT_BOOTED), which is the end
state of the slave. The fix is to make the test anticipate the
intermediate states, as in the patch for
DERBY-4175.