Skip to content
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

Upgrade sqlserver driver to version 12.8.1 #24686

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lukmanulhakkeem
Copy link
Contributor

@lukmanulhakkeem lukmanulhakkeem commented Mar 7, 2025

Description

NTLM authentication is not supported in the current driver. We will get below error if we specify NTLM in the connection URL
integratedSecurity=true;authenticationScheme=NTLM;

image

We need to upgrade the driver to get this support

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

SQL Server Connector Changes
* Upgrade sqlserver driver to version 12.8.1, to include NTLM authentication support. See :ref:`connector/sqlserver:authentication`.

@lukmanulhakkeem lukmanulhakkeem requested a review from a team as a code owner March 7, 2025 04:49
pom.xml Outdated
@@ -1385,7 +1385,7 @@
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
<version>8.2.1.jre8</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try to use the latest stable release 12.8.1.jre8?

We will have to upgrade it again to use the jre11+ dependency once the Java Upgrade PR is merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, actually i meant for 12.8.1. I will change it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imjalpreet when are we planning for the java upgrade?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We hope to be running mostly java 17 bytecode by end of H1/beginning of H2. For now, we will be on java 8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukmanulhakkeem can you please look into the CI failures?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZacBlanco So this driver needs to be updated with the java 17 upgrade right? How can we ensure that? Is there any parent ticket that track all the dependencies for the java 17 upgrade?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukmanulhakkeem lukmanulhakkeem force-pushed the sqlserver-driver-upgrade branch 2 times, most recently from 15c74ab to 22c1bbe Compare March 10, 2025 09:28
@lukmanulhakkeem lukmanulhakkeem changed the title Upgrade sqlserver driver to version 8.2.1 Upgrade sqlserver driver to version 12.8.1 Mar 10, 2025
@lukmanulhakkeem lukmanulhakkeem force-pushed the sqlserver-driver-upgrade branch 2 times, most recently from 442f6e1 to 19aa45e Compare March 12, 2025 04:58
@lukmanulhakkeem
Copy link
Contributor Author

@imjalpreet ci failures are fixed. could you review it again?

Copy link
Contributor

@pratyakshsharma pratyakshsharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the fix, looks good.

@steveburnett
Copy link
Contributor

Consider if we should add a mention in the SQL Server Connector doc that NTLM is supported. There isn't a mention in the doc of the current absence of NTLM as a limitation.

Copy link
Member

@imjalpreet imjalpreet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukmanulhakkeem Thanks for the fix, in addition to what Steve suggested can we also update the documentation to highlight that the default value of encrypt is true after the driver upgrade?

@lukmanulhakkeem
Copy link
Contributor Author

@steveburnett @imjalpreet I will update

@lukmanulhakkeem
Copy link
Contributor Author

@lukmanulhakkeem Thanks for the fix, in addition to what Steve suggested can we also update the documentation to highlight that the default value of encrypt is true after the driver upgrade?

This default value is already updated in the documentation by mistake. So I can update only the NTLM auth support

image

@lukmanulhakkeem
Copy link
Contributor Author

Microsoft supports multiple authentication mechanisms, including NTLM, and has provided documentation for each

image

https://learn.microsoft.com/en-us/sql/connect/jdbc/using-kerberos-integrated-authentication-to-connect-to-sql-server?view=sql-server-ver16

It would be difficult to include all of them in the Presto documentation. I don't think it’s ideal to document only NTLM authentication while leaving out other popular ones like Kerberos.

@imjalpreet @steveburnett Please suggest an approach here

@steveburnett
Copy link
Contributor

  1. If the current documentation describes the default value of encrypt as true, and that is how it will be after this PR is merged, then I think no doc change for this is needed.

  2. I agree that it would be awkward to mention only NTLM and not the other authentications, and that it is outside the scope of this PR to ask you to add documention for how to use all the other auth mechanisms that are supported.

    I am okay with not mentioning authentication in the documentation in the SQL Server page, but I would ask that you consider mentioning NTLM as the motivation for the upgrade in a release note. Maybe something like this:

SQL Server Connector Changes

* Upgrade sqlserver driver to version 12.8.1, to include NTLM authentication support. 

This way, NTLM is at least in the Presto documentation as a searchable term for people to find if they search for it, and in the context of the SQL Server connector.

  1. Maybe we could add a heading Authentication to the SQL Server page. In it list the authentication methods that we know to work. Something as short as this:

Authentication

The following authentication methods are supported:
* NTLM
* Kerberos
* (others)

If you feel comfortable with doing this third ask in this PR, please do. You don't have to be complete, just list the ones you know to work successfully. The doc can be iterated on and expanded later.

If you do not feel comfortable with doing this third ask in this PR, I can open a new issue about adding an Authentication topic to the SQL Server page and the issue can be addressed in a later PR. In that case I would welcome your input as a contributor and reviewer.

@lukmanulhakkeem
Copy link
Contributor Author

@steveburnett I added authentication properties in brief. Could you please review

@lukmanulhakkeem
Copy link
Contributor Author

Should I edit any files to add it to the release note?

steveburnett
steveburnett previously approved these changes Mar 13, 2025
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I think this is perfect.

I really appreciate you providing an example of a sample connection URL with the NTLM authentication.

Other authentication method examples can be added in future documentation PRs, and this new Authentication topic gives a place for that new doc to be added.

@steveburnett
Copy link
Contributor

Should I edit any files to add it to the release note?

I would suggest that you link to the new documentation from the release note. I tested this link (linking to a page is easy, linking to a heading within a page is a little trickier) and confirmed that it works in a local doc build.

== RELEASE NOTES ==

SQL Server Connector Changes
* Upgrade sqlserver driver to version 12.8.1, to include NTLM authentication support. See :ref:`connector/sqlserver:authentication`.

@lukmanulhakkeem lukmanulhakkeem force-pushed the sqlserver-driver-upgrade branch 2 times, most recently from b194ab3 to d971bd8 Compare March 14, 2025 04:25
@imjalpreet
Copy link
Member

This default value is already updated in the documentation by mistake.

@lukmanulhakkeem I believe we should add a note stating that the default value of encrypt changed from false to true starting in Presto 0.292. Some users may not explicitly set encrypt to false, assuming the default was still false, just as we didn’t set it to false in our Product Tests.

@lukmanulhakkeem
Copy link
Contributor Author

@imjalpreet Can i add the below note?

Starting from release 0.292, the default value of encrypt has changed from false to true.

@imjalpreet
Copy link
Member

@lukmanulhakkeem Yes, looks good. @steveburnett can also review it once added.

You can use a note similar to the one used in this overview section: https://prestodb.github.io/docs/0.291/connector/druid.html.

@lukmanulhakkeem
Copy link
Contributor Author

Updated the doc.

Copy link
Member

@imjalpreet imjalpreet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukmanulhakkeem just a small nit, otherwise LGTM, can you please squash your commits too? Thanks.

@@ -62,6 +62,46 @@ A connection string using a truststore would be similar to the following example

connection-url=jdbc:sqlserver://<host>:<port>;databaseName=<databaseName>;encrypt=true;trustServerCertificate=false;trustStoreType=PEM;hostNameInCertificate=hostname;trustStore=path/to/truststore.pem;trustStorePassword=password

.. note::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's move this to above the current documentation of the encrypt property.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above this line:

To disable encryption in the connection string, use the ``encrypt`` property:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Could you check this move of text? I'm not seeing it in the current branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukmanulhakkeem lukmanulhakkeem force-pushed the sqlserver-driver-upgrade branch from 7fb09c9 to 2354bc0 Compare March 14, 2025 06:23
@lukmanulhakkeem
Copy link
Contributor Author

Extra space added with the commit. I am fixing

@lukmanulhakkeem lukmanulhakkeem force-pushed the sqlserver-driver-upgrade branch from 2354bc0 to 797ebff Compare March 14, 2025 09:33
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (docs)

Pull updated branch, new local doc build, looks good.

@lukmanulhakkeem
Copy link
Contributor Author

Thanks @steveburnett

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants