You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Jørgen Løland (JIRA)" <ji...@apache.org> on 2007/09/05 11:38:33 UTC

[jira] Commented: (DERBY-3021) Replication: Add a ReplicationSlave controller that will manage replication on the slave side

    [ https://issues.apache.org/jira/browse/DERBY-3021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525034 ] 

Jørgen Løland commented on DERBY-3021:
--------------------------------------

I want to refuse connections to a database that is in the slave mode. To do so, I intend to add a check in BasicDatabase.java#setupConnection that throws a StandardException stating "Cannot connect to a database in replication slave mode" or similar.

In SQLStates.java there is now a subset of error codes for repliation: XRExx. Initially, I intended to use code XRE02.C for this error. However, this exception is thrown on connection, which has error class 08 in the SQL specification. 

Any thoughts on whether the most appropriate error code for this would be:

* XRE02.C since it is a replication error message with session severity, or
* 0800x (e.g., 08006 - connection failure) since this is a connection error? 

> Replication: Add a ReplicationSlave controller that will manage replication on the slave side
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3021
>                 URL: https://issues.apache.org/jira/browse/DERBY-3021
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Services
>    Affects Versions: 10.4.0.0
>            Reporter: Jørgen Løland
>            Assignee: Jørgen Løland
>
> The replication slave role includes many tasks:
> * set up a network connection with the master
> * receive chunks of log from the master, and parse these into individual log records
> * append log records to the local log file
> * make sure that the recovery process is not allowed to access the logfile we are currently writing to
> * etc
> This issue is for adding a controller that will start/stop/initiate all services needed for the replication slave role.

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


Re: [jira] Commented: (DERBY-3021) Replication: Add a ReplicationSlave controller that will manage replication on the slave side

Posted by Jørgen Løland <Jo...@Sun.COM>.
Dag H. Wanvik wrote:
> "Jørgen Løland (JIRA)" <ji...@apache.org> writes:
> 
>> Any thoughts on whether the most appropriate error code for this would be:
>>
>> * XRE02.C since it is a replication error message with session severity, or
>> * 0800x (e.g., 08006 - connection failure) since this is a connection error? 
> 
> 08006 seems to be a network client error, wouldn't a new 08004 (the
> server is there but rejects the connection for some reason...) be more
> in the spirit of existing allocations? But I am OK with XRE02.C, too.
> 
> I looked at some other non-"08xxx" which have session severity level
> in Derby, but am not sure they give much guidance. Maybe we should
> prefer 08004 when reasonble, since this has standard SQL semantics
> (not implementation defined). In JDBC 4 this SQLSTATE class has a
> defined mapping to SQL(Non)TransientConnectionExceptions, too.
> 
> I must admit I feel a bit out on a limb, here, so it someone has any
> general guidelines for how to allocate new error codes in Derby, I,
> for one, would appreciate it.

I agree; it makes sense to use existing SQL codes whenever possible and 
new, custom error codes when the message does not fit anywhere else.

Hence, in this case, 08004 seems to be the better choice.

-- 
Jørgen Løland

Re: [jira] Commented: (DERBY-3021) Replication: Add a ReplicationSlave controller that will manage replication on the slave side

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
"Jørgen Løland (JIRA)" <ji...@apache.org> writes:

> Any thoughts on whether the most appropriate error code for this would be:
>
> * XRE02.C since it is a replication error message with session severity, or
> * 0800x (e.g., 08006 - connection failure) since this is a connection error? 


08006 seems to be a network client error, wouldn't a new 08004 (the
server is there but rejects the connection for some reason...) be more
in the spirit of existing allocations? But I am OK with XRE02.C, too.

I looked at some other non-"08xxx" which have session severity level
in Derby, but am not sure they give much guidance. Maybe we should
prefer 08004 when reasonble, since this has standard SQL semantics
(not implementation defined). In JDBC 4 this SQLSTATE class has a
defined mapping to SQL(Non)TransientConnectionExceptions, too.

I must admit I feel a bit out on a limb, here, so it someone has any
general guidelines for how to allocate new error codes in Derby, I,
for one, would appreciate it.

Dag