Problem/Motivation

The service "cache_tags.invalidator.checksum" uses hardcoded SQL queries and should therefore be backend_overridable. The service "cache.backend.database" creates the class \Drupal\Core\Cache\DatabaseBackend which has hardcoded SQL queries in it. Both are blocking the database driver for MongoDB.

Proposed resolution

Make the service "cache_tags.invalidator.checksum" and the service "cache.backend.database" backend_overridable.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None

Issue fork drupal-3209931

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

daffie created an issue. See original summary.

daffie’s picture

Status: Active » Needs review
longwave’s picture

Where does DatabaseBackendFactory make database queries? Or is it the hardcoded "new DatabaseBackend" that is the issue?

daffie’s picture

Issue summary: View changes

You are right @longwave, It is the class DatabaseBackendFactory who creates an instance of the class DatabaseBackend. It is the class DatabaseBackend who does the real work and has the hardcoded SQL queries in it. The easiest way to override the class DatabaseBackend is to override the class DatabaseBackendFactory. It is the class DatabaseBackendFactory that implements the service "cache.backend.database". If you know a better way to override the class DatabaseBackend, then please say so. I also updated the IS.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

No, that's fine, that makes sense now. So in MongoDB you provide a mongodb.cache.backend.database service which gets swapped in, which can then instantiate a MongoDB-specific instance of CacheBackendInterface for each database-backed bin. I think this is quite clean as-is and I don't see a better way of doing it, it matches all the other backend_overridable services.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1e7f978 and pushed to 9.2.x. Thanks!

  • catch committed 1e7f978 on 9.2.x
    Issue #3209931 by daffie, longwave: The service "cache_tags.invalidator....

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.