Skip to content
Permalink
Browse files

0004025: Duplicate Registration Requests when IP-Address of client

changes
  • Loading branch information...
erilong committed Jul 3, 2019
1 parent 4f22467 commit ee545dea1e8b2e6e54bceafda10d21d837e86483
@@ -331,8 +331,7 @@ public boolean deleteRegistrationRequest(RegistrationRequest request) {
String externalId = request.getExternalId() == null ? "" : request.getExternalId();
String nodeGroupId = request.getNodeGroupId() == null ? "" : request.getNodeGroupId();
return 0 < sqlTemplate.update(getSql("deleteRegistrationRequestSql"), new Object[] {
nodeGroupId, externalId, request.getIpAddress(), request.getHostName(),
request.getStatus().name() });
nodeGroupId, externalId, request.getHostName(), request.getStatus().name() });
}

public void saveRegistrationRequest(RegistrationRequest request) {
@@ -358,10 +357,9 @@ public void saveRegistrationRequest(RegistrationRequest request) {
new Object[] { request.getAttemptCount(), request.getLastUpdateBy(),
request.getLastUpdateTime(), request.getRegisteredNodeId(),
request.getStatus().name(), request.getErrorMessage(), nodeGroupId,
externalId, request.getIpAddress(), request.getHostName() }, new int[] {
externalId, request.getHostName() }, new int[] {
Types.NUMERIC, Types.VARCHAR, Types.TIMESTAMP, Types.VARCHAR, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
Types.VARCHAR });
Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR });
}

if (count == 0) {
@@ -72,7 +72,7 @@ public RegistrationServiceSqlMap(IDatabasePlatform platform,
+ " set attempt_count=?, "
+ " last_update_by=?, last_update_time=?, registered_node_id=?, status=?, error_message=? "
+ " where "
+ " node_group_id=? and external_id=? and ip_address=? and host_name=? and (status='RQ' or status='ER') ");
+ " node_group_id=? and external_id=? and host_name=? and (status='RQ' or status='ER') ");

putSql("selectRegistrationRequestSql",
""
@@ -82,7 +82,7 @@ public RegistrationServiceSqlMap(IDatabasePlatform platform,
+ " where status in ('RQ','ER') ");

putSql("deleteRegistrationRequestSql",
"delete from $(registration_request) where node_group_id=? and external_id=? and ip_address=? and host_name=? and status=?");
"delete from $(registration_request) where node_group_id=? and external_id=? and host_name=? and status=?");

}

0 comments on commit ee545de

Please sign in to comment.
You can’t perform that action at this time.