-
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
aws-rds: deprecate writer and readers props for DatabaseCluster #26726
Comments
Thanks for the callout. When you delete a writer from the console, the reader will immediately promoted as the new writer and if you go to cloudformation to "detect drfit", the stack will be in DRIFTED status because the writer has been deleted. Unfortunately we didn't address the recommended practice how to update the existing cdk stack in this scenario given the writer is deleted and reader promoted as writer. I will explore this a little bit further and see if I can find anything. |
The naming introduced into CDK with |
I've updated the title of this issue because I don't think it's possible to resolve this confusion adequately with documentation as the behaviour implied by CDK's |
I just noticed that even the initial writer/reader assignment might no be valid. With a fresh cluster (one writer, one reader), Aurora just assigned the supposedly writer role ("assigned" by the CDK) the reader role, and vice versa. |
Hello, I have an issue, I'm trying to migrate from instanceProps to writer and readers and CloudFormation wants to delete my old isntances and replace them with new ones, which is not optimal, how did you guys handle this? Don't tell me you created new ones and then removed the old ones LE: found a solutions here #25900 |
I'm hitting this issue. |
Ideal scenario -- Allow for initial creation of multiple provisioned DBInstances in the cluster, spread across AZ's, but don't fail on upgrades if they are different later. btw. It would be good if we could specify a naming convention for the dbInstances too - eg. include the AZ letter identifier in the name. |
This new API is very counterintuitive and I would support rolling it back. The Further, I have just come to look at specifying the new CA certificates, but it's not available in the |
@pahud - can you reassure the community here that the deprecated instances and instanceProps for the DatabaseClusterProps will not be removed until there is a viable solution in place? Ideally dropping the deprecated flag on them for now? Right now for aurora provisioned with read replicas it works as expected, with there being no difference in the CDK between writers and readers as RDS treats them all as a pool of fungible instances. It would be a disaster for us if the APIs were removed with no viable upgrade path. Thanks! |
Hi @mjgp2 With #30277, on the cluster initial provisioning, the writer would always be created before the reader so it would reflect the initial state. But due to the nature of failover, the writer could be gone with reader promoted as the new writer and that would be a drift. I have no solution off the top of my head when the drift happens what is the best way to continue update this stack but I think this is something we should figure out the solution in CFN before we know how to do that in CDK. I am leaving this thread open. Any feedbacks are welcome here. |
@pahud the solution is already in CFN: CFN does simply not assume any writers or readers. There are only plain |
RDS CFN engineer here. The feedback in this issue is correct. The current design of DatabaseCluster doesn't model Aurora clusters correctly and makes it unwieldy to properly implement a multi-AZ Aurora cluster. As others have mentioned, Aurora cluster instances are supposed to be fungible (although this is a simplification). Any instance can be the writer, and which one it is can change at any time when a failover occurs. There is no direct control over which instance becomes the writer, but you can influence the choice using promotion tiers. Failover is not considered as drift and does not block CFN stack updates. Instead of having 1 writer + n readers, it would be more correct to model cluster instances in terms of promotion tiers. |
Any updates here please? |
Describe the issue
The props
instances
andinstanceProps
forrds.DatabaseCluster
are deprecated in favour ofwriter
andreaders
.What is the behaviour of these when the Aurora cluster fails over? If I create a reader, can it become promoted to a writer, or will it always be a reader?
Relevant Aurora docs: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Concepts.AuroraHighAvailability.Instances
Further, assuming they do all just become instances in the cluster, any of which might get promoted to be the writer, what happens on future CDK deployments? I can imagine a situation where I think I'm changing something about the readers, but am actually changing something about all-but-one of the readers and the writer, because:
I don't see any discussion around this in #25437, the PR that introduced this.
I might just be missing something, but the structure of this seems at odds with how an Aurora cluster actually behaves.
Links
CDK docs:
Aurora failover docs: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Concepts.AuroraHighAvailability.Instances
The text was updated successfully, but these errors were encountered: