Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the isMultiWriterCluster flag from the AuroraTopologyService #405

Merged
merged 11 commits into from
May 9, 2023

Conversation

crystall-bitquill
Copy link
Contributor

Summary

Remove the isMultiWriterCluster flag from the AuroraTopologyService

Description

Multi writer clusters are not longer supported, so the isMultiWriterCluster flag that was used to disable failover has been removed. Additionally, checks have been added to ensure stale writer records that are obtained post writer-failover are not being used.

Additional Reviewers

null : previousTopology.get(FailoverConnectionPlugin.WRITER_CONNECTION_INDEX);

// There is potentially a stale record. Do not add it to the hosts list.
if (writerCount == 2
Copy link
Contributor

Choose a reason for hiding this comment

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

And if it's more than 2 writers found? Like few stale writer records. Is it possible to process all stale records and keep the latest one?

@@ -1055,7 +1055,8 @@ ConnectionProperties.useAwsIam=Set to true to use AWS IAM database authenticatio

AuroraTopologyService.1=[AuroraTopologyService] clusterId=''{0}''
AuroraTopologyService.2=[AuroraTopologyService] clusterInstance host=''{0}'', port={1,number,#}, database=''{2}''
AuroraTopologyService.3=[AuroraTopologyService] The topology query returned an invalid topology - no writer instance detected
AuroraTopologyService.3=[AuroraTopologyService] The topology query returned an invalid topology - no writer instance detected.
AuroraTopologyService.4=[AuroraTopologyService] The topology query returned an invalid topology - multi-writer is not supported.
Copy link
Contributor

Choose a reason for hiding this comment

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

That looks like a message we no longer need. Everything related to multi-writers should go.

} else {
// Store the first writer to its expected position [0]. If there are other writers or stale records, ignore them.
// ResultSet and writers list is already ordered by latest updated after querying with RETRIEVE_TOPOLOGY_SQL.
hosts.add(FailoverConnectionPlugin.WRITER_CONNECTION_INDEX, writers.get(0));
Copy link
Contributor

Choose a reason for hiding this comment

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

writers.get(0) may contain not the latest writer node. I think we still need to sort writers collection by last updated date.

@sergiyvamz sergiyvamz merged commit 88f3ae6 into awslabs:main May 9, 2023
@karenc-bq karenc-bq deleted the remove-isMultiWriterCluster branch May 9, 2023 17:17
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.

2 participants