-
Notifications
You must be signed in to change notification settings - Fork 141
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
Validate session with flint datasource passed in async job request #2448
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2448 +/- ##
=========================================
Coverage 95.40% 95.40%
- Complexity 4992 5000 +8
=========================================
Files 478 479 +1
Lines 13917 13939 +22
Branches 933 937 +4
=========================================
+ Hits 13277 13299 +22
Misses 618 618
Partials 22 22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Currently, if there's a session running with Datasource1 and the user makes a request to the async API with the same session but a different catalog Datasource2 then SQL plugin doesn't return a new session for Datasource2. This PR creates a new session when there’s a mismatch between datasource and session_id. Testing done: 1. manual testing 2. added IT. Signed-off-by: Kaituo Li <kaituo@amazon.com>
* @return An Optional containing the session associated with the provided session ID. If no | ||
* session is found that matches the session ID, an empty Optional is returned. | ||
*/ | ||
public Optional<Session> getSession(SessionId sid) { |
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.
it is only for testing?
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.
if yes, add an annotation.
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.
It is used by other src code. Not only for testing.
Signed-off-by: Kaituo Li <kaituo@amazon.com>
please update settings doc. https://github.com/opensearch-project/sql/blob/main/docs/user/admin/settings.rst |
updated |
…2448) * Validate session with flint datasource passed in async job request Currently, if there's a session running with Datasource1 and the user makes a request to the async API with the same session but a different catalog Datasource2 then SQL plugin doesn't return a new session for Datasource2. This PR creates a new session when there’s a mismatch between datasource and session_id. Testing done: 1. manual testing 2. added IT. Signed-off-by: Kaituo Li <kaituo@amazon.com> * address comments Signed-off-by: Kaituo Li <kaituo@amazon.com> * add doc Signed-off-by: Kaituo Li <kaituo@amazon.com> --------- Signed-off-by: Kaituo Li <kaituo@amazon.com> (cherry picked from commit 0176525) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…2448) (#2450) * Validate session with flint datasource passed in async job request Currently, if there's a session running with Datasource1 and the user makes a request to the async API with the same session but a different catalog Datasource2 then SQL plugin doesn't return a new session for Datasource2. This PR creates a new session when there’s a mismatch between datasource and session_id. Testing done: 1. manual testing 2. added IT. * address comments * add doc --------- (cherry picked from commit 0176525) Signed-off-by: Kaituo Li <kaituo@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Currently, if there's a session running with Datasource1 and the user makes a request to the async API with the same session but a different catalog Datasource2 then SQL plugin doesn't return a new session for Datasource2. This PR creates a new session when there’s a mismatch between datasource and session_id.
Testing done:
Issues Resolved
#2432
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.