Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions aws_advanced_python_wrapper/stale_dns_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def get_verified_connection(self, is_initial_connection: bool, host_list_provide
if cluster_inet_address is None:
return conn

if self._plugin_service.get_host_role(conn) == HostRole.READER:
connected_to_reader = self._plugin_service.get_host_role(conn) == HostRole.READER
if connected_to_reader:
# This if-statement is only reached if the connection url is a writer cluster endpoint.
# If the new connection resolves to a reader instance, this means the topology is outdated.
# Force refresh to update the topology.
Expand Down Expand Up @@ -109,7 +110,7 @@ def get_verified_connection(self, is_initial_connection: bool, host_list_provide
if self._writer_host_address is None:
return conn

if self._writer_host_address != cluster_inet_address:
if self._writer_host_address != cluster_inet_address or connected_to_reader:
logger.debug("StaleDnsHelper.StaleDnsDetected", self._writer_host_info)

allowed_hosts = self._plugin_service.hosts
Expand Down
Loading