Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291720

Upgrade path: Clean up deleted revisions from {node_field_revision}

$
0
0

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

  • Write the patch
  • Write tests

User interface changes

None

API changes

None

Data model changes

None


Viewing all articles
Browse latest Browse all 291720

Trending Articles