Do not invalidate tags on entity log operation delete

Created on 20 September 2023, about 1 year ago
Updated 30 September 2023, about 1 year ago

Problem/Motivation

We log most of our entities using log_entity_operations_entity, to avoid a really big table, we limit the total entities using the cron provided by log_entity_operations_entity to clean it.

The problem is that when a content entity is deleted, the cache tags of the entity also are invalidated, and this adds more entries to the cachetag table.

mysql> select count(*) from cachetags where tag like '%entity_operation_log:%';
+----------+
| count(*) |
+----------+
|    51025 |
+----------+
1 row in set (0.28 sec)

PostDelete EntityBase.php:

  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    static::invalidateTagsOnDelete($storage->getEntityType(), $entities);
  }

Steps to reproduce

Remove an entity log operation entity from admin/config/development/log-entity-operations/logs
Check that on the table cachetags a new row is added entity_operation_log:[ID].

Proposed resolution

Override the postDelete method and leave it empty.

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

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

Comments & Activities

Production build 0.71.5 2024