Switch to a null backend for all caches for running the database updates

Created on 17 May 2019, over 5 years ago
Updated 12 September 2023, over 1 year ago

Problem/Motivation

There are many cases where running the database updates can be problematic with warm caches. #3052971: Notice: Undefined index: #include_fallback in Drupal\Core\Render\Element\StatusMessages::generatePlaceholder() β†’ is just a very recent example.

Proposed resolution

Decorate the cache_factory with a special update cache factory that uses a NullBackend based backend. The special update backend passes on deletes to the real backend so cache flushes occur as expected so once updates are not being done the caches are empty as expected.

Maybe a better fix would be to somehow swap back to the unmodified container - ie. one without UpdateServiceProvider prior to calling drupal_flush_all_caches(). The problemswith this are:

  • How to determine this in UpdateKernel - use a query parameter?
  • drupal_flush_all_caches() does a container rebuild so we’re going to end up with multiples of these.

Remaining tasks

Discuss/review.

User interface changes

Nope.

API changes

TBD.

Data model changes

Nope.

Release notes snippet

Caches are no longer used during Drupal's update process. They are only cleared.

πŸ› Bug report
Status

Fixed

Version

8.8 ⚰️

Component
Database updateΒ  β†’

Last updated 3 days ago

No maintainer
Created by

πŸ‡·πŸ‡΄Romania amateescu

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