-
Notifications
You must be signed in to change notification settings - Fork 2
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
Read replicas #132
Read replicas #132
Conversation
e216948
to
3e5d746
Compare
} | ||
|
||
type ForkConfig struct { | ||
ProjectID string `json:"projectID"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the input for ForkConfig when creating a service uses projectID, while the types for ForkSpec use projectId so I think I need different structs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
3e5d746
to
a081780
Compare
Looks like there's a bug where you can create a read replica off a read replica that I need to fix before merging |
I also forgot to add validation on Update(), added those checks and some tests 😄. |
d15d187
to
1a05d19
Compare
Allow managing a read replica using Terraform. A read replica is specified as a resource with the attribute
read_replica_source
set.The provider applies some validation steps. The main one is to prevent multiple read replicas for the same service. If a user specifies multiple read replicas with the same source, Terraform will attempt to create these in parallel (unless the user specifies a parallelism of one). To get around this, we use a global read replica lock to synchronize the process of creating a read replica. Before we create the replica, we check if there is an existing read replica for a service. To do this, we fetch all the services the project and check if any of the fork configurations specify the same source.
This can be later optimized with service level mutexes. Since that would complicates the logic further, it's omitted in this PR.