Thanks to visit codestin.com
Credit goes to github.com

Skip to content

merge: from 3.3.8 to main#34633

Open
guanshengliang wants to merge 6 commits intomainfrom
merge/3.3.8tomain
Open

merge: from 3.3.8 to main#34633
guanshengliang wants to merge 6 commits intomainfrom
merge/3.3.8tomain

Conversation

@guanshengliang
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, 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 integrates changes from the 3.3.8 branch into main, primarily focusing on improving the robustness and error handling within the TMQ (Time-series Message Queue) client and vnode components. Key updates include enhanced WAL version tracking, better management of push handles, and refined WAL read logic. Additionally, it strengthens the testing framework by adding a new system test for TMQ with alter tags and improving an existing vnode transformation test.

Highlights

  • TMQ Client WAL Version Tracking: Enhanced the TMQ client's ability to track Write-Ahead Log (WAL) versions by adding walVerBegin and walVerEnd fields to the SVgroupSaveInfo structure and populating them during topic initialization and list building.
  • Vnode Split Error Handling: Improved error handling in the TMQ client to specifically address TSDB_CODE_SYN_NOT_LEADER errors, which will trigger an endpoint refresh during vnode split scenarios, ensuring better resilience.
  • TMQ Push Handle Management: Refined the registration process for TMQ push handles by explicitly removing the previous handle from the manager before adding a new one, and improved logging for hash operations.
  • WAL Read Logic Refinement: Adjusted the WAL log fetching logic by removing an unnecessary early exit condition and standardizing the error return code to TSDB_CODE_WAL_LOG_NOT_EXIST when a log entry is not found.
  • TMQ Vnode Transformation Test Enhancement: Updated an existing test case for TMQ vnode transformation to increase the pollDelay and correct the expected consumed row count, improving the test's reliability and accuracy.
  • New TMQ Alter Tag System Test: Introduced a new system test file (tmq_handler.py) to validate TMQ functionality with alter tags, including batch and continuous data insertion, and consumer verification.

🧠 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.

Changelog
  • source/client/src/clientTmq.c
    • Added walVerBegin and walVerEnd fields to SVgroupSaveInfo struct.
    • Populated walVerBegin and walVerEnd in initClientTopicFromRsp.
    • Included walVerBegin and walVerEnd when initializing SVgroupSaveInfo in buildNewTopicList.
    • Extended processMqRspError to handle TSDB_CODE_SYN_NOT_LEADER for vnode split scenarios.
  • source/dnode/vnode/src/tq/tqPush.c
    • Explicitly removed the last handle from pPushMgr before adding a new one in tqRegisterPushHandle.
    • Improved logging of hash operation return values using tstrerror(ret).
  • source/libs/wal/src/walRead.c
    • Removed the if (fetchVer > appliedVer) check to prevent premature exits.
    • Changed the error return code from TSDB_CODE_FAILED to TSDB_CODE_WAL_LOG_NOT_EXIST in walNextValidMsg.
  • test/cases/17-DataSubscription/02-Consume/test_tmq_error.py
    • Modified whitespace without functional changes.
  • test/cases/17-DataSubscription/02-Consume/test_tmq_vnode_transform_stb.py
    • Increased pollDelay from 60 to 6000 to accommodate vnode transformation time.
    • Corrected the expected consumed row count from expectrowcnt / 2 to expectrowcnt.
  • tests/system-test/7-tmq/tmq_handler.py
    • Added a new test file tmq_handler.py for TMQ alter tag functionality.
    • Implemented insertDataBatch using taosBenchmark for initial data loading.
    • Included insertData for continuous data insertion into child tables.
    • Provided consume method to subscribe to a topic and process messages.
    • Added countTableNum to wait for all child tables to be created.
Activity
  • The pull request was created by guanshengliang with the title 'merge: from 3.3.8 to main'.
  • The description includes standard sections for 'Description', 'Issue(s)', and 'Checklist', with the checklist items currently unchecked.
  • No specific comments or reviews have been provided in the context.
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 appears to be a merge from a release branch to main, incorporating several fixes and enhancements. Key changes include adding WAL versioning support and improving error handling in clientTmq.c, fixing a potential stale handle issue in tqPush.c, and refactoring WAL reading logic in walRead.c. Additionally, several test files have been updated for correctness and stability. A new test file, tests/system-test/7-tmq/tmq_handler.py, has been added, but it contains a critical bug in its consume method that prevents correct row counting.

Comment on lines +118 to +119
print(block.fetchall(),len(block.fetchall()))
cnt += len(block.fetchall())
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The block.fetchall() method consumes the result iterator. Calling it multiple times on the same block will result in empty lists on subsequent calls. This leads to incorrect counting of rows because len(block.fetchall()) on an already consumed block will be 0. You should call fetchall() once per block and store the result in a variable for reuse.

Suggested change
print(block.fetchall(),len(block.fetchall()))
cnt += len(block.fetchall())
rows = block.fetchall()
print(rows, len(rows))
cnt += len(rows)

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