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

Recent change of JDBC URL splitting delimiter from , to ; breaks connectivity to MSSQL #1458

Open
dimitri-furman opened this issue Sep 23, 2020 · 6 comments · May be fixed by #1677
Open

Recent change of JDBC URL splitting delimiter from , to ; breaks connectivity to MSSQL #1458

dimitri-furman opened this issue Sep 23, 2020 · 6 comments · May be fixed by #1677

Comments

@dimitri-furman
Copy link

#1233 discusses a change of URL splitting delimiter from , to ; to allow connections to multiple shards. A comment from @busbey mentions that semicolons aren't present in JDBC URLs. That is not correct for MSSQL JDBC driver, which uses semicolons to delimit connection string properties. Doc reference: https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url.

Thus, it is no longer possible to specify any connection properties in the URL, including a SQL Server database name to connect to. Only connections to the master database are possible, but master is a system database that should not be used for any user workload. This also makes it impossible to use YCSB against Azure SQL where specifying database name in the connection URL is mandatory.

Proposal: add support for quoting the db.url property. If quoted, any semicolon within the URL string will be treated as part of the string, not as a shard delimiter. Example of proposed syntax for two shards:

db.url="jdbc:sqlserver://server-name.database.windows.net:1433;databaseName=ycsb1";"jdbc:sqlserver://server-name.database.windows.net:1433;databaseName=ycsb2"

Currently, when URL is
db.url=jdbc:sqlserver://server-name.database.windows.net:1433;databaseName=ycsb

connection fails as follows:

YCSB Client 0.17.0

Loading workload...
Starting test.
Adding shard node URL: jdbc:sqlserver://server-name.database.windows.net:1433
Adding shard node URL: databaseName=ycsb
Error in database operation: java.sql.SQLException: No suitable driver found for databaseName=ycsb
site.ycsb.DBException: java.sql.SQLException: No suitable driver found for databaseName=ycsb

@busbey
Copy link
Collaborator

busbey commented Sep 24, 2020

that's unfortunate. We should step back and look at why we're splitting the passed string in the first place and see if there's a different approach we can take to avoid continuing to play whack-a-mole with JDBC URL contents.

@joshelser
Copy link
Contributor

This one also broke Apache Phoenix's JDBC (which has extensive semi-colon use). I like Dimitri's suggestion to use quoting to avoid the problematic parsing. I'll see if I can find some time to look at this.

@LucasZhu97
Copy link

As well as H2 database which supports JDBC and uses semicolons extensively.

@RudraNirvan
Copy link

@busbey any plan for fixing this?

@busbey
Copy link
Collaborator

busbey commented Apr 13, 2022

I don't think anyone has put together a PR. that would be the next step.

olavloite added a commit to olavloite/YCSB that referenced this issue May 10, 2023
Make the JDBC connection URL delimiter configurable. The current
delimiter is semicolon ';', which breaks JDBC drivers that use
semicolons in the actual connection URL. The default delimiter remains
semicolon for all databases, except a list of databases that are known
to use semicolons in the connection URL. Users can always specifiy a
custom delimiter to work around any issues with the default delimiter.

Fixes brianfrankcooper#1458
@olavloite
Copy link
Collaborator

@busbey I've added a PR for this here: #1677

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 a pull request may close this issue.

6 participants