[Django] #35704: AddIndexConcurrently + RenameIndex incorrectly reduces to AddIndex

26 views
Skip to first unread message

Django

unread,
Aug 22, 2024, 2:23:09 PM8/22/24
to django-...@googlegroups.com
#35704: AddIndexConcurrently + RenameIndex incorrectly reduces to AddIndex
----------------------------------------+------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------------
A migration with `AddIndexConcurrently` and `RenameIndex` for the same
index will turn into an `AddIndex`. This means that, for example,
`optimizemigration` can change a migration to use extra locking, which may
be unsafe.

(Discovered after working on some other missing optimizations in #35700.)
--
Ticket URL: <https://code.djangoproject.com/ticket/35704>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 22, 2024, 9:33:50 PM8/22/24
to django-...@googlegroups.com
#35704: AddIndexConcurrently + RenameIndex incorrectly reduces to AddIndex
------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by Simon Charette):

* stage: Unreviewed => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/35704#comment:1>

Django

unread,
Aug 30, 2024, 2:57:49 PM8/30/24
to django-...@googlegroups.com
#35704: AddIndexConcurrently + RenameIndex incorrectly reduces to AddIndex
------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+----------------------------------------
Changes (by Sarah Boyce):

* has_patch: 0 => 1

Comment:

[https://github.com/django/django/pull/18510 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/35704#comment:2>

Django

unread,
Sep 3, 2024, 5:52:38 AM9/3/24
to django-...@googlegroups.com
#35704: AddIndexConcurrently + RenameIndex incorrectly reduces to AddIndex
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35704#comment:3>

Django

unread,
Sep 3, 2024, 6:51:15 AM9/3/24
to django-...@googlegroups.com
#35704: AddIndexConcurrently + RenameIndex incorrectly reduces to AddIndex
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Migrations | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"f5ddd54986172c29c32f5d835584ea237d5a3781" f5ddd54]:
{{{#!CommitTicketReference repository=""
revision="f5ddd54986172c29c32f5d835584ea237d5a3781"
Fixed #35704 -- Fixed reduction for AddIndex subclasses.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35704#comment:4>

Django

unread,
Feb 17, 2025, 2:02:14 AM2/17/25
to django-...@googlegroups.com
#35704: AddIndexConcurrently + RenameIndex incorrectly reduces to AddIndex
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Migrations | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"c07ba43c4bc94272c3d4a13c8f468b94db1e655c" c07ba43c]:
{{{#!CommitTicketReference repository=""
revision="c07ba43c4bc94272c3d4a13c8f468b94db1e655c"
Refs #35704 -- Used copy.replace() in Operation.reduce() methods.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35704#comment:5>
Reply all
Reply to author
Forward
0 new messages