-
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
Conversation
02e7bad
to
802dd24
Compare
Codecov Report
@@ Coverage Diff @@
## master #3949 +/- ##
==========================================
- Coverage 90.74% 90.73% -0.01%
==========================================
Files 213 213
Lines 38459 38466 +7
==========================================
+ Hits 34898 34904 +6
- Misses 3561 3562 +1
Continue to review full report at Codecov.
|
/* For DROP TABLE and DROP SCHEMA operations hypertable_list will be empty */ | ||
if (list_length(args->hypertable_list) == 0) | ||
{ |
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, and removeType == 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?
/* Forward DROP SCHEMA command to all data nodes, following | ||
* sql_drop events will be ignored */ |
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we did not support CREATE SCHEMA
explicitly on data nodes and whenDROP SCHEMA CASCADE
was executed, we only shipped it by analyzing distributed hypertables which we part of that schema. No it is much simpler, we assume schema exists on all data nodes and we can drop it right away.
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 don't really understand the code but the tests make sense.
This PR changes logic and allows DROP SCHEMA command to be executed on each data node, even if the schema being dropped has no distributed hypertables in it. Fix: timescale#3909
802dd24
to
894c004
Compare
This release is medium priority for upgrade. We recommend that you upgrade at the next available opportunity. This release adds major new features since the 2.5.2 release, including: Compression in continuous aggregates Experimental support for timezones in continuous aggregates Experimental support for monthly buckets in continuous aggregates It also includes several bug fixes. Telemetry reports are switched to a new format, and now include more detailed statistics on compression, distributed hypertables and indexes. **Features** * timescale#3768 Allow ALTER TABLE ADD COLUMN with DEFAULT on compressed hypertable * timescale#3769 Allow ALTER TABLE DROP COLUMN on compressed hypertable * timescale#3943 Optimize first/last * timescale#3945 Add support for ALTER SCHEMA on multi-node * timescale#3949 Add support for DROP SCHEMA on multi-node **Bugfixes** * timescale#3808 Properly handle max_retries option * timescale#3863 Fix remote transaction heal logic * timescale#3869 Fix ALTER SET/DROP NULL contstraint on distributed hypertable * timescale#3944 Fix segfault in add_compression_policy * timescale#3961 Fix crash in EXPLAIN VERBOSE on distributed hypertable * timescale#4015 Eliminate float rounding instabilities in interpolate * timescale#4019 Update ts_extension_oid in transitioning state * timescale#4073 Fix buffer overflow in partition scheme **Improvements** Query planning performance is improved for hypertables with a large number of chunks. **Thanks** * @fvannee for reporting a first/last memory leak * @mmouterde for reporting an issue with floats and interpolate
This release is medium priority for upgrade. We recommend that you upgrade at the next available opportunity. This release adds major new features since the 2.5.2 release, including: Compression in continuous aggregates Experimental support for timezones in continuous aggregates Experimental support for monthly buckets in continuous aggregates It also includes several bug fixes. Telemetry reports are switched to a new format, and now include more detailed statistics on compression, distributed hypertables and indexes. **Features** * #3768 Allow ALTER TABLE ADD COLUMN with DEFAULT on compressed hypertable * #3769 Allow ALTER TABLE DROP COLUMN on compressed hypertable * #3943 Optimize first/last * #3945 Add support for ALTER SCHEMA on multi-node * #3949 Add support for DROP SCHEMA on multi-node **Bugfixes** * #3808 Properly handle max_retries option * #3863 Fix remote transaction heal logic * #3869 Fix ALTER SET/DROP NULL contstraint on distributed hypertable * #3944 Fix segfault in add_compression_policy * #3961 Fix crash in EXPLAIN VERBOSE on distributed hypertable * #4015 Eliminate float rounding instabilities in interpolate * #4019 Update ts_extension_oid in transitioning state * #4073 Fix buffer overflow in partition scheme **Improvements** Query planning performance is improved for hypertables with a large number of chunks. **Thanks** * @fvannee for reporting a first/last memory leak * @mmouterde for reporting an issue with floats and interpolate
This release is medium priority for upgrade. We recommend that you upgrade at the next available opportunity. This release adds major new features since the 2.5.2 release, including: Compression in continuous aggregates Experimental support for timezones in continuous aggregates Experimental support for monthly buckets in continuous aggregates It also includes several bug fixes. Telemetry reports are switched to a new format, and now include more detailed statistics on compression, distributed hypertables and indexes. **Features** * #3768 Allow ALTER TABLE ADD COLUMN with DEFAULT on compressed hypertable * #3769 Allow ALTER TABLE DROP COLUMN on compressed hypertable * #3943 Optimize first/last * #3945 Add support for ALTER SCHEMA on multi-node * #3949 Add support for DROP SCHEMA on multi-node **Bugfixes** * #3808 Properly handle max_retries option * #3863 Fix remote transaction heal logic * #3869 Fix ALTER SET/DROP NULL contstraint on distributed hypertable * #3944 Fix segfault in add_compression_policy * #3961 Fix crash in EXPLAIN VERBOSE on distributed hypertable * #4015 Eliminate float rounding instabilities in interpolate * #4019 Update ts_extension_oid in transitioning state * #4073 Fix buffer overflow in partition scheme **Improvements** Query planning performance is improved for hypertables with a large number of chunks. **Thanks** * @fvannee for reporting a first/last memory leak * @mmouterde for reporting an issue with floats and interpolate
This PR changes logic and allows DROP SCHEMA command to be executed
on each data node, even if the schema being dropped has no distributed
hypertables in it.
Fix: #3909