-
Notifications
You must be signed in to change notification settings - Fork 4k
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
rds: Bug in writer/reader definition of clusters #30260
rds: Bug in writer/reader definition of clusters #30260
Comments
internal tracking: D132052101 |
Hi According to this: aws-cdk/packages/aws-cdk-lib/aws-rds/lib/cluster.ts Lines 756 to 764 in 465c8ad
And this
The I think we still need to ensure the dependencies for them. |
This PR ensures the dependency on the readers always to be created after the writer. This might not be the best solution as all the readers will not start provisioning until the writer is completed. Another solution is to build a custom resource to check if the writer has started provisioning, if yes, return success and let all the dependent readers start provisioning. But that would require a new custom resource. - [x] unit tests - [x] update integ tests - fixed the integ error `"Cannot find version 8.0.mysql_aurora.3.01.0 for aurora-mysql` for `integ.cluster-instance-id` ### Issue # (if applicable) Closes #30260 ### Reason for this change ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
This PR ensures the dependency on the readers always to be created after the writer. This might not be the best solution as all the readers will not start provisioning until the writer is completed. Another solution is to build a custom resource to check if the writer has started provisioning, if yes, return success and let all the dependent readers start provisioning. But that would require a new custom resource. - [x] unit tests - [x] update integ tests - fixed the integ error `"Cannot find version 8.0.mysql_aurora.3.01.0 for aurora-mysql` for `integ.cluster-instance-id` ### Issue # (if applicable) Closes aws#30260 ### Reason for this change ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR ensures the dependency on the readers always to be created after the writer. This might not be the best solution as all the readers will not start provisioning until the writer is completed. Another solution is to build a custom resource to check if the writer has started provisioning, if yes, return success and let all the dependent readers start provisioning. But that would require a new custom resource. - [x] unit tests - [x] update integ tests - fixed the integ error `"Cannot find version 8.0.mysql_aurora.3.01.0 for aurora-mysql` for `integ.cluster-instance-id` ### Issue # (if applicable) Closes aws#30260 ### Reason for this change ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
When creating a fresh cluster with readers and writer, one of the reader instances is effectively created before the writer and becomes the actual writer. So the opposite of what's written in the CDK code happens. This is a bug and it's reproducible.
Expected Behavior
The expected behavior is that the writer specified in CDK is indeed the writer when the cluster is created.
Current Behavior
The current behavior is that the writer becomes the reader, and viceversa, on a fresh cluster creation, which is the opposite of what's specified in CDK.
The CDK puts the writer instance first in CloudFormation, but that's not enough to guarantee that the first instance being created in the cluster because CloudFormation creates resources in parallel.
Reproduction Steps
Code:
Result, see in the image that the writer is the reader and viceversa, on a freshly created cluster:
Possible Solution
The possible solution is to add a dependency on the writer instance to all the reader instances here: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts , to guarantee that the writer instance is the first instance being created in the cluster and thus become the writer.
Additional Information/Context
No response
CDK CLI Version
2.130.0
Framework Version
No response
Node.js Version
18
OS
Ubuntu
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: