Deletion of field_deleted_data_xxxxxx tables not working

Created on 17 December 2016, about 8 years ago
Updated 8 July 2024, 7 months ago

We are developing in a team environment with the main DEV site hosted on Pantheon. We (devs) all do everything on our local machines, and use the Configuration Synchronization to push to DEV, then the other devs pull those changes.

The biggest issue we've run into is when we create fields locally, and that change gets cascaded to DEV and other local environs - then subsequently delete a field. I can't pinpoint the exact circumstances, but we regularly get errors when pushing the config changes to DEV after deleting a field stating that the table for the field couldn't be renamed to the field_deleted_data_xxxxx{long-hash-string} because the table already exists. And, to be clear, we don't do any config changes on DEV directly, so that's not the reason for things getting out of sync.

The way I understand it, after deleting a field, there's a cron job that deletes the data contained therein (in relatively small batches to keep from hitting the php timeout), and when the field_deleted_data_xxxxxx table is empty, it is deleted (dropped) as well. That process is not working. This is currently a dev site, which means we rarely have more than 2 or 3 nodes for any given content type. After deleting a field, the data should be deleted during the first cron run. However, I've run it sometimes a dozen times or more, yet the field_deleted_data_xxxxx table(s) remain.

I've marked this critical because, when this situation happens (which it does all too frequently), fixing it is difficult and time-consuming.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
FieldΒ  β†’

Last updated about 21 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States ExTexan

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.

  • last update 11 months ago
    Patch Failed to Apply
  • First commit to issue fork.
  • πŸ‡§πŸ‡ͺBelgium gorkagr

    Hi!

    Somehow i had this issue in one of my localhost while running cron, the same error has appeared in my "recent log messages" page.

    Moved patch #44 to a MR

    Best

  • Pipeline finished with Success
    7 months ago
    Total: 580s
    #218735
  • πŸ‡¬πŸ‡§United Kingdom malcomio

    I've observed this in the following scenario:

    On a site running Drupal core 10.4.1, our local build process imports a sanitised database backup, which does not contain any field_deleted_data tables.

    After the import it runs the update hooks.
    One of our update hooks calls \Drupal::service('module_installer')->uninstall() to uninstall a custom module.

    That module's hook_uninstall implementation has an array of taxonomy vocabulary names, and deletes them in a loop:

    foreach ($taxonomy as $vid) {
      $vocabulary = Vocabulary::load($vid);
      $vocabulary?->delete();
    }
    

    The exception is thrown as part of this.

    The strange thing is that this doesn't seem to be happening on our test environments, which use MySQL 5.7.40-log, or on local development machines using Windows, where we also use MySQL 5.7.

    The problem only seems to be reproducible on my M1 Mac, where I'm using mysql 8.0.38.

    The difference is because there didn't seem to be an ARM compatible Docker image of 5.7 when I was setting up.

    But this may be a clue to what is triggering the problem - is it only reproducible on MySQL 8?

    The patch from #44 didn't seem to make any difference to my problem.

Production build 0.71.5 2024