Ticket #497 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Performance degrades when running two migrations in the same step

Reported by: egmanoj@… Owned by: andrew
Priority: major Milestone: 0.7.2
Component: commands Version: 0.7.1
Keywords: Cc: egmanoj@…

Description

My application has two migrations. The first one is an auto generated migration to add a column to a table. The second one is a custom data migration that updates the values of the newly added column. I'll call them migration 0007 and migration 0008 respectively.

When I run them separately using two commands, i.e.

python ./manage.py migrate app 0007
# done.
# followed by 
python ./manage.py migrate app 0008

it takes about ~20 seconds to complete both of them.

However when I run them in one go, i.e.

python ./manage.py migrate

it never completes. Migration 0007 completes and 0008 starts but the latter never completes.

top revealed that postgres was taking up >90% of the CPU when the second option was tried.

The table in question has a little less than 50,000 (fifty thousand) rows. I am running Postgresql 8.3, Django 1.2 and South 0.7.1 on an Ubuntu Jaunty machine.

Change History

comment:1 Changed 4 years ago by egmanoj@…

I have tried this a few times. *Sometimes* everything works fine. I suspect this a not a bug related to South.

comment:2 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone set to 0.7.2

This honestly sounds like a PostgreSQL issue to me - technically, since South runs each migration in its own transaction, there shouldn't be a difference between the two scenarios, but the connection being dropped and created again is probably doing it.

Until you can replicate this issue successfully, and can get me to do it to, I'll have to mark this as invalid...

Note: See TracTickets for help on using tickets.