-
Notifications
You must be signed in to change notification settings - Fork 6
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
Sub-optimal way of creating replicas #135
Comments
Algolia is indeed capable of batching settings operations in certain conditions. |
Yeah, we used to do the batch update with the terraform-provider-algolia/internal/provider/resource_index.go Lines 104 to 110 in 7aca561
However, it's difficult to support individual replica index resource for the config update while having the replicas field because it can cause conflicts and unexpected behavior. As a workaround, we can create multiple replicas from the console, and import it to terraform after. |
We may want to include replica setting in resource "algolia_index" "primary_index" {
...
replica {
name = "replica_index"
}
replica {
...
}
virtual_replica{
...
}
} |
Another con that would impact us a lot would be that it would make it hard to avoid repetition between replicas: the replicas we have have very similar settings, so I created a module called resource "algolia_index" "primary_index" {
...
replica {
name = "replica_index"
languages_config {
ignore_plurals_for = [var.language]
remove_stop_words_for = [var.language]
query_languages = [var.language]
}
}
replica {
languages_config {
ignore_plurals_for = [var.language]
remove_stop_words_for = [var.language]
query_languages = [var.language]
}
}
virtual_replica{
...
}
} |
During yesterday's troubleshooting I mentioned in #134 with @julienpa and @godelized, they told me changing the primary to add replicas one by one was not the best way to proceed and had significant overhead. They hinting that one should gather the names of all replicas and perform a single set settings call on the primary. I don't have all the details, but they will comment on this issue.
The text was updated successfully, but these errors were encountered: