- Notifications
You must be signed in to change notification settings - Fork 824
Closed
Labels
Description
Describe the bug
In 3.0.0 the oauth2_provider.0012_add_token_checksum migration was added to add a new column to the access token table. This migration upgrades the table by looping over AccessToken._default_manager.all() which causes the entire table to be loaded in memory.
This does not work for systems with limited memory and large access token tables because the migrate process will be killed by the OOM killer.
This could be fixed by using an iterator: AccessToken._default_manager.iterator()
To Reproduce
Run ./manage.py migrate on a system with a large access token table.
Expected behavior
A successful migration.
Version
3.0.1
- I have tested with the latest published release and it's still a problem.
- I have tested with the master branch and it's still a problem.