Improve performance in flag_entity_predelete

Created on 11 January 2023, almost 2 years ago
Updated 19 October 2024, 28 days ago

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

📌 Task
Status

Active

Version

4.0

Component

Flag core

Created by

🇮🇳India arun.testing3

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024