-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Implement appendCallerID feature in vtgate executor #18635
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
base: main
Are you sure you want to change the base?
Conversation
- Added a new boolean flag `appendCallerID` to control the appending of CallerId username to queries. - Updated the `NewExecutor` function to accept the `appendCallerID` parameter. - Modified the `newExecute` method to conditionally append CallerId to the SQL query if the flag is enabled. Signed-off-by: Kyle Johnson <[email protected]>
- Introduced comprehensive tests for the addCallerIDUserToQuery function, covering various scenarios including valid caller IDs, edge cases, and consistency checks. - Ensured 100% test coverage by including cases for usernames with spaces, special characters, and empty SQL queries. Signed-off-by: Kyle Johnson <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
…ries Signed-off-by: Kyle Johnson <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18635 +/- ##
==========================================
- Coverage 67.50% 67.48% -0.02%
==========================================
Files 1607 1608 +1
Lines 263527 263535 +8
==========================================
- Hits 177890 177858 -32
- Misses 85637 85677 +40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Is there a way of nudging this forward please? Etsy are also very interested in this change. |
| // Append caller ID if enabled | ||
| if e.appendCallerID { | ||
| sql = addCallerIDUserToQuery(ctx, sql) | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can bloat the plan cache and more planner work for the prepared statement queries.
I would suggest we move this logic either in vttablet or add it directly as margin comments when we create the vcursol_impl object.
|
Have you looked at the vttablet flag |
My apologies on the delayed response, let me go investigate if this has equal parity with this PR... |
|
The advantage of this approach, IIUC, is that is not based on an honour system. We can't always guarantee the caller will have added Caller ID to the comments. More often than not, when we want to identify the caller, it is because of unexpected requests. This approach ensures we have the caller if there are rogue requests. Let me know if I've misunderstood anything though. |
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
Description
appendCallerIDto control the appending of CallerId username to queries.NewExecutorfunction to accept theappendCallerIDparameter.newExecutemethod to conditionally append CallerId to the SQL query if the flag is enabled.Related Issue(s)
Checklist
Deployment Notes