PG17 compatibility - Check if there are blocks left in columnar_scan_analyze_next_block #7738
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In PG17, the outer loop in
acquire_sample_rows()
changedfrom
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 willcheck 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 atdrop_column_partitioned_table
testmulti-mx
schedule stuck atstart_stop_metadata_sync
testcolumnar schedule
stuck atcolumnar_create
testNote to reviewer: First three commits are for PG17 testing purposes. Only the last commit will be merged.