View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004025 | SymmetricDS | Bug | public | 2019-06-24 10:09 | 2019-08-23 16:46 |
Reporter | kseidl | Assigned To | elong | ||
Priority | normal | ||||
Status | closed | Resolution | fixed | ||
Product Version | 3.9.20 | ||||
Target Version | 3.10.4 | Fixed in Version | 3.10.4 | ||
Summary | 0004025: Duplicate Registration Requests when IP-Address of client changes | ||||
Description | We observe multiple rows in table sym_registration_request for the same client (external_id, host_name) when the requesting client changes it's IP address until the registration is approved. We see in class RegistrationServiceSqlMap Sql statements, which include the ip_address in the where clause and wonder, if this is correct. External_Id and Hostname should be unique and sufficient. After approval of registration, there remains an unprocessed row in the sym_registration_request, which can cause confusion. (e.g. putSql("updateRegistrationRequestSql", "" + "update $(registration_request) " + " set attempt_count=?, " + " last_update_by=?, last_update_time=?, registered_node_id=?, status=?, error_message=?, " + " deployment_type=?, symmetric_version=?, database_type=?, database_version=? " + " where " + " node_group_id=? and external_id=? and ip_address=? and host_name=? and (status='RQ' or status='ER') "); ) | ||||
Tags | registration | ||||
|
@chenson does this have to with a use case when external.id.is.unique.enabled=false? Or is it just over qualified in the query? |
|
It's because when using external.id.is.unique.enabled=false, there may be multiple nodes with the same node_group_id and external_id. For example, group "store" and external ID of "001" is used by all the point of sales (pos) at store 001 location. In that case, each pos would get a node ID like 001-1, 001-2, 001-3, etc. To update the correct record in registration request, it's using the IP address and hostname to find the right row. It sounds like it's working as designed. The purge service will clear out old registration request, so they won't be there forever. |
|
The triple node_group_id, external_id, hostname is unique, and the IP address is overspecifying the UPDATE statement. The problem is, that when th IP of the client changes during the registration process, there will remain one record in status RQ forever, which is not purged. I would recommend: putSql("updateRegistrationRequestSql", "" + "update $(registration_request) " + " set attempt_count=?, " + " last_update_by=?, last_update_time=?, registered_node_id=?, status=?, error_message=?, " + " deployment_type=?, symmetric_version=?, database_type=?, database_version=?, ip_address=? " + " where " + " node_group_id=? and external_id=? and host_name=? and (status='RQ' or status='ER') "); putSql("deleteRegistrationRequestSql", "delete from $(registration_request) where node_group_id=? and external_id=? and host_name=? and status=?"); |
|
Thanks, that makes sense. Applying your suggested fix. |
SymmetricDS: 3.10 ee545dea 2019-07-03 10:22:07 Details Diff |
0004025: Duplicate Registration Requests when IP-Address of client changes |
Affected Issues 0004025 |
|
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java | Diff File | ||
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationServiceSqlMap.java | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-06-24 10:09 | kseidl | New Issue | |
2019-06-24 10:09 | kseidl | Tag Attached: registration | |
2019-06-24 12:38 | elong | Note Added: 0001540 | |
2019-07-02 14:55 | elong | Assigned To | => elong |
2019-07-02 14:55 | elong | Status | new => feedback |
2019-07-02 14:55 | elong | Note Added: 0001542 | |
2019-07-03 05:18 | kseidl | Note Added: 0001547 | |
2019-07-03 05:18 | kseidl | Status | feedback => assigned |
2019-07-03 14:23 | elong | Status | assigned => resolved |
2019-07-03 14:23 | elong | Resolution | open => fixed |
2019-07-03 14:23 | elong | Fixed in Version | => 3.10.4 |
2019-07-03 14:23 | elong | Target Version | => 3.10.4 |
2019-07-03 14:23 | elong | Note Added: 0001549 | |
2019-07-03 15:00 | admin | Changeset attached | => SymmetricDS 3.10 ee545dea |
2019-08-23 16:46 | admin | Status | resolved => closed |