Previously, the webhooks_create, webhooks_update, and webhooks_delete functions used DbReplica connections to access Postgres, meaning that, if there were replicas, they could try to write to a read-only replica, resulting in 500 errors for the user. The postgres error we saw was ERROR: cannot execute INSERT in a read-only transaction. Note that requests to these endpoints would sometimes succeed if the connection happen to be routed to the main database rather than a replica. I also changed two connections for get endpoints that were using DbReadWrite connections to DbReplica.
Context
Previously, the
webhooks_create
,webhooks_update
, andwebhooks_delete
functions usedDbReplica
connections to access Postgres, meaning that, if there were replicas, they could try to write to a read-only replica, resulting in500
errors for the user. The postgres error we saw wasERROR: cannot execute INSERT in a read-only transaction
. Note that requests to these endpoints would sometimes succeed if the connection happen to be routed to the main database rather than a replica. I also changed two connections forget
endpoints that were usingDbReadWrite
connections toDbReplica
.Next steps
cc/ @ingalls @miccolis @samely @mattciferri