-
Notifications
You must be signed in to change notification settings - Fork 162
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
MySQL TCP port argument is ignored #695
Comments
Hi @brian-pond , Thanks for opening the issue and the analyze it. However, I cannot reproduce your bug locally. Here is my test of having two mysql instances on both 3306 and 9999 port concurrently: You can see the two tables are different (one with an additional row), indicating that the results are fetching from different mysql instances. Can you double check your environment? Or is there anything that I missed? P.S. We do not parse the url by ourselves in connectorx. Instead, we call from_url provided by the mysql rust client. Another quick check is to try running the rust client directly in your environment and see whether it is still the case. Here is an example of the rust code, you may also need to setup rust beforehand. |
Weird! The results were so surprising that even after double-checking? I brought my spouse into my office, explained the whole thing, and walked them through each test and scenario, one at a time. Just to make sure I wasn't doing something stupid. I've been able to make it happen consistently. 😕 Tonight I'll follow your suggestion by installing the mysql rust client, and see what happens. Here are more details about my environment, though I'm doubtful this makes a big difference.
Host A is running the Python code. It has an SSH tunnel to Host B, so it "sees" Host B MariaDB over local TCP 9999. Here are the specific Python packages installed in the virtual environment.
|
I even download the connectorx repo, and performed a global search to see if TCP 3306 was hard-coded anywhere, perhaps as a fallback value. (it is not. only mentioned in markdown once, and a few times in GitHub Actions workflows) |
What language are you using?
Python 3.11.1
What version are you using?
connectorx 0.3.3
What database are you using?
MariaDB 10.11.6
What dataframe are you using?
Arrow
Can you describe your bug?
Environment Configuration
My host environment has 2 different MariaDB server instances. Each is bound to a different socket:
Instance A
: TCP port 3306Instance B
: TCP port 9999I have triple-checked and tested all credentials and tables. I did this using the standard
mysql
CLI tool that ships with the server software.Code
My goal is to query Instance B and create a dataframe from its table "foo"
I have the following Python code:
Scenario 1: Both servers online and active
Unexpectedly, my Python code fails with an error: 😕
This error should not happen. My database on TCP port 9999 definitely exists, and definitely has a table "foo".
After much testing and troubleshooting, I thought to try another scenario.
Scenario 2: What if I shutdown -only- Instance B?
I completely shut down my Instance B. Nothing is bound to TCP 9999 anymore. I verify that with mysql CLI tool.
I try my code again. The result is a different (but expected) error:
[2024-10-08T20:17:22Z ERROR r2d2] DriverError { Could not connect to address `127.0.0.1:9999': Connection refused (os error 111) }
This error ^ is a Good Thing. It's what I expected. My database instance is offline, so connectorx should definitely fail.
Scenario 3: What if I shutdown -only- Instance A?
I turn Instance B back on.
And on a hunch, I shutdown my Instance A. So now nothing is bound to TCP 3306 anymore.
This shouldn't make a difference. Because I'm not trying to connect to 3306. My URI clearly states 9999.
I try my code again. And it works perfectly. 👀 🤯
Conclusion
Based on the above, I have to conclude this is what's happening:
The text was updated successfully, but these errors were encountered: