-
Notifications
You must be signed in to change notification settings - Fork 883
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
Add support for DROP SCHEMA on multi-node #3949
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,19 +368,24 @@ dist_ddl_process_drop(const ProcessUtilityArgs *args) | |
{ | ||
DropStmt *stmt = castNode(DropStmt, args->parsetree); | ||
|
||
/* For DROP TABLE and DROP SCHEMA operations hypertable_list will be empty */ | ||
if (list_length(args->hypertable_list) == 0) | ||
{ | ||
/* | ||
* CASCADE operations of DROP TABLE and DROP SCHEMA are handled in | ||
* sql_drop trigger. | ||
*/ | ||
|
||
/* For DROP TABLE and DROP SCHEMA operations hypertable_list will be | ||
* empty. Wait for sql_drop events. | ||
*/ | ||
if (stmt->removeType == OBJECT_TABLE || stmt->removeType == OBJECT_SCHEMA) | ||
dist_ddl_state_schedule(DIST_DDL_EXEC_ON_END, args); | ||
|
||
switch (stmt->removeType) | ||
{ | ||
case OBJECT_TABLE: | ||
/* Wait for further sql_drop events */ | ||
dist_ddl_state_schedule(DIST_DDL_EXEC_ON_END, args); | ||
break; | ||
case OBJECT_SCHEMA: | ||
/* Forward DROP SCHEMA command to all data nodes, following | ||
* sql_drop events will be ignored */ | ||
Comment on lines
+381
to
+382
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A completely clueless question: why do we have to execute DROP SCHEMA immediately, in contrast to DROP TABLE? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously we did not support |
||
dist_ddl_state_schedule(DIST_DDL_EXEC_ON_START, args); | ||
dist_ddl_state_add_current_data_node_list(); | ||
break; | ||
default: | ||
break; | ||
} | ||
return; | ||
} | ||
|
||
|
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.
If the
hypertable_list
is not empty, andremoveType == OBJECT_TABLE
, what would that mean?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.
Or what does the default branch in the following switch/case means... looks like this needs more assertions/comments.
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 believe hypertable can't be added into the hypertable list, because drop operation is already happened by PostgreSQL standard hook (src/process_utility.c) at this point and it can't be resolved
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.
Should it be an
Assert
then, with this explanation as a comment?