Problem/Motivation
The database update password_policy_update_8302() fails for sites with a sufficiently large number of user accounts.
Steps to reproduce
Install this module in a site with a large number of users. I observed this problem in a site with about 70,000 users. You can use the devel_generate module in a test site to create user accounts; I'm not clear on the minimum number of accounts necessary to reproduce the problem.
When I ran database updates at the command line via drush updb, the server responded with out of memory errors. Increasing php memory limit available at the command line did not help.
Proposed resolution
Use a batch process for password_policy_update_8302().
Remaining tasks
Patch forthcoming.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | password_policy-use_batch_process_database_update-3236412-5.patch | 1.92 KB | dpolant |
| #4 | password_policy-use_batch_process_database_update-3236412-4.patch | 1.86 KB | cobadger |
Comments
Comment #2
cobadger commentedPatch attached.
Comment #3
cobadger commentedAttaching updated patch including necessary change from related issue Database update password_policy_update_8302 does not set field_pending_expire_sent.
Comment #4
cobadger commentedUpdated patch, as previous patch did not apply.
Comment #5
dpolant commentedI believe there is a problem with the completion calc logic in the previous patch - when I ran it, it did not finish. I've attached a modified version. Please test when you have time.
Thanks!
Comment #6
damienmckenna+1 on the changes in #5, it works around a (potentially rare) problem where $user->getAccountName() is empty and could result in the progress counter falling out of sync with the record count.
That said, I have not tested it.
Comment #7
paulocsJust tested it! The changes in #5 makes sense.
Thank you!
Comment #9
paulocsFixed the comment above on commit.