[openstack-dev] [all] Replace mysql-python with mysqlclient

Thomas Goirand zigo at debian.org
Mon May 4 22:48:37 UTC 2015



On 04/30/2015 07:48 PM, Mike Bayer wrote:
>
>
> On 4/30/15 11:00 AM, Victor Stinner wrote:
>> Hi,
>>
>> I propose to replace mysql-python with mysqlclient in OpenStack
>> applications to get Python 3 support, bug fixes and some new features
>> (support MariaDB's libmysqlclient.so, support microsecond in TIME
>> column).
>
> It is not feasible to use MySQLclient in Python 2 because it uses the
> same module name as Python-MySQL, and would wreak havoc with distro
> packaging and many other things.

I don't see what it would break. If I do:

Package: python-mysqlclient
Breaks: python-mysqldb
Replaces: python-mysqldb
Provides: python-mysqldb

everything is fine, and python-mysqlclient becomes another 
implementation of the same thing. Then I believe it'd be a good idea to 
simply remove python-mysqldb from Debian, since it's not maintained 
upstream anymore.

> It is also imprudent to switch
> production openstack applications to a driver that is new and untested
> (even though it is a port), nor is it necessary.

Supporting Python 3 is necessary, as we are going to remove Python 2 
from Debian from Buster.

> There should be no
> reason Openstack applications are hardcoded to one database driver.

If they share the same "import mysqldb", and if they are API compatible, 
how is this a problem?

> The
> approach should be simply that in Python 3, the mysqlclient library is
> installed instead of mysql-python.

So, in Python 3, we'd have some bugfixes, and not in Python 2? This 
seems a very weird approach to me, which *will* lead to lots of issues.

> MySQLclient installs under the same
> name, so in this case there isn't even any change to the SQLAlchemy URL
> required.

Nor there should be in anything else, if they are completely API compatible.

> PyMySQL is monkeypatchable, so as long as we are using eventlet, it is
> *insane* that we are using MySQL-Python at all, because it is actively
> making openstack applications perform much much more poorly than if we
> just removed eventlet.      So as long as eventlet is running, PyMySQL
> wins the performance argument hands down (as described at the link
> http://www.diamondtin.com/2014/sqlalchemy-gevent-mysql-python-drivers-comparison/
> which is in the third paragraph of that wiki page).  And it's Py3k
> compatible.

Ok, so you are for switching to pymysql. Good. But is this realistic? 
Are you going to provide yourself all the patches for absolutely all 
projects of OpenStack that is using python-mysqldb?

> 1. keep Mysql-python on Py2K, use mysqlclient on py3k, changing the
> implementation of the "MySQLdb" module on Py2K, server-wide, would be
> very disruptive

I'm sorry to say it this way, because I respect you a lot and you did a 
lot of very good things. But Mike, this is a very silly idea. We are 
already having difficulties to push support for Py3, and in some cases, 
it's hard to deal with the differences. Now, you want to add even more 
source of problems, with bugs specific to Py2 or Py3 implementation? Why 
should we make our life even more miserable? I completely fail to 
understand what we would try to achieve by doing this.

> 2. if we actually care about performance, we either A. dump eventlet or
> B. use pymysql.    All other performance arguments are moot right now as
> we are in the basement.

Eventlet has to die, we all know it. Not only for performances reason. 
But this is completely orthogonal to the discussion we're having about 
having Python 3 support. Please don't stand on the way to do it, just 
because we have other (unrelated) issues with Eventlet + MySQL.

Switching to mysqlclient is basically almost "free" (by that, I mean 
effortless), if I understand what Victor wrote. The same thing can't be 
said of removing Eventlet or switching to pymysql, even though if both 
may be needed. So why add the later as a blocker for the former?

Cheers,

Thomas Goirand (zigo)



More information about the OpenStack-dev mailing list