[openstreetmap/openstreetmap-website] Use database replicas for read requests (#2634)
Andy Allan
notifications at github.com
Wed May 27 14:37:27 UTC 2020
We realised in #2563 that we needed to update our controller tests, so that they use the DatabaseSelector middleware in the test suite and pick up any cases of trying to write to the database during read requests. Now that the refactoring is done I thought I would revisit the multiple databases setup.
However, last week I found a new problem when running the test suite, and it's taken many hours to narrow down the cause (since it lies somewhere deep deep within ActiveRecord, database connections and rails middleware) into a simplified test case, and even then I'm still not sure what's causing it our how to fix/workaround it. I think it's just in the test suite since the rails app appears to work fine for me, and even throws the right error in the right places. But until the problem with the test suite is sorted, this is on hold.
[I've reported the problem I found to the rails team](https://github.com/rails/rails/issues/39449), maybe someone there can point us in the right direction! This issue here is just to share progress with everyone and avoid anyone else having to duplicate the work I've done. If you want to get involved, you can see it (not) working on my [`multiple_databases_2`](https://github.com/gravitystorm/openstreetmap-website/tree/multiple_databases_2) branch, or have a look at the testcase app linked from the rails issue.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/2634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200527/9fc01664/attachment.htm>
More information about the rails-dev
mailing list