[Django] #28901: Read committed isolation level does not work with InnoDB

32 views
Skip to first unread message

Django

unread,
Dec 6, 2017, 10:31:37 AM12/6/17
to django-...@googlegroups.com
#28901: Read committed isolation level does not work with InnoDB
-----------------------------------------+------------------------
Reporter: djc | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
After upgrading my application to Django 2.0, I have been seeing errors:
"Cannot execute statement: impossible to write to binary log since
BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine
limited to row-based logging. InnoDB is limited to row-logging when
transaction isolation level is READ COMMITTED or READ UNCOMMITTED."

The 2.0 release notes at
https://docs.djangoproject.com/en/2.0/releases/2.0/#default-mysql-
isolation-level-is-read-committed don't mention anything about this
particular problem. Since, as far as I can tell, InnoDB and BINLOG_FORMAT
= STATEMENT are the default values, it would be useful if the
documentation could warn about this problem.

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

Django

unread,
Dec 6, 2017, 10:36:11 AM12/6/17
to django-...@googlegroups.com
#28901: Document considerations with read committed isolation level and InnoDB
-------------------------------------+-------------------------------------
Reporter: Dirkjan Ochtman | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 2.0
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* cc: Adam (Chainz) Johnson (added)
* type: Uncategorized => Cleanup/optimization


Comment:

Would you like to draft something?

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

Django

unread,
Dec 6, 2017, 10:47:56 AM12/6/17
to django-...@googlegroups.com
#28901: Document considerations with read committed isolation level and InnoDB
-------------------------------------+-------------------------------------
Reporter: Dirkjan Ochtman | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 2.0
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Dirkjan Ochtman):

I wouldn't mind typing up the above in a way that is feasible for the
documentation -- however, it would sure be nice if someone with deeper
knowledge of Django and MySQL reviews that what I'm saying is correct and
makes sense, and simply reverting the isolation level is the best solution
here. It sure doesn't feel like the right solution -- but I couldn't
figure out so far what the best alternative is.

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

Django

unread,
Dec 27, 2017, 1:36:26 PM12/27/17
to django-...@googlegroups.com
#28901: Document considerations with read committed isolation level and InnoDB
-------------------------------------+-------------------------------------
Reporter: Dirkjan Ochtman | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 2.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe

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

* stage: Unreviewed => Someday/Maybe


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

Django

unread,
Jul 18, 2018, 6:16:33 AM7/18/18
to django-...@googlegroups.com
#28901: Document considerations with read committed isolation level and InnoDB
-------------------------------------+-------------------------------------
Reporter: Dirkjan Ochtman | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 2.0

Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Nir Izraeli):

Hi, I encountered a related issue and opened (and later answered) a
stackoverflow question I think may be useful for others stumbling upon
this ticket, so I'm linking it here:
https://stackoverflow.com/a/51399292/1146713

The gist of it is I was using an old MariaDB version (10.0) which
defaulted to {{{BINLOG_FORMAT = STATEMENT}}} instead of the more flexible
{{{BINLOG_FORMAT = MIXED}}} that is the default since version 10.2.4.

Django may want to add that as part of the default-override, to avoid this
problem when working with older versions of MariaDB, or include as part of
the documentation section about changing the default transaction isolation
level. I have no opinion on the matter but I'm up to contribute a change
once it's decided.

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

Django

unread,
Jul 26, 2018, 7:18:20 PM7/26/18
to django-...@googlegroups.com
#28901: Document considerations with read committed isolation level and InnoDB
-------------------------------------+-------------------------------------
Reporter: Dirkjan Ochtman | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 2.0

Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam (Chainz) Johnson):

Django can't override binlog_format since it is set on the server level
only, which requires either super privilege (django apps shouldn't have
this) or editing the config file. Also it has a huge number of
considerations, see https://mariadb.com/kb/en/library/binary-log-formats/
.

--
Ticket URL: <https://code.djangoproject.com/ticket/28901#comment:5>

Reply all
Reply to author
Forward
0 new messages