-
Notifications
You must be signed in to change notification settings - Fork 148
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
Change strategy to test connectivity between ODBC driver and SQL plugin #69
Conversation
…-project#26 # Conflicts: # sql-odbc/src/sqlodbc/opensearch_communication.cpp
…-project#26 # Conflicts: # sql-odbc/src/sqlodbc/opensearch_communication.cpp
|
||
if(!IsSQLPluginEnabled(error_details)) { | ||
m_error_message += | ||
"The SQL plugin is disabled. The SQL plugin must be " |
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.
could we add the doc link to guide customer how to enable SQL plugin.
} | ||
|
||
if (response->HasClientError()) { | ||
m_error_message += " Client error: '" |
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.
What is the action item if the customer receive "Client error" or "Response error". Could we reduce all the error into same pattern. e.g. "Error: detailReason"
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.
I think the detailed error messages are only for log debug purpose, it will not be sent to the users. Yes we can merge them together.
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.
Thanks for the change!
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.
Thanks for the changes!
Description
Currently before establishes the connection between the ODBC driver and the OpenSearch server, the client tries to check the installed plugins in the current OpenSearch cluster by calling the
_cat/plugins
API. In this way, the connection will not be established if it does not detect the plugin with exactly the same name that was hard coded in the code base. It might cause compatibility issue once the SQL plugin is renamed, and it does not follow the common strategy to test the odbc connectivity as well.Thus we changed the strategy in this PR to let it send a simple
select 1
query to the server to check the sql plugin availability instead.Case 1: SQL plugin is not installed

Behavior: connectivity test fails
Case 2: SQL plugin is installed but disabled

Behavior: connectivity test fails
Case 3: SQL plugin is installed and enabled, but somehow unhealthy (query execution failed)
Behavior: connectivity test fails
Similar error windows pop up with message: Connection error: [OpenSearch][SQL ODBC Driver][SQL Plugin] Connection error: SQL plugin is disabled, please enable the plugin to use this driver.
Case 4: SQL plugin is installed, enabled and in healthy status

Behavior: connectivity test passes
Issues Resolved
#57
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.