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
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:
Comments
Comment #3
daffie CreditAttribution: daffie commentedComment #4
longwaveWhere does DatabaseBackendFactory make database queries? Or is it the hardcoded "new DatabaseBackend" that is the issue?
Comment #5
daffie CreditAttribution: daffie commentedYou 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.
Comment #6
longwaveNo, 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.Comment #7
catchCommitted 1e7f978 and pushed to 9.2.x. Thanks!