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

Fix index creation for hypertables with dropped columns #2974

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

svenklemm
Copy link
Member

@svenklemm svenklemm commented Feb 22, 2021

The index creation code would take the IndexInfo from the hypertable
and adjust it for the chunk but wouldnt reset IndexInfo for each
individual chunk leading to errors when the hypertable has dropped
columns.

Fixes #2504

@svenklemm svenklemm requested a review from a team as a code owner February 22, 2021 23:45
@svenklemm svenklemm requested review from pmwkaa, erimatnor, nikkhils, mkindahl and gayyappan and removed request for a team February 22, 2021 23:45
@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Merging #2974 (c8d14aa) into master (d43e54a) will increase coverage by 0.13%.
The diff coverage is 94.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2974      +/-   ##
==========================================
+ Coverage   90.15%   90.29%   +0.13%     
==========================================
  Files         212      212              
  Lines       34799    34938     +139     
==========================================
+ Hits        31373    31547     +174     
+ Misses       3426     3391      -35     
Impacted Files Coverage Δ
src/compat.h 100.00% <ø> (ø)
src/cross_module_fn.c 68.54% <ø> (ø)
tsl/src/compression/compression.c 95.32% <ø> (ø)
tsl/src/fdw/modify_plan.c 90.00% <0.00%> (ø)
tsl/src/init.c 82.35% <ø> (ø)
tsl/src/remote/connection_cache.c 90.40% <ø> (ø)
tsl/src/bgw_policy/continuous_aggregate_api.c 93.64% <90.75%> (-4.01%) ⬇️
src/hypertable_compression.c 96.22% <92.30%> (-1.28%) ⬇️
tsl/src/continuous_aggs/invalidation.c 97.94% <97.14%> (-0.17%) ⬇️
tsl/src/continuous_aggs/refresh.c 97.58% <98.14%> (-0.16%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d21b1c2...3f4d5d1. Read the comment docs.

@k-rus
Copy link
Contributor

k-rus commented Feb 23, 2021

@svenklemm Can you update the change log? Can you add the reference to the issue to the commit message too?

Fixes #2504

The index creation code would take the IndexInfo from the hypertable
and adjust it for the chunk but wouldnt reset IndexInfo for each
individual chunk leading to errors when the hypertable has dropped
columns.

Fixes timescale#2504
@svenklemm svenklemm merged commit 2e6fc74 into timescale:master Feb 23, 2021
k-rus added a commit to k-rus/timescaledb that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as trusted extension.

**Minor features**
* timescale#2998 Mark timescaledb as trusted extension

**Bugfixes**
* timescale#2948 Fix off by 4 error in histogram deserialize
* timescale#2974 Fix index creation for hypertables with dropped columns
* timescale#2990 Fix segfault in job_config_check for cagg
* timescale#2987 Fix crash due to txns in emit_log_hook_callback
* timescale#3042 Commit end transaction for CREATE INDEX
* timescale#3053 Fix gapfill/hashagg planner interaction
* timescale#3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
k-rus added a commit to k-rus/timescaledb that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as trusted extension.

**Minor features**
* timescale#2998 Mark timescaledb as trusted extension

**Bugfixes**
* timescale#2948 Fix off by 4 error in histogram deserialize
* timescale#2974 Fix index creation for hypertables with dropped columns
* timescale#2990 Fix segfault in job_config_check for cagg
* timescale#2987 Fix crash due to txns in emit_log_hook_callback
* timescale#3042 Commit end transaction for CREATE INDEX
* timescale#3053 Fix gapfill/hashagg planner interaction
* timescale#3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
k-rus added a commit to k-rus/timescaledb that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as trusted extension.

**Minor features**
* timescale#2998 Mark timescaledb as trusted extension

**Bugfixes**
* timescale#2948 Fix off by 4 error in histogram deserialize
* timescale#2974 Fix index creation for hypertables with dropped columns
* timescale#2990 Fix segfault in job_config_check for cagg
* timescale#2987 Fix crash due to txns in emit_log_hook_callback
* timescale#3042 Commit end transaction for CREATE INDEX
* timescale#3053 Fix gapfill/hashagg planner interaction
* timescale#3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
k-rus added a commit to k-rus/timescaledb that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as trusted extension.

**Minor features**
* timescale#2998 Mark timescaledb as trusted extension

**Bugfixes**
* timescale#2948 Fix off by 4 error in histogram deserialize
* timescale#2974 Fix index creation for hypertables with dropped columns
* timescale#2990 Fix segfault in job_config_check for cagg
* timescale#2987 Fix crash due to txns in emit_log_hook_callback
* timescale#3042 Commit end transaction for CREATE INDEX
* timescale#3053 Fix gapfill/hashagg planner interaction
* timescale#3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
@k-rus k-rus mentioned this pull request Mar 29, 2021
k-rus added a commit to k-rus/timescaledb that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as a trusted extension in PG13, so that
superuser privileges are not required anymore to install the extension.

**Minor features**
* timescale#2998 Mark timescaledb as trusted extension

**Bugfixes**
* timescale#2948 Fix off by 4 error in histogram deserialize
* timescale#2974 Fix index creation for hypertables with dropped columns
* timescale#2990 Fix segfault in job_config_check for cagg
* timescale#2987 Fix crash due to txns in emit_log_hook_callback
* timescale#3042 Commit end transaction for CREATE INDEX
* timescale#3053 Fix gapfill/hashagg planner interaction
* timescale#3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
k-rus added a commit that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as a trusted extension in PG13, so that
superuser privileges are not required anymore to install the extension.

**Minor features**
* #2998 Mark timescaledb as trusted extension

**Bugfixes**
* #2948 Fix off by 4 error in histogram deserialize
* #2974 Fix index creation for hypertables with dropped columns
* #2990 Fix segfault in job_config_check for cagg
* #2987 Fix crash due to txns in emit_log_hook_callback
* #3042 Commit end transaction for CREATE INDEX
* #3053 Fix gapfill/hashagg planner interaction
* #3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
k-rus added a commit to k-rus/timescaledb that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as a trusted extension in PG13, so that
superuser privileges are not required anymore to install the extension.

**Minor features**
* timescale#2998 Mark timescaledb as trusted extension

**Bugfixes**
* timescale#2948 Fix off by 4 error in histogram deserialize
* timescale#2974 Fix index creation for hypertables with dropped columns
* timescale#2990 Fix segfault in job_config_check for cagg
* timescale#2987 Fix crash due to txns in emit_log_hook_callback
* timescale#3042 Commit end transaction for CREATE INDEX
* timescale#3053 Fix gapfill/hashagg planner interaction
* timescale#3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
@k-rus k-rus mentioned this pull request Mar 29, 2021
k-rus added a commit that referenced this pull request Mar 29, 2021
This maintenance release contains bugfixes since the 2.1.0 release. We
deem it high priority for upgrading.

The bug fixes in this release address issues with CREATE INDEX and
UPSERT for hypertables, custom jobs, and gapfill queries.

This release marks TimescaleDB as a trusted extension in PG13, so that
superuser privileges are not required anymore to install the extension.

**Minor features**
* #2998 Mark timescaledb as trusted extension

**Bugfixes**
* #2948 Fix off by 4 error in histogram deserialize
* #2974 Fix index creation for hypertables with dropped columns
* #2990 Fix segfault in job_config_check for cagg
* #2987 Fix crash due to txns in emit_log_hook_callback
* #3042 Commit end transaction for CREATE INDEX
* #3053 Fix gapfill/hashagg planner interaction
* #3059 Fix UPSERT on hypertables with columns with defaults

**Thanks**
* @eloyekunle and @kitwestneat for reporting an issue with UPSERT
* @jocrau for reporting an issue with index creation
* @kev009 for fixing a compilation issue
* @majozv and @pehlert for reporting an issue with time_bucket_gapfill
@svenklemm svenklemm deleted the index_bug branch April 18, 2021 14:05
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.

Creating an index using transaction_per_chunk setting fails ifable contains an attribute that was dropped
4 participants