Skip to content

Conversation

@Pengrongkun
Copy link
Contributor

Description

Issue(s)

  • Close/close/Fix/fix/Resolve/resolve: Issue Link

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Pengrongkun, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue where INSERT INTO STB SUBQUERY operations failed to correctly distribute data across multiple DNodes. The changes involve a significant refactoring of the data insertion pipeline to ensure that each data block is routed to the appropriate DNode based on its virtual group's endpoint configuration. This fix enhances the robustness and correctness of data ingestion in distributed environments.

Highlights

  • Cross-DNode Insertion Logic: Refactored the data submission mechanisms to explicitly route INSERT INTO STB SUBQUERY data blocks to their correct DNodes based on virtual group endpoint information, resolving issues with data distribution in multi-node environments.
  • Virtual Group Lookup Optimization: Implemented a sorted array for virtual group information lookup, improving the efficiency of determining the target DNode for specific table data during insertion.
  • New Test Case for Multi-Dnode Insert: Added a dedicated test case to validate INSERT INTO STB SUBQUERY functionality in a 2-DNode cluster setup, ensuring the fix works as expected in distributed scenarios.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an issue with INSERT INTO ... SELECT queries across different dnodes by ensuring that data is routed to the correct vgroup and endpoint. The changes in dataInserter.c are mostly sound, introducing new data structures to manage endpoint information and updating the data insertion logic accordingly. The accompanying test case in test_insert_select.py effectively validates this cross-dnode insertion scenario.

However, I've identified a critical memory management issue in dataInserter.c that could lead to a double-free and a potential crash. I've also provided a suggestion to improve the naming conventions in the test file for better clarity and adherence to standard practices.

Copilot AI review requested due to automatic review settings January 5, 2026 08:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue with inserting into super tables using subqueries when data spans multiple dnodes. The core fix adds proper endpoint set (epSet) tracking to ensure that submit requests are sent to the correct dnode for each vgroup.

  • Introduces new wrapper structures SSubmitTbDataSendInfo and SSubmitReqSendInfo to carry epSet information alongside submit data
  • Modifies vgroup lookup to retrieve full SVgroupInfo (including epSet) instead of just vgId
  • Adds vgArray to dbVgroup for efficient hash-based vgroup lookups

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/ci/cases.task Adds -N 2 parameter to run test with 2 dnodes
test/cases/06-DataIngestion/05-Others/test_insert_select.py Refactors test into separate methods and adds Test3 for cross-dnode insert scenario
source/libs/executor/src/dataInserter.c Core implementation: adds epSet tracking structures, implements vgArray for efficient lookups, updates hash storage to use new structures with epSet

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Pengrongkun Pengrongkun force-pushed the fix/3.3.6/6574866934 branch from e2d67fd to 6bfb6e2 Compare January 6, 2026 05:31
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.

3 participants