(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.
* 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>
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>
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>
* 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>