Problem/Motivation

Need to delete 30 million flags using "Remove Flaggings" in the Module Uninstall page. The delete is very slow and frequent out of memory errors are displayed.

Steps to reproduce

Create a large number of flags. Use "Remove Flaggings" in the Module Uninstall page to remove the flags

Proposed resolution

Each flag entity delete calls hook flag_entity_predelete and then it finds the related flag entity in the storage and deletes it. This step is unnecessary when a flagging entity is deleted. Add a condition to check before proceeding the find the related entities.

Remaining tasks

NIL

User interface changes

NIL

API changes

NIL

Data model changes

NIL

CommentFileSizeAuthor
improve_flag_entity_predelete.patch553 bytesarun.testing3

Issue fork flag-3332715

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

arun.testing3 created an issue. See original summary.

ivnish made their first commit to this issue’s fork.

ivnish’s picture

Status: Active » Needs review
ivnish’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
ivnish’s picture

Version: 8.x-4.x-dev » 5.x-dev
Category: Task » Feature request

deaom made their first commit to this issue’s fork.

deaom’s picture

Re-based, not sure what additional tests are needed here, so leaving status as is.

ivnish’s picture

Category: Feature request » Bug report
Issue tags: -Needs tests

ivnish’s picture

Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.