Skip to content

Conversation

@congoamz
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@congoamz congoamz force-pushed the multi-az-integ branch 2 times, most recently from 64672fd to 598afbc Compare December 14, 2023 20:46
self._cluster_instance_template: HostInfo
host_pattern = WrapperProperties.CLUSTER_INSTANCE_HOST_PATTERN.get(self._props)
if host_pattern:
if host_pattern.find(":") > -1:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was running into a problem where the proxy tests weren't working because the host list provider was using 3306 instead of the proxy port. Talked with Sergiy and we decided to expand the cluster instance host pattern so that you can also specify a port that will override the one returned by the topology query.

assert aurora_utility.is_db_instance_writer(current_connection_id) is True
assert current_connection_id != initial_writer_id

@pytest.mark.skip
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we originally disabled this, test seems to be passing now


conn = self._open_connection(instance_info)
cursor = conn.cursor()
get_writer_id_query = self._get_multi_az_writer_sql(engine)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests depend on RdsTestUtility.get_instance_ids to return the writer in the first position. To do this with multi-az clusters we have to identify the writer before querying for the topology

}

if (!excludeFailover) {
LOGGER.warning("Tests requiring database failover are not supported for multi-az clusters. It may take 1hr+" +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will be hit by our gh action integration tests because excludeFailover must not be set so that the failover tests still run for Aurora. Should I make this info() instead of warning()? Or make it a comment instead of a log message?

clusterBuilder = clusterBuilder.enableIAMDatabaseAuthentication(true);
} else if (DatabaseEngineDeployment.MULTI_AZ.equals(this.dbEngineDeployment)) {
clusterBuilder =
clusterBuilder.allocatedStorage(allocatedStorage)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These settings are required when creating a multi-az cluster

@congoamz congoamz changed the title [WIP] Multi-AZ integration tests Multi-AZ integration tests Dec 15, 2023
# That is expected exception. Test pass.
assert True

@pytest.mark.skip("Currently failing, will be fixed in another PR")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was being skipped on main because of a bug. I got it to run now but it is failing with aurora for reasons unrelated to multi-az changes. I'll fix this in another PR

r"(?P<region>[a-zA-Z0-9\-]+)\.rds\.amazonaws\.com)"
r"(?P<dns>proxy-|cluster-|cluster-ro-|cluster-custom-)?" \
r"(?P<domain>[a-zA-Z0-9]+\." \
r"(?P<region>[a-zA-Z0-9\-]+)\.rds\.amazonaws\.com)(?!\.cn$)"
Copy link
Contributor

@sergiyvamz sergiyvamz Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this regular expression is right. That's what implemented in JDBC:
<instance>.cluster-<xyz>.<region>.rds.amazonaws.com
<instance>.cluster-<xyz>.rds.<region>.amazonaws.com.cn

region and rds are taking different places in url.

Copy link
Contributor

@karenc-bq karenc-bq Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya we don't actually know what is the correct pattern, we are confirming the pattern with Dave @sergiyvamz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the jdbc file mixes both patterns you mention, which is probably incorrect, its probably one or the other. I made this change to unify them to the same pattern, although we admittedly don't know which pattern is correct yet

@congoamz congoamz merged commit c49f680 into main Dec 19, 2023
@congoamz congoamz deleted the multi-az-integ branch December 19, 2023 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants