soynatan / django-easy-audit

Yet another Django audit log app, hopefully the simplest one.
GNU General Public License v3.0
735 stars 182 forks source link

Upgrading from 1.3.6 to 1.3.7, migration failed for large CRUDEvent table #315

Open jlogan-app opened 2 weeks ago

jlogan-app commented 2 weeks ago

Python: 3.10.12 Django: 4.2.16

Migrations fail when trying to upgrade from 1.3.6 to 1.3.7. 0018_rename_crudevent_object_id_content_type_index appears to run successfully but 0019_alter_crudevent_changed_fields_and_more fails with

django.db.utils.OperationalError: (8175, 'Your query has been cancelled due to exceeding the allowed memory limit for a single SQL query. Please try narrowing your query scope or increase the tidb_mem_quota_query limit and try again.[conn=1367627318]')

The migrations worked in our Integration environment where the CRUDEvent table has approx 0.5 million records but fails for our Staging environment where the table has 3.5 million records (Production has 6.2 million records).

Database is TiDB. Increasing the memory limit isn't an option at this time, do you have any other suggestions as to how we could avoid this issue and upgrade successfully?

jheld commented 1 day ago

If this was a data migration I think we'd have more control with how to do iteration. Currently at a loss and I'm sorry this isn't helpful. Keep in touch as necessary and if we come across a solution, huzzah!