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

ADBDEV-3929 Fix deadlock by shared SegmentGeneral CTE & planning failure by sharing General CTE #640

Merged
merged 18 commits into from
Dec 11, 2023

Commits on Nov 21, 2023

  1. Fix deadlock by shared SegmentGeneral CTE

    Depending on the usage of the shared CTE with SegmentGeneral subplan, the
    number of segments the CTE are executed on may be single for joins with
    Singleton nodes, and multiple for hashed nodes. In the current implementation
    this may lead to deadlock if the CTE is used for both join targets: the Join
    with the Singleton node results in the Share Input Scan producer being executed
    on a single segment, while the Join with the Hashed node creates
    Share Input Scan reader on multiple segments, so the plan execution hangs.
    If we force execution of CTE on multiple segments as well, it will cause
    redundant motions in case of joining the CTE with another SegmentGeneral.
    At the moment of constructing and sharing the CTE we don't know the rest of the
    plan, so we can't predict the correct CTE locus. Because replicated tables are
    considered small, the most universal and optimal way to fix deadlock would be
    to inline CTE scans with SegmentGeneral locus.
    
    This patch fixes the deadlock by disabling sharing CTE if the subplan has
    SegmentGeneral locus.
    Vyacheslav Kompan committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    e5037d9 View commit details
    Browse the repository at this point in the history
  2. Change CTE Shared Scan tests

    Vyacheslav Kompan committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    66ae556 View commit details
    Browse the repository at this point in the history
  3. Reuse CTE subplan & rename shared_plan to subplan

    Vyacheslav Kompan committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    d5ff703 View commit details
    Browse the repository at this point in the history
  4. Fix potential memleak with singleton CTE subplan

    Vyacheslav Kompan committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    55c56c7 View commit details
    Browse the repository at this point in the history
  5. Remove alternative solution comment

    Vyacheslav Kompan committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    aeb7023 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2023

  1. Adjust comments on cte sharing

    Vyacheslav Kompan committed Nov 26, 2023
    Configuration menu
    Copy the full SHA
    a6653b3 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2023

  1. Fix comment in expected test output

    Vyacheslav Kompan committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    3b03d5e View commit details
    Browse the repository at this point in the history
  2. Update comment on CtePlanInfo

    Vyacheslav Kompan committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    db9c090 View commit details
    Browse the repository at this point in the history
  3. Remove test for joining 2 SegmentGenerals

    Vyacheslav Kompan committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    2439643 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2023

  1. Polish codestyle

    Vyacheslav Kompan committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    c018626 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. Merge branch 'adb-6.x-dev' into ADBDEV-3929

    Vyacheslav Kompan committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    040e40e View commit details
    Browse the repository at this point in the history
  2. Move code from ADBDEV-4321

    Vyacheslav Kompan committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    48e43bc View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2023

  1. Reorg tests

    Vyacheslav Kompan committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    10aa685 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2023

  1. upd comment

    Co-authored-by: Viktor Kurilko <[email protected]>
    trexxet2 and KnightMurloc authored Dec 6, 2023
    Configuration menu
    Copy the full SHA
    d14a3d4 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2023

  1. Configuration menu
    Copy the full SHA
    8437160 View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2023

  1. Invert condition

    Vyacheslav Kompan committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    d89f9da View commit details
    Browse the repository at this point in the history
  2. Invert condition 2

    Vyacheslav Kompan committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    37323e4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    921185c View commit details
    Browse the repository at this point in the history