Skip to content
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

Manage mutation of permissions directly in the proxy #1393

Open
wants to merge 4 commits into
base: garry/vax-1425-create-permissions-protobuf-definitions-and-write-validation
Choose a base branch
from

Conversation

magnetised
Copy link
Contributor

@magnetised magnetised commented Jun 20, 2024

Rather than send ddlx commands through the replication stream and then apply them to the current permissions state when they come out of pg, this pr instead moves mutation of the permissions to the proxy process. so we load the current permissions state within the proxy transaction then mutate them on receipt of any ddlx commands.

if at the end of the tx the perms have changed, then we write them to pg before committing the txn.

the advantage of this is that the proxy is able to retrieve a consistent view of the permissions within migration transactions and so can determine the permissions state for any table when updating triggers. basically an essential building block if we're going to defer adding the consistency triggers at the point of granting write perms.

also includes a re-factor of the way we keep track of published tables to hopefully make that process less error prone, and a bit of a clean up of the internal migration code.

@magnetised magnetised force-pushed the garry/vax-1425-create-permissions-protobuf-definitions-and-write-validation branch from 1448f55 to e88fb06 Compare June 20, 2024 14:28
@magnetised magnetised force-pushed the garry/consistent-permissions-management branch 10 times, most recently from 03432cb to 3c65a83 Compare June 24, 2024 13:12
@magnetised magnetised force-pushed the garry/consistent-permissions-management branch from 3c65a83 to 1c6df76 Compare June 24, 2024 13:33
@magnetised magnetised marked this pull request as ready for review June 24, 2024 14:38
existing assertion is invalid. grepping the logs the only occurance of a
line matching `.+trans:.+` is from the migration but the data *is*
correctly being sent to the client.
Copy link
Member

@alco alco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants