Changes between Version 1 and Version 2 of Ticket #30690, comment 1


Ignore:
Timestamp:
Aug 8, 2019, 4:28:09 PM (5 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30690, comment 1

    v1 v2  
    33[https://github.com/django/django/blob/5b57798513066bb6d5ea54225d0bd030a089c501/django/db/models/query.py#L545-L546 There's a comment in the method definition about it]  and following the `git blame` trace leads to [https://github.com/django/django/commit/4e9a74b81df1c7aaea2f90a3a4911920e134b275 this commit].
    44
     5> If in a single transaction, the master deletes a record and then get_or_creates a similar record, under the new behavior the get_or_create would find the record in the slave db and fail to re-create it, leaving the record nonexistent, which violates the contract of get_or_create that the record should always exist afterwards. We need to do everything against the master here in order to ensure correctness.
     6
    57Closing as duplicate of #16865.
Back to Top