-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add resultsObserver to ScatterConn #16638
Conversation
Updates ScatterConn's ExecuteMultiShard and StreamExecuteMulti methods to accept a results observer parameter. These methods call resultsObserver#observe with every sqltypes.Result object returned from the underlying shards. This makes it straightforward to add instrumentation that needs access to the individual results actually returned from the shards, not just the Result object returned to the client which may or may not include data from all the shards This PR adds the resultObserver, but it is set to a nullResultsObserver so it is effectively a no-op. Having this extensibility will make it much easier for downstream forks to add instrumentation as needed. Signed-off-by: Rafer Hazen <rafer@ralua.com>
Signed-off-by: Rafer Hazen <rafer@ralua.com>
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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16638 +/- ##
==========================================
+ Coverage 68.98% 69.00% +0.02%
==========================================
Files 1562 1564 +2
Lines 200697 202029 +1332
==========================================
+ Hits 138446 139411 +965
- Misses 62251 62618 +367 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Rafer Hazen <rafer@ralua.com>
Signed-off-by: Rafer Hazen <rafer@ralua.com>
Signed-off-by: Rafer Hazen <rafer@ralua.com>
…ter-conn-results Signed-off-by: Rafer Hazen <rafer@ralua.com>
…ter-conn-results Signed-off-by: Rafer Hazen <rafer@ralua.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
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.
Looks good to me too!
Signed-off-by: Rafer Hazen <rafer@ralua.com>
if innerqr != nil { | ||
resultsObserver.observe(innerqr) | ||
} | ||
|
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.
Here it is given that innerqr will not be nil.
Just below, we append the result to the output result set as-sis without checking.
resultsObserver interface { | ||
observe(*sqltypes.Result) | ||
} |
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.
should this method not take in the shard information to track where this result set comes from?
Description
Updates
ScatterConn
'sExecuteMultiShard
andStreamExecuteMulti
methods to accept a results observer parameter. These methods callresultsObserver#observe
with everysqltypes.Result
returned from the underlying shards. This makes it straightforward to add instrumentation that needs access to the individual results actually returned from the shards, not just the Result object returned to the client which may or may not include data from all the shard resultsThis PR adds the
resultObserver
, but it is set to a nullResultsObserver so it is effectively a no-op. Having this extensibility will make it much for downstream forks to add instrumentation as needed.Related Issue(s)
closes #16481
Checklist
Deployment Notes
None