Skip to content

Add missed NULL checks for XLogReaderAllocate#89

Merged
Stolb27 merged 1 commit intoadb-6.xfrom
ADBDEV-917
Jul 17, 2020
Merged

Add missed NULL checks for XLogReaderAllocate#89
Stolb27 merged 1 commit intoadb-6.xfrom
ADBDEV-917

Conversation

@darthunix
Copy link

XLogReaderAllocate returns NULL if the xlogreader couldn't be allocated. This NULL checks were forgotten in several places of twophase.c and caused segmentation faults under heavy workloads.

This problem affects only 6X_STABLE.
Current PR was cherry-picked from https://github.com/greenplum-db/gpdb/pull/10416

XLogReaderAllocate returns NULL if the xlogreader couldn't be
allocated. This NULL checks were forgotten in several places of
twophase.c and caused segmentation faults under heavy workloads.
@darthunix darthunix added the bug label Jul 3, 2020
@darthunix darthunix requested review from Stolb27 and leskin-in July 3, 2020 03:38
@Stolb27 Stolb27 merged commit 28cbd19 into adb-6.x Jul 17, 2020
@Stolb27 Stolb27 deleted the ADBDEV-917 branch July 17, 2020 06:59
RekGRpth pushed a commit that referenced this pull request Dec 3, 2025
…ables (#89)

The add_rte_to_flat_rtable function places a RangeTblEntry into the
glob->finalrtable table with a zeroed list of functions. The
ParallelizeCorrelatedSubPlanMutator function uses ctx->rtable, which is
populated by the root->glob->finalrtable function in the
ParallelizeCorrelatedSubPlan function. Therefore, in the
ParallelizeCorrelatedSubPlanMutator function, the rte->functions list is always
empty. Therefore, the old condition for checking whether functions are
correlated did not work. Now, in the ParallelizeCorrelatedSubPlanMutator
function, functions are available in the fscan->functions list, which is where
they are taken for correlation and location checking. Correlated non-any
functions are prohibited in subplans. For other combinations, we now add
broadcasting and materialization.

Another issue arose with correlated subplans with master-only or replicated
tables. The existing condition checked the scan locus only, without checking
the requested locus. As a result, the table scan was performed on segments,
which is unacceptable for the gp_segment_configuration master-only table. Now,
if the requested locus for such tables and the scan locus are not equal to the
entry, we again add broadcasting and materialization.

Co-authored-by: Georgy Shelkovy <g.shelkovy@arenadata.io>
Co-authored-by: Maxim Michkov <m.michkov@arenadata.io>

Ticket: ADBDEV-6884
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments