Implement a ignore_min_gtid_annotation global variable, fix memory leak/overflow in min_gtid annotation handler.#5150
Conversation
Summary of ChangesHello @proton-lisandro-pin, 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 PR adds a new global variable Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new global variable ignore_min_gtid_annotation to control GTID-based routing, which is a useful feature for multi-layered ProxySQL setups. The implementation is mostly correct, adding the new variable across different parts of the codebase consistently.
However, I've found a critical buffer overflow vulnerability and a high-severity issue related to type safety in the modified code. Please address these issues to ensure the stability and security of the application.
|
Can one of the admins verify this patch? |
ignore_min_gtid_annotation global variable, fix memory leak/overflow in min_gtid_annotation handler.
ignore_min_gtid_annotation global variable, fix memory leak/overflow in min_gtid_annotation handler.ignore_min_gtid_annotation global variable, fix memory leak/overflow in min_gtid annotation handler.
|
@wazir-ahmed please review. |
|
Friendly ping? |
wazir-ahmed
left a comment
There was a problem hiding this comment.
@proton-lisandro-pin Thanks for the contribution. The changes look good to me. However I believe we should add a TAP test for this change. You can refer the existing TAP tests under test/tap/tests directory and add a similar test for this new configuration variable.
Generally, we aim to keep TAP tests simple and straightforward. The following steps outline one approach we could use to easily verify this patch.
1. Admin Session
- Update all
mysql_serverswithgtid_port=0 - Set
ignore_min_gtid_annotationsmysql variable totrue load mysql variable to runtime;load mysql servers to runtime
2. Proxy Session
- Run queries with the comment
/* min_gtid=<random_uuid> */ - Expected: Queries should execute successfully on one of the backend connections without failure.
Done, PTAL. As a side note, is the ProxySQL documentation on a public repository? I wanted to include an entry for |
41d8236 to
cdf7010
Compare
|
@proton-lisandro-pin I have rebased the commits with |
|
@proton-lisandro-pin Regarding documentation, the user docs available at proxysql.com/documentation is not open for external contributions at this moment. As per the release plan, we'll handle documenting this new configuration. |
When true, all `min_gtid` query annotations are ignored; see https://proxysql.com/documentation/query-annotations/ for details. This is useful on ProxySQL setups with multiple layers, where some layers mandate GTID-based routing while others don't.
Co-authored-by: Wazir Ahmed <wazir@proxysql.com>
cdf7010 to
c23930b
Compare
|
|
Add to whitelist |



When true, all
min_gtidquery annotations are ignored; see https://proxysql.com/documentation/query-annotations/ for details.This is useful on ProxySQL setups with multiple layers, where some layers mandate GTID-based routing
while others don't.
Also fixes a buffer overflow bug and memory leak in the
min_gtidannotation handler.