[Django] #27677: Disable savepoint support for MySQL NDB engine tables, and option to overwrite the default.

26 views
Skip to first unread message

Django

unread,
Jan 2, 2017, 2:41:48 PM1/2/17
to django-...@googlegroups.com
#27677: Disable savepoint support for MySQL NDB engine tables, and option to
overwrite the default.
-------------------------------------+-------------------------------------
Reporter: Alan | Owner: nobody
Justino da Silva |
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
Savepoint support for MySQL has introduced in ~2012. Right now there is
the NDBCLUSTER engine that does support transactions but does not support
savepoints. And returns error if tried.

(Related: #15507)

On Github PR https://github.com/django/django/pull/7779 is code that
disables savepoints for NDB/NDBCLUSTER but allows user to explicitly
enable/disable savepoints for this and other engines in the future if
needed.

Please provide feedback before effort be put in documentation on this new
feature.

--
Ticket URL: <https://code.djangoproject.com/ticket/27677>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 4, 2017, 3:35:03 PM1/4/17
to django-...@googlegroups.com
#27677: Disable savepoint support for MySQL NDB engine tables, and option to
overwrite the default.
-------------------------------------+-------------------------------------
Reporter: Alan Justino da | Owner: nobody
Silva |
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* cc: Adam Chainz (added)


Comment:

I'm unsure to what lengths Django should go to support alternate storage
engines. I'm not sure if it's possible to test NDB on our continuous
integration infrastructure, for example.

Adam, do you have any input?

--
Ticket URL: <https://code.djangoproject.com/ticket/27677#comment:1>

Django

unread,
Jan 4, 2017, 4:14:33 PM1/4/17
to django-...@googlegroups.com
#27677: Disable savepoint support for MySQL NDB engine tables, and option to
overwrite the default.
-------------------------------------+-------------------------------------
Reporter: Alan Justino da | Owner: nobody
Silva |
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam Chainz):

I'm unsure to what lengths Django should go to support alternate storage
engines

NDB isn't just a storage engine - you need to use a different version of
MySQL (from Oracle) to use it. Also NDB cluster is just one of many
clustering database options for MySQL, some others being:

* [https://www.percona.com/software/mysql-database/percona-xtradb-cluster
Percona XtraDB Cluster] (XtraDB = InnoDB, should be less different)
* [https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster/
MariaDB Galera Cluster] (Also uses XtraDB / InnoDB)

I'm afraid I don't have any experience with NDB, or any of the above. I
suspect there will be more issues rather than just the lack of savepoints;
e.g. the docs include a [https://dev.mysql.com/doc/refman/5.7/en/mysql-
cluster-ndb-innodb-engines.html table of differences between the NDB and
InnoDB storage engines] with many entries, and this isn't even where the
lack of savepoints is documented. Some suspicious entries I saw at a
glance: only READ-COMMITTED transaction isolation (pertinent to #27683)
and the difference in data types with 'large row support'.

I'd suggest for the time making and testing a third party database backend
that overrides `uses_savepoints` (etc.), rather than changing Django core
directly right now, since we can't test it, and it doesn't seem that
popular.

--
Ticket URL: <https://code.djangoproject.com/ticket/27677#comment:2>

Django

unread,
Jan 4, 2017, 4:19:12 PM1/4/17
to django-...@googlegroups.com
#27677: Disable savepoint support for MySQL NDB engine tables, and option to
overwrite the default.
-------------------------------------+-------------------------------------
Reporter: Alan Justino da | Owner: nobody
Silva |
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Alan Justino da Silva):

Replying to [comment:2 Adam Chainz]:


> I'm unsure to what lengths Django should go to support alternate
storage engines

I guess it is ok to just not disallow their use

> I'd suggest for the time making and testing a third party database
backend that overrides `uses_savepoints` (etc.), rather than changing
Django core directly right now, since we can't test it, and it doesn't
seem that popular.

Will it be better if the patch just allows the feature to be disabled,
with no explicit effort to detect the engine used? It would be enough for
now.

--
Ticket URL: <https://code.djangoproject.com/ticket/27677#comment:3>

Django

unread,
Jan 4, 2017, 5:16:52 PM1/4/17
to django-...@googlegroups.com
#27677: Disable savepoint support for MySQL NDB engine tables, and option to
overwrite the default.
-------------------------------------+-------------------------------------
Reporter: Alan Justino da | Owner: nobody
Silva |
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => wontfix


Comment:

As Adam suggested, you can disable savepoints without patching Django by
writing a [https://www.youtube.com/watch?v=OCq2eUmrCfI custom database
backend]. This has the benefit that you won't need to wait several months
until the next version of Django is released. If you find you need other
database backend hooks that Django doesn't provide, feel free to let us
know.

--
Ticket URL: <https://code.djangoproject.com/ticket/27677#comment:4>

Reply all
Reply to author
Forward
0 new messages