- πΊπΈUnited States dww
Moving to the right component and tagging to be smashed. Haven't tried to reproduce this or confirm if it's a valid bug.
We maintain an internal Drupal distribution. After releasing a new version of our distribution, we tried to upgrade/update a site that was running the older version of our distribution to the new one. During this upgrade, we ran schema updates through drush updatedb
and encountered some bad data in our installation, so only the first 80% of our update hooks executed successfully before Drush bailed out on the failing update.
After correcting the offending record in the database and then running drush updatedb
a second time, we found that only the update that failed was re-run. But, strangely, the site behaved as if the earlier update hooks had not run. Specifically, one of the hooks that had run successfully enabled a new module dependency (e.g. module A now depends on contrib module B, so the update hook enabled contrib module B), but we found that the dependency wasn't enabled on the site despite the hook having been run and Drupal reporting that module A had a schema version equal to the highest update hook in the install file.
It appears that Drupal ran the hooks, then rolled back the DB transaction/changes when the update at the end of the chain failed, but it still recorded the schema version changes in the database for the updates that ran successfully before the rollback.
I'm not able to pinpoint exact repro steps because I could not get this failure to happen in the same sequence each time. But, the steps seem to be:
drush updatedb
.I haven't delved into Core code to determine where this is happening, but it seems to me that either the changes from each update hook should be committed atomically rather than rolled-up into a single transaction; or, that the schema version updates in the database should happen in the same transaction as the update hooks themselves, to ensure that the schema version does not get incremented without the side-effects of the update taking effect.
Active
11.0 π₯
database update system
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Moving to the right component and tagging to be smashed. Haven't tried to reproduce this or confirm if it's a valid bug.