Add upgrade path to clean up deleted revisions from node_field_revision

Created on 13 April 2017, over 7 years ago
Updated 15 October 2023, about 1 year ago

Problem/Motivation

This is a follow-up for: #2753971: ContentEntityStorageBase::deleteRevision() function does not remove node_field_revision entries β†’ . Some sites could have revision data in the {node_field_revision} table that was not deleted because of #2753971.

In other words: revisions that have been deleted, have actually been deleted from {node_revision}, but not from {node_field_revision}. (Or, generally speaking: {ENTITY_TYPE_ID_revision} and {ENTITY_TYPE_ID_field_revision}.)

#2753971 was fixed in Drupal 8.3.2 (see https://www.drupal.org/project/drupal/releases/8.3.2 β†’ ), and so any site that had lots of revisions deleted before it updated to 8.3.2, will have lots of stale entries in {ENTITY_TYPE_ID_field_revision, which this upgrade path will clean up.

Proposed resolution

  • Write an upgrade path that delete revisions from {node_field_revision} that don't actually match with any of the revisions in {node_revision}.
  • Make this upgrade path use the Batch API to avoid possible performance issues on sites with heavy use of revisions (and hence potentially many stale records in {node_field_revision} that need to be deleted).

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

11.0 πŸ”₯

Component
EntityΒ  β†’

Last updated about 22 hours ago

Created by

πŸ‡¦πŸ‡·Argentina dagmar Argentina

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

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