-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix: reduce postgres notify messaging #409
Conversation
61579f9
to
ce4711b
Compare
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.
Crap -- this was just sitting as pending.
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.
I got a tad confused btw -- there seems to be AsyncTaskTablePostgres here but then it is also in ui_backend_service/data/db/tables. Is this normal? Is one used for the metadata service and one for the ui backend. It was a tad confusing because then I wasn't sure which one would get to read operations/conditions, etc for triggers. It's a minor nit but just curious.
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 services/data
table classes are functionally aimed for the original metadata services needs. During the ui_backend development introducing new stuff into them was out of scope, and if I recall correctly we did add some changes to existing methods specifically for the UI use case. This is why the ui_backend has its own table classes, that use services/data
as a base
there might be some duplication nowadays as the base classes have received some changes as well, but for example keeping the custom queries that the UI relies on out of the base classes made sense back then.
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.
but then again (to immediately contradict my points), the trigger setup has been kept in the base classes for reasons that I don't recall. Possibly due to some thoughts that the UI backend would initially run off a proper read replica so it would not be able to modify the DB to set up any triggers itself. This ended up not being possible after all due to limitations with read replicas regarding pg_notify, and eventually having the ui_backend be responsible for the trigger setup was the best option.
There is definitely a lot of room for cleanup regarding the table classes.
3daff68
to
4184f82
Compare
Reduces Postgres notify messaging on certain tables by restricting the operations that table triggers are triggered on.
This PR also changes the heartbeat monitoring to operate on a polling basis, instead of relying on
UPDATE
triggers from the database