#29134: RelatedObjectDoesNotExist & Duplicate Key Exception Occurring Sporadically -------------------------------------+------------------------------------- Reporter: Jason | Owner: nobody Type: | Status: new Uncategorized | Component: Database | Version: 1.8 layer (models, ORM) | Keywords: orm, database, Severity: Normal | RelatedObjectDoesNotExist, Triage Stage: | IntegrityError, duplicate key Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- We are using multi-table inheritance and **occasionally** we'll get a ''RelatedObjectDoesNotExist'' or a ''IntegrityError: duplicate key value violates unique constraint''.
- Our site is active, and we successfully generate at least 10,000 new related objects per day with no issues. - Our primary keys are auto-value ints that are up to approximately 200 million. - We previously saw these errors once every 100 days, but lately we're seeing it twice a week, and our code hasnt changed much in the last few months; no new apis, model changes, etc. - Our multi-table inheritance is only one-level (our model has a parent object, and about 8 inherited objects), where we perform many adds and deletes. Nowhere in our codebase do we create or delete parent objects - we always work on the inherited objects. - Other objects that do not use multi-table inheritance have never had an issue with duplicate keys. - We use django 1.8, PostgreSQL 9.5.10, Ubuntu 16.04; the db & webserver run on the same machine with 12 cores, 48gb of memory Is there an existing bug we are unaware of? Why would we get duplicate keys and RelatedObjectDoesNotExist only occasionally? -- Ticket URL: <https://code.djangoproject.com/ticket/29134> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/051.738be79c842cb51921f6726048e540af%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.