#13906: REPEATABLE READ (as used by default on MySQL) breaks atleast
QuerySet.get_or_create().
-------------------------------------+-------------------------------------
Reporter: | Owner: graham_king
sebastian_noack | Status: assigned
Type: | Component: Database layer
Cleanup/optimization | (models, ORM)
Milestone: | Severity: Normal
Version: SVN | Keywords: mysql transaction
Resolution: | isolation
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by TomaszZielinski):
* cc: tomasz.zielinski@… (added)
Comment:
There are already tickets on this, one is here:
http://code.djangoproject.com/ticket/6641
along with a discussion: https://groups.google.com/forum/#!topic/django-
developers/U4eiCVhEOxU
My opinion is that switching to READ COMMITED level might be hazardous
because it's less tested:
http://www.mysqlperformanceblog.com/2010/02/11/read-commited-vs-repetable-
read-in-tpcc-like-load/
"However, however.
For 10w run I got 60 Deadlock errors “1213, Deadlock found when trying to
get lock; try restarting transaction” in READ-COMMITED mode, and 0
Deadlocks in REPEATABLE-READ mode."
and from the first comment below the article:
"For some time we have used Read-Committed and has encountered alot of
weird bugs with this isolation level, it seems
that everytime the mysql team made a new feature, it wasnt tested as well
with read-committed isolation level as the commonly used repeatable-read."
Therefore, my personal view is that we should fix `get_or_create()`, and
supplement Django docs with some information about MySQL defaul isolation
level and the consequences of using it.
--
Ticket URL: <http://code.djangoproject.com/ticket/13906#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.