-
Notifications
You must be signed in to change notification settings - Fork 666
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
Adds create / drop database propagation support #7240
Conversation
d47a936
to
90ead5d
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7240 +/- ##
==========================================
- Coverage 89.57% 89.56% -0.02%
==========================================
Files 277 278 +1
Lines 59691 59973 +282
Branches 7438 7469 +31
==========================================
+ Hits 53471 53713 +242
- Misses 4084 4108 +24
- Partials 2136 2152 +16 |
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.
LGTM, let's rebase & merge this after syncing offline tomorrow morning.
PreprocessCreateDatabaseStmt(Node *node, const char *queryString, | ||
ProcessUtilityContext processUtilityContext) |
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 know this is the case but lastly we agreed on doing as much as we can in Postprocess?
However, I'm also okay with having the checks in Preprocess for CREATE DATABASE as it feels safer to ensure them before creating the database. This is because, we're not so sure about what does it mean to throw an error after creating a database in the same (implicit) transaction.
So let's keep it as is then.
src/backend/distributed/sql/udfs/citus_internal_database_command/12.2-1.sql
Outdated
Show resolved
Hide resolved
src/backend/distributed/sql/udfs/citus_internal_database_command/latest.sql
Outdated
Show resolved
Hide resolved
Please update the PR description before merging the PR to be more descriptive about what we support:
|
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.
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.
Looks like my change requests are addressed.
…ain dbs (#7532) When adding CREATE/DROP DATABASE propagation in #7240, luckily we've added EnsureSupportedCreateDatabaseCommand() check into deparser too just to be on the safe side. That way, today CREATE DATABASE commands from non-main dbs don't silently allow unsupported options. I wasn't aware of this when merging #7439 and hence wanted to add a test so that we don't mistakenly remove that check from deparser in future.
…ain dbs (#7532) When adding CREATE/DROP DATABASE propagation in #7240, luckily we've added EnsureSupportedCreateDatabaseCommand() check into deparser too just to be on the safe side. That way, today CREATE DATABASE commands from non-main dbs don't silently allow unsupported options. I wasn't aware of this when merging #7439 and hence wanted to add a test so that we don't mistakenly remove that check from deparser in future.
DESCRIPTION: Adds support for propagating
CREATE
/DROP
databaseIn this PR, create and drop database support is added.
For CREATE DATABASE:
The last two are because those are not saved in
pg_database
and when activating a node, we cannot assume what parameters were provided when creating the database.And "oid" is not supported because whether user specified an arbitrary oid when creating the database is not saved in pg_database and we want to avoid from oid collisions that might arise from attempting to use an auto-assigned oid on workers.
Finally, in case of node activation, GRANTs for the database are also propagated.