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

PG17 compatibility - Check if there are blocks left in columnar_scan_analyze_next_block #7738

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

naisila
Copy link
Member

@naisila naisila commented Nov 13, 2024

In PG17, the outer loop in acquire_sample_rows() changed
from
while (BlockSampler_HasMore(&bs))
to
while (table_scan_analyze_next_block(scan, stream))

Relevant PG commit:
041b96802efa33d2bc9456f2ad946976b92b5ae1
postgres/postgres@041b968

It is expected that the scan_analyze_next_block function will
check if there are any blocks left. So we add that check in
columnar_scan_analyze_next_block

Without this fix, we will have an indefinite loop causing timeout. Specifically, in our test schedules,
multi schedule stuck at drop_column_partitioned_table test
multi-mx schedule stuck at start_stop_metadata_sync test
columnar schedule stuck at columnar_create test

Note to reviewer: First three commits are for PG17 testing purposes. Only the last commit will be merged.

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-13.0@32a2a31). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff               @@
##             release-13.0    #7738   +/-   ##
===============================================
  Coverage                ?   89.63%           
===============================================
  Files                   ?      274           
  Lines                   ?    59583           
  Branches                ?     7436           
===============================================
  Hits                    ?    53409           
  Misses                  ?     4040           
  Partials                ?     2134           

In PG17, the outer loop in acquire_sample_rows() changed
from
while (BlockSampler_HasMore(&bs))
to
while (table_scan_analyze_next_block(scan, stream))

Relevant PG commit:
041b96802efa33d2bc9456f2ad946976b92b5ae1
postgres/postgres@041b968

It is expected that the scan_analyze_next_block function will
check if there are any blocks left. So we add that check in
columnar_scan_analyze_next_block

(cherry picked from commit 7eb0ad5)
(cherry picked from commit 196d0e7)
@naisila naisila merged commit 84b52fc into release-13.0 Nov 18, 2024
121 checks passed
@naisila naisila deleted the naisila/pg17_columnar_issue branch November 18, 2024 14:27
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.

2 participants