#16865: get_or_create defaults to _for_write even when it's just reading
-------------------------------------+-------------------------------------
     Reporter:  Rick van Hattem      |                    Owner:  nobody
  <Rick.van.Hattem@…>                |                   Status:  new
         Type:  Bug                  |                  Version:  1.3
    Component:  Database layer       |               Resolution:
  (models, ORM)                      |             Triage Stage:  Accepted
     Severity:  Normal               |      Needs documentation:  0
     Keywords:                       |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  1                    |
-------------------------------------+-------------------------------------

Comment (by russellm):

 @carljm has correctly hit the reason this was done -- get_or_create needs
 to get a reliable answer as to whether the object exists, and due to the
 potential for replication lag, the most reliable answer comes from the
 write source, not the read source.

 That said, I can certainly see the value in moving the *initial* read load
 off the maste, and from the looks of it, @kmtracey's analysis is correct
 -- as long as the fallback read is performed on the master, we should get
 the benefits of a distributed initial read, while retaining a reliable
 write.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16865#comment:6>
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.

Reply via email to