View Issue Details

IDProjectCategoryView StatusLast Update
0004025SymmetricDSBugpublic2019-07-03 11:00
ReporterkseidlAssigned Toelong 
Prioritynormal 
Status resolvedResolutionfixed 
Product Version3.9.20 
Target Version3.10.4Fixed in Version3.10.4 
Summary0004025: Duplicate Registration Requests when IP-Address of client changes
DescriptionWe 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') ");
)
Tagsregistration

Activities

elong

2019-06-24 08:38

developer   ~0001540

@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?

elong

2019-07-02 10:55

developer   ~0001542

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.

kseidl

2019-07-03 01:18

reporter   ~0001547

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=?");

elong

2019-07-03 10:23

developer   ~0001549

Thanks, that makes sense. Applying your suggested fix.

Related Changesets

SymmetricDS: 3.10 ee545dea

2019-07-03 10:22:07

admin

Details Diff
0004025: Duplicate Registration Requests when IP-Address of client
changes

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

Issue History

Date Modified Username Field Change
2019-06-24 06:09 kseidl New Issue
2019-06-24 06:09 kseidl Tag Attached: registration
2019-06-24 08:38 elong Note Added: 0001540
2019-07-02 10:55 elong Assigned To => elong
2019-07-02 10:55 elong Status new => feedback
2019-07-02 10:55 elong Note Added: 0001542
2019-07-03 01:18 kseidl Note Added: 0001547
2019-07-03 01:18 kseidl Status feedback => assigned
2019-07-03 10:23 elong Status assigned => resolved
2019-07-03 10:23 elong Resolution open => fixed
2019-07-03 10:23 elong Fixed in Version => 3.10.4
2019-07-03 10:23 elong Target Version => 3.10.4
2019-07-03 10:23 elong Note Added: 0001549
2019-07-03 11:00 admin Changeset attached => SymmetricDS 3.10 ee545dea