On Fri, Sep 2, 2011 at 11:22 AM, Jeremy Dunck <jdu...@gmail.com> wrote:
> On Fri, Sep 2, 2011 at 11:04 AM, Ian Clelland <clell...@gmail.com> wrote: > > I'm seeing errors which I believe are due to a race condition in > > django.db.models.query.get_or_create, on a fairly high traffic site. Our > > production servers are running Django 1.2.5, but I don't see any changes > in > > the code in trunk that would affect this. (I'm totally willing to > construct > > a test case against trunk, but I'm posting this here in case it's already > a > > recognized bug, or an error on my part) > > If two requests make the same call to get_or_create(), at roughly the > same > > time, with a database server in REPEATABLE_READ isolation level, then I > > believe that it's possible for the following sequence of events to occur: > > I suspect you're using MySQL. Am I right? We just switched a mysql > site from repeatable read (the default) to read committed (postgres's > default, hence a better-tested path in django) for this very reason. > We are. 5.0.51a, I believe. READ COMMITTED would definitely solve this -- that seems to be the main point behind #13906, but there seems to be some resistance there. Have you encountered any other issues from making that switch? Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.