Add DB activity based routing#864
Add DB activity based routing#864drdrsh merged 1 commit intopostgresml:mainfrom TailorBrands:enh/db-activity-routing
Conversation
|
I have gotten around to testing the PR. It works as described. I have a few notes
|
|
Another related note but not strictly necessary as part of this PR, is about propagation of this information to other PgCat instances in a HA deployment. I don't think it is necessary but I was curious if you had thoughts on this. |
|
Thanks for the detailed review! Changes:
HA Note: Would love to get this merged - let me know if there's anything else I should do here. |
|
That makes sense. I ran the tests and clippy is complaining about |
|
Not sure why clippy didn't show me this issue 🤔 |
|
@nadavshatz - Curious to know if table_mutation_cache_ms_ttl is working as expected for you? I'm observing stale data in the current session after writes, unless pg_sleep(0.05) or SET SERVER ROLE TO 'primary' is used to force updated reads in the current session post immediate write. |
|
due to some deployment issues with pgcat we haven't been able to fully use the feature yet. so i'm afraid i don't have much insight here. |
|
Got it . Thank you for the response @nadavshatz |
Hi all,
This is an attempt to add support for primary-replica routing based on recent writes on the table level.
We've implemented this as a separate process alongside PgPool-II before.
This will perform much better as it's incorporated into PgCat itself.
You can read all about the approach here: https://medium.com/tailor-tech/using-database-read-replicas-in-distributed-systems-d80eaf6bbf8a