-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make the heartbeat writer use 2 pools #9320
Conversation
… app to run inserts Signed-off-by: Manan Gupta <manan@planetscale.com>
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.
Thanks for working on this!
I wonder if it makes sense to do a round of auditing to make sure the create table ddl for the internal tables (e.g., heartbeat, schema migration, shard split, etc) are all using vt_allprivs
instead of vt_app
? We ran into a few other privilege cases where we end up switching vt_app to vt_dba for schema migration as well.
Related: idk if it would be an overkill, if we decide vt_allprivs
will be responsible for creating all the internal meta tables, would it be helpful to add a check and raise errors if user end up not granting CREATE
privilege to it?
@sonne5 you are right in that we need to go over and look at all the uses of |
Signed-off-by: Manan Gupta <manan@planetscale.com>
…a Schema error in execution Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
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.
Nice work!
Description
Currently the heartbeat writer uses
vt_app
user to create the database, table and also run the upsert commands. This isn't correct sincevt_app
might not have theCREATE
privilege, causing the create database and table commands to fail. This PR addresses this issue by creating 2 app pools, one forvt_app
to run the insert commands andvt_allprivs
to run the create commands.As part of this PR,
WithDDL
has also changed, and now takes two functions instead of one in itsExecute
method. The second function, if provided, is used for running the DDL commands. This allows the caller of this function to have two different execution functions for DDLs and other queries. This change will be helpful in the future too, in all the other usages ofWithDDL
which are using thevt_app
user for running the DDLs too.Related Issue(s)
Checklist
Deployment Notes