1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #16865 -- Made get_or_create use read database for initial get query.

Thanks Rick van Hattem for the report and trbs for the patch.
This commit is contained in:
Carl Meyer
2012-09-19 10:06:53 -06:00
parent 44767f2caf
commit 901af86550
3 changed files with 34 additions and 1 deletions

View File

@@ -338,6 +338,15 @@ Miscellaneous
needs. The new default value is `0666` (octal) and the current umask value
is first masked out.
* In a multi-database situation, ``get_or_create()`` will now use a read
database for the initial ``get`` attempt (previously, it used only the write
database for all queries). This change reduces load on the write (master)
database, in exchange for slightly more frequent false-negatives on the
initial ``get`` due to replication lag. In those cases the subsequent insert
will still go to the master and fail, after which the existing object will be
fetched from the master.
Features deprecated in 1.5
==========================