[ 
https://issues.apache.org/jira/browse/DERBY-3489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574592#action_12574592
 ] 

Serge Tsv commented on DERBY-3489:
----------------------------------

It looks like there're only three methods which throw an exception with a 
corresponding ''Could not establish a connection ... " message:

  * SlaveController#setupConnection
  * MasterController#setupConnection
  * ReplicationMessageReceive constructor

1. A port number at this moment is passed as a property to a SlaveController 
and a 
MasterController boot  methods, so it's kind of permanent for all the further 
calls to 
startMaster/startSlave and consequently a setupConnection method (same applies 
for a host name). Which might mean that only a single pair of a slave 
hostname/port
values could be in a single instance of Derby now.

So it might be even less straight-forward I guess.

2. A ReplicationMessageReceive constr, it properly converts a port value <= 0 
to a default port
value before throwing an exception, by using a default port when port value > 
0. But 
SlaveController and MasterController don't.


There's also inconsistency in both SlaveController and MasterController of 
where a port number
is obtained: it's a 'receiver' object in the former, and a local variable 
'slaveport' in the latter. 
I assume It might be reasonable to unify this somehow, by making them both 
using a local var.

I think that both a small issue stated just above and the 2nd one could be 
easily fixed. But the 1st
one would require more attention as it might depend on replication requirements.

Thanks!

> Error message XRE04 does not include the right port number.
> -----------------------------------------------------------
>
>                 Key: DERBY-3489
>                 URL: https://issues.apache.org/jira/browse/DERBY-3489
>             Project: Derby
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 10.4.0.0
>            Reporter: Øystein Grøvlen
>
> If the master is not able to connect to the slave, the error messages does 
> not include the right port number:
> ij> connect 
> 'jdbc:derby:masterDB;user=oystein;password=pass;startMaster=true;slaveHost=localhost;slavePort=9901';
> ERROR XRE04: Could not establish a connection to the peer of the replicated 
> database 'masterDB' on address 'localhost:-1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to