@@ -199,6 +199,8 @@ def _initialize(self):
199
199
else :
200
200
self ._cluster_instance_template = HostInfo (
201
201
host = self ._rds_utils .get_rds_instance_host_pattern (self ._initial_host_info .host ),
202
+ host_id = self ._initial_host_info .host_id ,
203
+ port = self ._initial_host_info .port ,
202
204
host_availability_strategy = host_availability_strategy )
203
205
self ._validate_host_pattern (self ._cluster_instance_template .host )
204
206
@@ -216,14 +218,14 @@ def _initialize(self):
216
218
self ._cluster_id = cluster_id_suggestion .cluster_id
217
219
self ._is_primary_cluster_id = cluster_id_suggestion .is_primary_cluster_id
218
220
else :
219
- cluster_url = self ._rds_utils .get_rds_cluster_host_url (self ._initial_host_info .url )
221
+ cluster_url = self ._rds_utils .get_rds_cluster_host_url (self ._initial_host_info .host )
220
222
if cluster_url is not None :
221
- self ._cluster_id = cluster_url
223
+ self ._cluster_id = f" { cluster_url } : { self . _cluster_instance_template . port } " if self . _cluster_instance_template . is_port_specified () else cluster_url
222
224
self ._is_primary_cluster_id = True
223
225
self ._is_primary_cluster_id_cache .put (self ._cluster_id , True ,
224
226
self ._suggested_cluster_id_refresh_ns )
225
227
226
- self ._is_initialized = True
228
+ self ._is_initialized = True
227
229
228
230
def _validate_host_pattern (self , host : str ):
229
231
if not self ._rds_utils .is_dns_pattern_valid (host ):
0 commit comments