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

Ensure tlist is present in decompress chunk plan #5750

Merged
merged 1 commit into from Jun 6, 2023

Conversation

jnidzwetzki
Copy link
Member

In PostgreSQL < 15, CustomScan nodes are projection capable per default. The planner invokes create_plan_recurse with the flag CP_IGNORE_TLIST. So, the target list of a CustomScan node can be NIL. However, we rely on the target list to derive information for sorting.

This patch ensures that the target list is always populated before the sort functions are called.

Fixes: #5738

@jnidzwetzki jnidzwetzki changed the title Ensure tlist is populated before sortinfo is build Ensure tlist is present in decompress chunk path Jun 6, 2023
@jnidzwetzki jnidzwetzki changed the title Ensure tlist is present in decompress chunk path Ensure tlist is present in decompress chunk plan Jun 6, 2023
In PostgreSQL < 15, CustomScan nodes are projection capable. The planner
invokes create_plan_recurse with the flag CP_IGNORE_TLIST. So, the
target list of a CustomScan node can be NIL. However, we rely on the
target list to derive information for sorting.

This patch ensures that the target list is always populated before the
sort functions are called.

Fixes: timescale#5738
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #5750 (6152126) into main (ac70906) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5750      +/-   ##
==========================================
- Coverage   87.86%   87.83%   -0.03%     
==========================================
  Files         234      234              
  Lines       54987    54986       -1     
  Branches    12115    12117       +2     
==========================================
- Hits        48312    48297      -15     
- Misses       4827     4837      +10     
- Partials     1848     1852       +4     
Impacted Files Coverage Δ
tsl/src/nodes/decompress_chunk/planner.c 89.81% <100.00%> (+0.15%) ⬆️

... and 9 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jnidzwetzki jnidzwetzki marked this pull request as ready for review June 6, 2023 10:50
@jnidzwetzki jnidzwetzki merged commit f2eac72 into timescale:main Jun 6, 2023
42 of 43 checks passed
jnidzwetzki added a commit to jnidzwetzki/timescaledb that referenced this pull request Jun 27, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* timescale#5679 Teach loader to load OSM extension

**Bugfixes**
* timescale#5711 Scheduler accidentally getting killed when calling `delete_job`
* timescale#5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* timescale#5750 Ensure tlist is present in decompress chunk plan
* timescale#5754 Fixed handling of NULL values in bookend_sfunc
* timescale#5798 Fixed batch look ahead in compressed sorted merge
* timescale#5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* timescale#5807 Copy job config JSONB structure into current MemoryContext

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
@jnidzwetzki jnidzwetzki mentioned this pull request Jun 27, 2023
jnidzwetzki added a commit to jnidzwetzki/timescaledb that referenced this pull request Jun 27, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* timescale#5679 Teach loader to load OSM extension

**Bugfixes**
* timescale#5705 Scheduler accidentally getting killed when calling `delete_job`
* timescale#5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* timescale#5750 Ensure tlist is present in decompress chunk plan
* timescale#5754 Fixed handling of NULL values in bookend_sfunc
* timescale#5798 Fixed batch look ahead in compressed sorted merge
* timescale#5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* timescale#5807 Copy job config JSONB structure into current MemoryContext

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
jnidzwetzki added a commit to jnidzwetzki/timescaledb that referenced this pull request Jun 27, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* timescale#5679 Teach loader to load OSM extension

**Bugfixes**
* timescale#5705 Scheduler accidentally getting killed when calling `delete_job`
* timescale#5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* timescale#5750 Ensure tlist is present in decompress chunk plan
* timescale#5754 Fixed handling of NULL values in bookend_sfunc
* timescale#5798 Fixed batch look ahead in compressed sorted merge
* timescale#5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* timescale#5807 Copy job config JSONB structure into current MemoryContext

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
jnidzwetzki added a commit to jnidzwetzki/timescaledb that referenced this pull request Jun 28, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* timescale#5679 Teach loader to load OSM extension

**Bugfixes**
* timescale#5705 Scheduler accidentally getting killed when calling `delete_job`
* timescale#5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* timescale#5750 Ensure tlist is present in decompress chunk plan
* timescale#5754 Fixed handling of NULL values in bookend_sfunc
* timescale#5798 Fixed batch look ahead in compressed sorted merge
* timescale#5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* timescale#5807 Copy job config JSONB structure into current MemoryContext
* timescale#5824 Improve continuous aggregate query chunk exclusion

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
jnidzwetzki added a commit that referenced this pull request Jun 28, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* #5679 Teach loader to load OSM extension

**Bugfixes**
* #5705 Scheduler accidentally getting killed when calling `delete_job`
* #5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* #5750 Ensure tlist is present in decompress chunk plan
* #5754 Fixed handling of NULL values in bookend_sfunc
* #5798 Fixed batch look ahead in compressed sorted merge
* #5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* #5807 Copy job config JSONB structure into current MemoryContext
* #5824 Improve continuous aggregate query chunk exclusion

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
jnidzwetzki added a commit to jnidzwetzki/timescaledb that referenced this pull request Jun 28, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* timescale#5679 Teach loader to load OSM extension

**Bugfixes**
* timescale#5705 Scheduler accidentally getting killed when calling `delete_job`
* timescale#5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* timescale#5750 Ensure tlist is present in decompress chunk plan
* timescale#5754 Fixed handling of NULL values in bookend_sfunc
* timescale#5798 Fixed batch look ahead in compressed sorted merge
* timescale#5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* timescale#5807 Copy job config JSONB structure into current MemoryContext
* timescale#5824 Improve continuous aggregate query chunk exclusion

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
jnidzwetzki added a commit that referenced this pull request Jun 28, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* #5679 Teach loader to load OSM extension

**Bugfixes**
* #5705 Scheduler accidentally getting killed when calling `delete_job`
* #5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* #5750 Ensure tlist is present in decompress chunk plan
* #5754 Fixed handling of NULL values in bookend_sfunc
* #5798 Fixed batch look ahead in compressed sorted merge
* #5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* #5807 Copy job config JSONB structure into current MemoryContext
* #5824 Improve continuous aggregate query chunk exclusion

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
jnidzwetzki added a commit that referenced this pull request Jun 28, 2023
This release contains bug fixes since the 2.11.0 release. We recommend
that you upgrade at the next available opportunity.

**Features**
* #5679 Teach loader to load OSM extension

**Bugfixes**
* #5705 Scheduler accidentally getting killed when calling `delete_job`
* #5742 Fix Result node handling with ConstraintAwareAppend on
  compressed chunks
* #5750 Ensure tlist is present in decompress chunk plan
* #5754 Fixed handling of NULL values in bookend_sfunc
* #5798 Fixed batch look ahead in compressed sorted merge
* #5804 Mark cagg_watermark function as PARALLEL RESTRICTED
* #5807 Copy job config JSONB structure into current MemoryContext
* #5824 Improve continuous aggregate query chunk exclusion

**Thanks**
* @JamieD9 for reporting an issue with a wrong result ordering
* @xvaara for reporting an issue with Result node handling in
  ConstraintAwareAppend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Tiering policy : could not find pathkey item to sort when selecting compressed data
5 participants